How to Count amount of creatures
Started by Domi, Jul 26 2004 06:44 AM
12 replies to this topic
#1
Posted 26 July 2004 - 06:44 AM
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?
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?
Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3
I understand that folks prefer code that works. -CamDawg, G3
#2
Posted 26 July 2004 - 07:10 AM
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?
"Leave me be, I don't want to argue.
I just get confused and I come all undone.
If I agree, well it's just to appease you,
'Cause I don't remember what we're fighting for."
I just get confused and I come all undone.
If I agree, well it's just to appease you,
'Cause I don't remember what we're fighting for."
#5
Posted 26 July 2004 - 07:32 AM
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...
#7
Posted 26 July 2004 - 07:49 AM
Domi, on Jul 26 2004, 04:36 PM, said:
Also, wheer can I find info on SPRITE_IS_DEAD? I did a quick search of IESDP, but did not find it 
Edited by Grim Squeaker, 26 July 2004 - 07:51 AM.
"Leave me be, I don't want to argue.
I just get confused and I come all undone.
If I agree, well it's just to appease you,
'Cause I don't remember what we're fighting for."
I just get confused and I come all undone.
If I agree, well it's just to appease you,
'Cause I don't remember what we're fighting for."
#10
Posted 26 July 2004 - 08:29 AM
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:
...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)
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
#12
Posted 26 July 2004 - 08:38 AM
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
Fortunately, Grim gave me a simpler solution than using Die(), I am going to test it tonight and see if it works
Edited by Domi, 26 July 2004 - 08:43 AM.
Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3
I understand that folks prefer code that works. -CamDawg, G3
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












