Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Aug 2014
M
Mag Offline OP
journeyman
OP Offline
journeyman
M
Joined: Aug 2014
Does everything before the THEN in a procedure need to be a condition? I'm trying to use the dif between two numbers as a condition for my then statement. I'm not getting errors but the condition keeps coming out false and the THEN statement is not executing.

I'm wondering if IntegerSubtract is allowed to be used in procedures.

Here's a bit of the code.

IntegerSubtract(_TriggerNum,_LastTriggerNum,_TrigDif)
AND
_TrigDif == "2"
THEN
PlayEffectAtCharacter("FX_Skills_Air_Storm_Impact_A",_Player);
CharacterTeleportToTrigger(_Player,_LastTrig,"");

Thanks

Mag

Last edited by Mag; 01/09/14 08:16 PM.
Joined: Aug 2014
M
Mag Offline OP
journeyman
OP Offline
journeyman
M
Joined: Aug 2014
Also I've tried hard coding numbers to make it come out 2, just to be sure the code populating the variables isn't wrong but its still coming out false.

Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
The problem most likely is that your "2" is in quotes, which makes the game try to compare an Integer to a String (anything surrounded by double quotes is a String). Integers are never Strings, so the == will always be False.

Joined: Aug 2014
M
Mag Offline OP
journeyman
OP Offline
journeyman
M
Joined: Aug 2014
Yeah that was it. I should have known better smile Thanks!


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5