Page 1 of 1

Items dropped from monsters

Posted: Sat Jul 05, 2014 8:15 pm
by Flaminglacier
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.

RE: Items dropped from monsters

Posted: Sat Jul 05, 2014 8:26 pm
by CloudFlash
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.

RE: Items dropped from monsters

Posted: Sat Jul 05, 2014 9:34 pm
by Ænima
Or make each dropped item do ThrustThing(random(0,255),2,0,0) in its spawn state.

RE: Items dropped from monsters

Posted: Sat Jul 05, 2014 11:32 pm
by Flaminglacier
Thanks guys, helped a lot.

RE: Items dropped from monsters

Posted: Wed Jul 09, 2014 4:19 am
by Flaminglacier
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?

RE: Items dropped from monsters

Posted: Wed Jul 09, 2014 7:07 am
by CloudFlash
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

RE: Items dropped from monsters

Posted: Wed Jul 09, 2014 5:43 pm
by Flaminglacier
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?

RE: Items dropped from monsters

Posted: Thu Jul 10, 2014 1:09 am
by Empyre
No because they have zero tics per frame, so they're simultaneous.