Constantine Posted October 25, 2014 Share Posted October 25, 2014 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
jastey Posted October 25, 2014 Share Posted October 25, 2014 "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
Constantine Posted October 25, 2014 Author Share Posted October 25, 2014 "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
jastey Posted October 25, 2014 Share Posted October 25, 2014 OK, I didn't understand this from your question (explaining more what you want to achieve reduces the amount of wrong answers). Not sure how you would check for that, then, sorry. Link to comment
Jarno Mikkola Posted October 25, 2014 Share Posted October 25, 2014 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... ?? 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
jastey Posted October 25, 2014 Share Posted October 25, 2014 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
CamDawg Posted October 25, 2014 Share Posted October 25, 2014 ANYONE is not a listed object, so the block compiles to Died(0). In object.ids, 0 is nothing, so the condition will never be true. edit: No, I'm an idiot--didn't notice the brackets. Link to comment
Salk Posted August 3, 2015 Share Posted August 3, 2015 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
Fiann of the Silver Hand Posted August 3, 2015 Share Posted August 3, 2015 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. Link to comment
Salk Posted August 3, 2015 Share Posted August 3, 2015 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
lynx Posted August 3, 2015 Share Posted August 3, 2015 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
Salk Posted August 3, 2015 Share Posted August 3, 2015 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
Salk Posted August 3, 2015 Share Posted August 3, 2015 So where's the problem? If any of the party members are already dead before the encounter happens, the block would return true when it shouldn't. Link to comment
lynx Posted August 3, 2015 Share Posted August 3, 2015 so one extra global per pc and no ORing later. Sure, more spaghetti, but doable. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.