Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#539232 08/08/14 01:12 AM
Joined: Aug 2014
R
apprentice
OP Offline
apprentice
R
Joined: Aug 2014
So i have a super simple problem.


When a character goes to pick something up, i want it to check if a character is alive, and if so, do something

So -

IF
ItemAddedToCharacter(ITEM_KE_TheItem,_Player)
AND
???????????????????
THEN
ItemTeleportToPosition(ITEM_KE_TheItem,21.18,1.06,33.56);


for the ?????????? i've tried using
NOT CharacterIsDead(CHARACTER_Player1) (this just pretends the line isn't there)
!CharacterIsDead(CHARACTER_Player1) (doesn't compile)
CharacterIsDead(CHARACTER_Player1)-1 (thought i could modify the returned boolean, doesn't compile)

NOTHING is working. How do i negate a query (characterisdead is a query that returns a boolean)?

Last edited by RestarttGaming; 08/08/14 01:17 AM.
Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
You're not storing the returned value in a variable. There needs to be a second argument in your CharacterIsDead call that will house the output of the function.

From my story editor function topic-
Code
CharacterIsDead(CHARACTER Character, OUT INT Bool)


So in your case, you want to store that boolean, and then check it:

Code
IF
ItemAddedToCharacter(ITEM_KE_TheItem,_Player)
AND
CharacterIsDead(CHARACTER_Player1, _boolCheck)
AND
NOT _boolCheck
THEN
ItemTeleportToPosition(ITEM_KE_TheItem,21.18,1.06,33.56);

Joined: Aug 2014
R
apprentice
OP Offline
apprentice
R
Joined: Aug 2014
Yeah, but i can't seem to do just

NOT _Variable

it expects some function there, after the NOT

Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
Well you know. Either i misread your post and completely missing this or you are just not typing it right. This is my code and it worked perfect

IF
ItemAddedToCharacter(ITEM_CON_Drink_Cup_A_Apple_000, CHARACTER_Player2)
AND
CharacterIsDead(CHARACTER_Player2, 0)
THEN
CharacterAddAbilityPoint(CHARACTER_Player2, 50);

Characterisdead with a 0 after the player causes it to check if the player is dead. if not then it continues. I used ability points because its easier to see in a fresh game lol.

Or if you want character to be dead then replace the 0 with a 1 and it will only run if you pick up the item with a dead character.

Last edited by Demonata08; 08/08/14 01:50 AM.
Joined: Aug 2014
R
apprentice
OP Offline
apprentice
R
Joined: Aug 2014
HAHAHAHAHAHAHAHAHA

This system really needs documentation because it is rediculous.

You can't do simple negations or NOTs. You can't do OR. You can't check flags directly, you have to check the event associated with setting or unsetting the flag (though you can set "databases" to act like flags off of those EVENTS).

and oh, if a function is defined with an input and an output, setting the output as a variable saves the output to that variable, but setting it to an integer checks the output versus that integer.

Yeah Demon's solution works, but man, if we could use any standard coding thats used across most languages [you know, like IF (var1 == 0 || var2 >1)] it would be so much easier.

/endRantToBlowOffSteam

Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
Originally Posted by RestarttGaming
HAHAHAHAHAHAHAHAHA

This system really needs documentation because it is rediculous.

You can't do simple negations or NOTs. You can't do OR. You can't check flags directly, you have to check the event associated with setting or unsetting the flag (though you can set "databases" to act like flags off of those EVENTS).

and oh, if a function is defined with an input and an output, setting the output as a variable saves the output to that variable, but setting it to an integer checks the output versus that integer.

Yeah Demon's solution works, but man, if we could use any standard coding thats used across most languages [you know, like IF (var1 == 0 || var2 >1)] it would be so much easier.

/endRantToBlowOffSteam


Yeah osiris is very simple minded it seems. I had to spend a good two days figuring that out with a guard patrol.

My best advice for this system is the simpler the better.

Last edited by Demonata08; 08/08/14 02:10 AM.

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