Give Inventory script when a monster dies?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

Give Inventory script when a monster dies?

#1

Post by Fabysk » Sun Nov 03, 2013 6:38 pm

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)?
Last edited by Fabysk on Sun Nov 03, 2013 8:57 pm, edited 1 time in total.
Image Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Give Inventory script when a monster dies?

#2

Post by Ænima » Sun Nov 03, 2013 6:47 pm

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Give Inventory script when a monster dies?

#3

Post by Fabysk » Sun Nov 03, 2013 6:58 pm

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)
Last edited by Fabysk on Sun Nov 03, 2013 7:00 pm, edited 1 time in total.
Image Image Image

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Give Inventory script when a monster dies?

#4

Post by Klofkac » Sun Nov 03, 2013 7:00 pm

Just put the same DECORATE function to the pain state. It should work.. I hope.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

RE: Give Inventory script when a monster dies?

#5

Post by Konda » Sun Nov 03, 2013 7:37 pm

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.

Code: Select all

<Synert> fuck
<Synert> plugged in my memory stick and got a bsod

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Give Inventory script when a monster dies?

#6

Post by Fabysk » Sun Nov 03, 2013 8:30 pm

Image Image Image

Mr.Man
Forum Regular
Posts: 657
Joined: Thu May 09, 2013 7:25 pm

RE: Give Inventory script when a monster dies?

#7

Post by Mr.Man » Sun Nov 03, 2013 8:53 pm

Yes, but why dont you try it, instead of asking? :L

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Give Inventory script when a monster dies?

#8

Post by Fabysk » Sun Nov 03, 2013 8:57 pm

Mr.Man wrote: Yes, but why dont you try it, instead of asking? :L
Updated. Better?
Image Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Give Inventory script when a monster dies?

#9

Post by Ænima » Sun Nov 03, 2013 10:02 pm

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

Increase the Actors health when a new wave start?

#10

Post by Fabysk » Sun Nov 03, 2013 10:15 pm

Æ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?
Last edited by Fabysk on Sun Nov 03, 2013 10:18 pm, edited 1 time in total.
Image Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Give Inventory script when a monster dies?

#11

Post by Ænima » Sun Nov 03, 2013 11:05 pm

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?
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Give Inventory script when a monster dies?

#12

Post by Fabysk » Sun Nov 03, 2013 11:07 pm

Æ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
Image Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Give Inventory script when a monster dies?

#13

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

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Give Inventory script when a monster dies?

#14

Post by Fabysk » Fri Nov 15, 2013 9:32 pm

Æ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.
Image Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Give Inventory script when a monster dies?

#15

Post by Ænima » Fri Nov 15, 2013 9:55 pm

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Give Inventory script when a monster dies?

#16

Post by Fabysk » Fri Nov 15, 2013 10:03 pm

Æ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
Image Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Give Inventory script when a monster dies?

#17

Post by Ænima » Fri Nov 15, 2013 10:13 pm

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Give Inventory script when a monster dies?

#18

Post by Fabysk » Fri Nov 15, 2013 10:29 pm

Æ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.
Image Image Image

Post Reply