Domi Posted July 26, 2004 Share Posted July 26, 2004 What I am trying to do is to count how many ankhegs I kill on a certain map after the Ranger Gerde asks to kill no more than ten. So what I did was: SetGlobal("AnkhegCount","FW4500",1) at the entry to the map (sets and is fine) Then I appended the following block of script to all ankhegs in the area (they are special case of CRE and already have the following block: IF Die() THEN RESPONCE #100 SetGlobal("HelpGerde","GLOBAL",1) END IF Global("AnkhegCount","FW4500",1) GlobalGT("HelpGerde","GLOBAL",0) Die() THEN RESPONCE #100 IncrementGlobal("AnkhegCount","FW4500",1) END Er... does not work. Any thoughts? Link to comment
Grim Squeaker Posted July 26, 2004 Share Posted July 26, 2004 Why not give all the Ankhegs in that area a particular death variable (e.g. Foo) and just use the value of SPRITE_IS_DEADFOO? Link to comment
Domi Posted July 26, 2004 Author Share Posted July 26, 2004 Well, what if I kill some snkhegs *prior* to talking to Gerde. Will they still be counted by SPRITE_IS_DEAD ? Link to comment
Domi Posted July 26, 2004 Author Share Posted July 26, 2004 Also, wheer can I find info on SPRITE_IS_DEAD? I did a quick search of IESDP, but did not find it Link to comment
icelus Posted July 26, 2004 Share Posted July 26, 2004 Also, I don't know if it's just how it was typed her, or if it's how it is in the actual script file, but will the engine accept "RESPONCE" instead of "RESPONSE"? Although, come to think of it, if it didn't, I guess the script wouldn't compile at all... Link to comment
Domi Posted July 26, 2004 Author Share Posted July 26, 2004 yep, it is typed in the script correctly, I am just showing what I have there Link to comment
Grim Squeaker Posted July 26, 2004 Share Posted July 26, 2004 Also, wheer can I find info on SPRITE_IS_DEAD? I did a quick search of IESDP, but did not find it SPRITE_IS_DEAD# is a variable that is created for each DV. e.g. if Nalia has died then a check of Globals will show SPRITE_IS_DEADNALIA = 1. If you have multiple CREs with the same DV it will count them. So the obvious thing would be do would be Set the global of SPRITE_IS_DEADAREAANKHEGS to 0 when you start the quest (resetting the counter so it ignores any ankhegs killed before the quest begins). Link to comment
Grim Squeaker Posted July 26, 2004 Share Posted July 26, 2004 Neat. Thank you! Any time. Link to comment
Baronius Posted July 26, 2004 Share Posted July 26, 2004 FW4500 is Firewine Bridge area, while FW1400 is the one where Gerde is, but I suppose you would like to measure the number on FW4500 then. Although your script extension block isn't correct: IF Global("AnkhegCount","FW4500",1) GlobalGT("HelpGerde","GLOBAL",0) Die() THEN RESPONSE #100 IncrementGlobal("AnkhegCount","FW4500",1) END ...because it will never trigger once AnkhegCount exceeds 1. I don't see why you use AnkhegCount as a variable in SetGlobal("AnkhegCount","FW4500",1) A possible solution with AnkhegInit, if I am interpreting your concept correctly: SetGlobal("AnkhegInit","FW4500",1) IF Global("AnkhegInit","FW4500",1) GlobalGT("HelpGerde","GLOBAL",0) Die() THEN RESPONSE #100 IncrementGlobal("AnkhegCount","FW4500",1) END Link to comment
Baronius Posted July 26, 2004 Share Posted July 26, 2004 By the way Die() itself is very unreliable in BG1, but I suppose it works fine in Tutu due to the BG2 script system. If it wouldn't work reliably after all, use the area script to count the ankheg deaths. Link to comment
Domi Posted July 26, 2004 Author Share Posted July 26, 2004 I see what you are saying (and yep, the area was correct in the script, it's just me typing things by memory outsiude my modding den) it did not even increment to 2, just stayed on 1 (it should have) - so the script did not work at all. Fortunately, Grim gave me a simpler solution than using Die(), I am going to test it tonight and see if it works Link to comment
Baronius Posted July 26, 2004 Share Posted July 26, 2004 Yeah, Die() is not the best solution for such a task. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.