Jump to content

script block seemingly not working


Constantine

Recommended Posts

Hi, it seems that the following script block do not produce any result (I'm appending it to the top of BALDUR.BCS):

 

IF
Died([ANYONE])
THEN
RESPONSE #100
//do something, for instance:
CreateCreatureObject("dogwar01",Protagonist,0,0,0)
Continue()
END
It's BG2-ToB. Any ideas of what I'm doing wrong?
Link to comment

"Died()" only gives true if the specified object died in exact the last script round. So, it would give true, theoretically, if your script block is executed exactly after the script round the creature died. The likely hood of that happening is very low (as you noticed).

Use "Dead()" instead.

 

And add a check variable, or this script block will spawn new creatures endlessly.

Link to comment

"Died()" only gives true if the specified object died in exact the last script round. So, it would give true, theoretically, if your script block is executed exactly after the script round the creature died. The likely hood of that happening is very low (as you noticed).

Use "Dead()" instead.

 

And add a check variable, or this script block will spawn new creatures endlessly.

Please elaborate. The Dead() trigger needs some death variable to work, it wouldn't work with objects like [ANYONE] or [GOODCUTOFF] right? I need the script block to fire if any creature just died, and I don't want to patch the individual scripts of all creatures.

Link to comment

I think jastey want to know who this "anyone" is, is it (only) player character, party member, an innocent, or just anyone, including the rabbit that killed itself cause it decided it was it's turn(this can be used in mechanical scripting procedures that are tricky to do otherwise). And/or hostile enemies...

 

?? :D

Also notice that when you look at "Died" in Near Infinity in all the .ids files you find the "0x004A Died(O:Object*)" -trigger in the Trigger.ids -file, and then go to Object.ids -file, you won't find "anyone" in there. Which is why the above won't compile&work.

Link to comment

I didn't mean to sound offending, but I really didn't get the [ANYONE] in your script block to actually mean anyone, literally.

 

Depending on what you have in mind - just in case it's not anyone but, say, a bunch of custom monsters, you could give them DVs and check for their death with OR(x) Dead() etc. But I am sure there would be a more elegant way, but I am no help there, I am afraid.

Link to comment
I am resurrecting this to ask something.
I wanted to set a global to 1 only if one of the party members (2-6) died in the last round.

I tested the following and it doesn't work.
IF
Global("#GTEST","GLOBAL",0)
    OR(5)
      Died(Player2)
      Died(Player3)
      Died(Player4)
      Died(Player5)
      Died(Player6)
THEN
RESPONSE #100
SetGlobal("#GTEST","GLOBAL",1)
END

What alternative do I have?

Thanks!

Link to comment

Does the engine consider a dead NPC to still occupy a PlayerX spot? You might want to check for all joinable NPCs by death variable instead.

 

I am testing this using 6 party members created by me and imported from a multiplayer game save so no joinable NPCs.

Link to comment

Like it was stated, it has to be executed at the right time, so either being at the top of the script (+luck) or in baldur.baf (+luck).

 

But, you're saying you don't care about delays ("died in last round"). So why not just use the usual statecheck and perhaps an extra global?

Link to comment

Like it was stated, it has to be executed at the right time, so either being at the top of the script (+luck) or in baldur.baf (+luck).

 

But, you're saying you don't care about delays ("died in last round"). So why not just use the usual statecheck and perhaps an extra global?

 

Because I want the deaths to be counted if happening during a specific combat encounter.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...