Items dropped from monsters

Discuss all aspects related to modding Zandronum here.
Post Reply
Flaminglacier
 
Posts: 65
Joined: Thu Jun 21, 2012 9:28 pm

Items dropped from monsters

#1

Post by Flaminglacier » Sat Jul 05, 2014 8:15 pm

I know how to specify which object is dropped by which actor but I was wondering if there was any way to make the dropped items spread out in different directions when dropped. When I have a monster drop multiple items they all drop in the same spot, is there anyway to make like an explosion effect where the items burst out into different directions.
Image

User avatar
CloudFlash
Zandrone
Posts: 1074
Joined: Mon Jun 04, 2012 5:35 pm
Location: Wonderland (except not really)

RE: Items dropped from monsters

#2

Post by CloudFlash » Sat Jul 05, 2014 8:26 pm

If you are using DECRATE, simply change the 5th, 6th and 7th value of A_SpawnItemEx from '0' to 'random(-10,10)'.
If you are using ACS, use DECORATE.
Last edited by CloudFlash on Sat Jul 05, 2014 8:27 pm, edited 1 time in total.
https://i.imgflip.com/i5tpe.jpg
*Hey, who wants to hear my solution to the modern world's problems? ^Me! %Me! @Me! #Me! *WELL TOO BAD @Did he just stab himself with this butcher knife? %Looks like it ^Hey, the pizza guy arrived! %Pizza! Yey

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

RE: Items dropped from monsters

#3

Post by Ænima » Sat Jul 05, 2014 9:34 pm

Or make each dropped item do ThrustThing(random(0,255),2,0,0) in its spawn 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

Flaminglacier
 
Posts: 65
Joined: Thu Jun 21, 2012 9:28 pm

RE: Items dropped from monsters

#4

Post by Flaminglacier » Sat Jul 05, 2014 11:32 pm

Thanks guys, helped a lot.
Image

Flaminglacier
 
Posts: 65
Joined: Thu Jun 21, 2012 9:28 pm

RE: Items dropped from monsters

#5

Post by Flaminglacier » Wed Jul 09, 2014 4:19 am

CloudFlash wrote: If you are using DECRATE, simply change the 5th, 6th and 7th value of A_SpawnItemEx from '0' to 'random(-10,10)'.
If you are using ACS, use DECORATE.
When I use this method it seems to spawn 3 of the item I want to spawn. Is there anyway to set the amount of the item I want to spawn?
Image

User avatar
CloudFlash
Zandrone
Posts: 1074
Joined: Mon Jun 04, 2012 5:35 pm
Location: Wonderland (except not really)

RE: Items dropped from monsters

#6

Post by CloudFlash » Wed Jul 09, 2014 7:07 am

Hmmm.
The amount of items spawned with a_spawnitemex is always exactly one per frame...
So for example if you make it look like
TNT1 A 0 A_SpawnItemEx(stuff), you get one item; If you do
TNT1 AAA 0 A_SpawnItemEx(stuff), you get three items; If you do
TNT1 AAAAAAAAAA 0 A_SpawnItemEx(stuff), you get ten, etc etc.
This is really helpful if you want to have something spawn really huge number of items, but you dont want to flood your code with one repeated line over and over again :P
Last edited by CloudFlash on Wed Jul 09, 2014 7:08 am, edited 1 time in total.
https://i.imgflip.com/i5tpe.jpg
*Hey, who wants to hear my solution to the modern world's problems? ^Me! %Me! @Me! #Me! *WELL TOO BAD @Did he just stab himself with this butcher knife? %Looks like it ^Hey, the pizza guy arrived! %Pizza! Yey

Flaminglacier
 
Posts: 65
Joined: Thu Jun 21, 2012 9:28 pm

RE: Items dropped from monsters

#7

Post by Flaminglacier » Wed Jul 09, 2014 5:43 pm

Thank you that helps a lot. but if for example the amount of frames was 10 would that mess up the animation length or stretch the death animation?
Image

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

RE: Items dropped from monsters

#8

Post by Empyre » Thu Jul 10, 2014 1:09 am

No because they have zero tics per frame, so they're simultaneous.
"For the world is hollow, and I have touched the sky."

Post Reply