Page 1 of 1

Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 6:38 pm
by Fabysk
So, I want to make a monster give points/money to the player when the monster is killed in Project 115: Zombies Mode, but I can't find a way to do it. Does anyone know how to do this (ACS OR DECORATE)?

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 6:47 pm
by Ænima
Fabysk wrote: So, I'm trying to make a monster give points/money to the player when the monster is killed in Project 115: Zombies Mode, but I can't find a way to do it. Does anyone know how to do this (ACS OR DECORATE)?
Put A_GiveToTarget("item",amount) in the monster's Death state.

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 6:58 pm
by Fabysk
Alright, I'll give it a try in a while.

Also, can this statement work when the monster is shot/hurt?
(Fabysk is not on his computer at the moment: doing errands)

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 7:00 pm
by Klofkac
Just put the same DECORATE function to the pain state. It should work.. I hope.

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 7:37 pm
by Konda
Klofkac wrote: .. I hope.
If you're referring the the buggy target selection during the Pain state, it's only buggy for players (unless they fixed that). It works perfectly fine for monsters.

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 8:30 pm
by Fabysk

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 8:53 pm
by Mr.Man
Yes, but why dont you try it, instead of asking? :L

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 8:57 pm
by Fabysk
Mr.Man wrote: Yes, but why dont you try it, instead of asking? :L
Updated. Better?

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 10:02 pm
by Ænima
Fabysk wrote: Also, can this statement work when the monster is shot/hurt?
Klofkac wrote: Just put the same DECORATE function to the pain state. It should work...
Yep it should work just the same if you put it in the Pain state.


HOWEVER, this assumes that the monster has a 100% painchance. So you'd have to make the monster have a PainChance of 256 in order to recieve the credit/item EVERY single time you shoot him, without fail.

Increase the Actors health when a new wave start?

Posted: Sun Nov 03, 2013 10:15 pm
by Fabysk
Ænima wrote: Yep it should work just the same if you put it in the Pain state.

HOWEVER, this assumes that the monster has a 100% painchance. So you'd have to make the monster have a PainChance of 256 in order to recieve the credit/item EVERY single time you shoot him, without fail.
Thank you Ænima, it works perfectly. Another thing I want to do, which is off-topic to this post. Is it possible to make the Actors heath increase by any amount when an new wave starts for invasion?

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 11:05 pm
by Ænima
Fabysk wrote:
Ænima wrote: Yep it should work just the same if you put it in the Pain state.

HOWEVER, this assumes that the monster has a 100% painchance. So you'd have to make the monster have a PainChance of 256 in order to recieve the credit/item EVERY single time you shoot him, without fail.
Thank you Ænima, it works perfectly. Another thing I want to do, which is off-topic to this post. Is it possible to make the Actors heath increase by any amount when an new wave starts for invasion?
It depends what you mean. Do you mean like, make the monsters themselves spawn with more health? Or give the players more health?

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 11:07 pm
by Fabysk
Ænima wrote:
It depends what you mean. Do you mean like, make the monsters themselves spawn with more health? Or give the players more health?
Make the monsters themselves spawn with more health each wave

RE: Give Inventory script when a monster dies?

Posted: Sun Nov 03, 2013 11:15 pm
by Ænima

Code: Select all

Script 333 OPEN
{
 While((GetInvasionWave() != 2))
 {
 Delay(1);
 }
 SetActorProperty(TID of monster,  APROP_SpawnHealth, amount);


 While((GetInvasionWave() != 3))
 {
 Delay(1);
 }
 SetActorProperty(TID of monster,  APROP_SpawnHealth, larger amount);
}
Etc etc etc.

RE: Give Inventory script when a monster dies?

Posted: Fri Nov 15, 2013 9:32 pm
by Fabysk
Ænima wrote:

Code: Select all

Script 333 OPEN
{
 While((GetInvasionWave() != 2))
 {
 Delay(1);
 }
 SetActorProperty(TID of monster,  APROP_SpawnHealth, amount);


 While((GetInvasionWave() != 3))
 {
 Delay(1);
 }
 SetActorProperty(TID of monster,  APROP_SpawnHealth, larger amount);
}
Etc etc etc.
The TID for the Monster is the Spawn ID? I'm confused on finding what the TID of the monster is.

RE: Give Inventory script when a monster dies?

Posted: Fri Nov 15, 2013 9:55 pm
by Ænima
A TID (thing ID) is different from a spawn ID.


If you give the monster spawners a custom TID in Doombuilder, that TID *should* in theory be passed to the monsters it spawns, and then you can plug that ID number into the script so it will affect them.

RE: Give Inventory script when a monster dies?

Posted: Fri Nov 15, 2013 10:03 pm
by Fabysk
Ænima wrote: A TID (thing ID) is different from a spawn ID.


If you give the monster spawners a custom TID in Doombuilder, that TID *should* in theory be passed to the monsters it spawns, and then you can plug that ID number into the script so it will affect them.
It didn't work :( oh well

RE: Give Inventory script when a monster dies?

Posted: Fri Nov 15, 2013 10:13 pm
by Ænima
Okay then you'll have to edit that monster's DECORATE and put Thing_ChangeTID(0,yournumber) in the SECOND frame of the Spawn state (can't be the first). That way that monster will always spawn with that TID and can therefore have it's base health manipulated by that ACS script I posted earlier.

RE: Give Inventory script when a monster dies?

Posted: Fri Nov 15, 2013 10:29 pm
by Fabysk
Ænima wrote: Okay then you'll have to edit that monster's DECORATE and put Thing_ChangeTID(0,yournumber) in the SECOND frame of the Spawn state (can't be the first). That way that monster will always spawn with that TID and can therefore have it's base health manipulated by that ACS script I posted earlier.
http://prntscr.com/24eh75
It didn't work either
I'll continue to find solutions. You can continue to give solutions that I will try out.