Troubling Scripting
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Troubling Scripting
I came across this problem while working on a project, What i want to do is when a monster gets kill, it give the player a certain amount of armor. I tried to do a action special of 80 on the monster leading to script that said giveinventory("armor", 5); and it wont work, any ideas?
Hmmm, I'm guessing that the monster is the activator of the script and is therefore the one getting the armour.
There may well be other/ better ways, but how about having a player activated script that simply checks for the presence of the crucial monster(s) and then when they are all dead gives the armour?
There may well be other/ better ways, but how about having a player activated script that simply checks for the presence of the crucial monster(s) and then when they are all dead gives the armour?
-
Richard213
- Posts: 43
- Joined: Sun Dec 05, 2004 1:35 pm
Hmmm. ThingCount(Type,TID); would be the way i'd do it.
Code: Select all
#include "zcommon.acs"
script 1 open
{
if (Thingcount(0,213) == 0) // if the actor with TID 213 dies
{
GiveInventory("Armor",5); // give player 5% armor
}
Delay(1);
restart;
}
I was thinking more like:
Same nut, slightly different way to crack it. 
Code: Select all
script 1 (void)
{
while (Thingcount (0, 213) > 0)
{
delay (1);
}
GiveInventory("Armor",5);
}- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
