GlobalVariable set to 2 but not casting to the script?

Post » Tue Jun 19, 2012 7:31 pm

WHY am I geting this error message in the game when this ability starts up?

This ability has a condition not to run if the global is not greater than 0.

So I know for a fact it is not set to zero. (it is a float set to 2 ) because I see the message in the game.


Scriptname aadpScript extends activemagiceffectGlobalVariable Property aadpMul  AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)if aadpMul.Getvalue() <= 0Debug.messagebox("Error Global is Zero")endifEndEvent
User avatar
Irmacuba
 
Posts: 3531
Joined: Sat Mar 31, 2007 2:54 am

Post » Tue Jun 19, 2012 11:30 am

You didn't forget to set the property by chance? :P
User avatar
Lauren Dale
 
Posts: 3491
Joined: Tue Jul 04, 2006 8:57 am

Post » Tue Jun 19, 2012 5:10 pm

One possible theory is that your condition is not parsed correctly:

if aadpMul.Getvalue() <= 0

Papyrus might think the above code somewhat equivalent to the following:

if aadpMul.Getvalue()
which is true.

From my experience, the following condition not working:
If (!Target.IsInCombat() || Target.GetCombatTarget() != Caster)

But this works correctly ......... >.<

If (!Target.IsInCombat() || (Target.GetCombatTarget() != Caster))
User avatar
Alan Whiston
 
Posts: 3358
Joined: Sun May 06, 2007 4:07 pm

Post » Tue Jun 19, 2012 7:41 am

You didn't forget to set the property by chance? :tongue:

^This.

Also depending on what you intend to do based on the globalvariable setting effect conditions might be more suitable than doing a script. If it's just about firing the effect only if the globalvariable is set to a certain value then you defenitly rethink using simple condition instead of a script.
User avatar
Tamika Jett
 
Posts: 3301
Joined: Wed Jun 06, 2007 3:44 am

Post » Tue Jun 19, 2012 1:26 pm

^This.

Also depending on what you intend to do based on the globalvariable setting effect conditions might be more suitable than doing a script. If it's just about firing the effect only if the globalvariable is set to a certain value then you defenitly rethink using simple condition instead of a script.

I think he's already using such a condition. The way his script is now set up is just to check if the global variable's value is correctly retrieved in the papyrus script. In the end he'll instead use the actual value for calculations. At least, I think so :P
User avatar
joseluis perez
 
Posts: 3507
Joined: Thu Nov 22, 2007 7:51 am

Post » Tue Jun 19, 2012 10:49 am

This is seriously ridiculous!

I have remade the Global and SET the GlobalVariable property several times, Tried putting parentheses around EVERYTHING and it still gives me the error.

:swear:

Has anyone successfully used float globals? I do see a few in the CK (vanilla game).

I have wasted hours on this issue.

(it is set to 2 for now, but it is possible for it LATTER to be set to 2.5 or .5 or other float values. once this is working, so it has to be a float.)
User avatar
Dustin Brown
 
Posts: 3307
Joined: Sun Sep 30, 2007 6:55 am

Post » Tue Jun 19, 2012 10:21 am

Make sure the "Constant" flag isn't ticked? Unlike the fallouts, they can't be set in game =/ Other than that, not sure, but I have a float global for version detection in Bag of Holding and it works as intended.

	If (BagOfHoldingGLOB.GetValue() < 1.11)		BagOfHoldingGLOB.SetValue(1.11)	Else		...
User avatar
Star Dunkels Macmillan
 
Posts: 3421
Joined: Thu Aug 31, 2006 4:00 pm

Post » Tue Jun 19, 2012 3:14 pm

They CANT be set in game?

OMG.... :nope:

Well if that is the case this is a waste of many many hours. The only reason I was using the global was so the player could set it in the game.

So is there no way for a player to set a var in the game? such as to set damage amounts for combat features?
User avatar
Kerri Lee
 
Posts: 3404
Joined: Sun Feb 25, 2007 9:37 pm

Post » Tue Jun 19, 2012 8:07 pm

He said constants can't be set in game, if the constant checkbox for the global is checked
User avatar
Ebony Lawson
 
Posts: 3504
Joined: Fri Feb 16, 2007 11:00 am

Post » Tue Jun 19, 2012 7:35 pm

Only "Constant" globals can't be set in game. So long as that flag is not checked, SetValue(), SetValueInt(), and Mod() should all work. I do wish "Constant" globals weren't written in stone though as it was convenient to have something that always reverts to a set value each save load.
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Tue Jun 19, 2012 6:23 pm

So you have actually gone to whereever you attached the script, right clicked, gone to edit properties, and set it to point to your global?
User avatar
Cedric Pearson
 
Posts: 3487
Joined: Fri Sep 28, 2007 9:39 pm

Post » Tue Jun 19, 2012 8:24 am

ok, I guess it was some kind of corruption in the CK file I was working on. I deleted everything concerning the global.

Saved it, rebooted my PC, then made it all again using all the same steps I did before, NOW IT WORKS....

What a wasted day of moding.

Thanks guys for trying to help, sorry I took up your time as well.
User avatar
Brιonα Renae
 
Posts: 3430
Joined: Mon Oct 22, 2007 3:10 am


Return to V - Skyrim