
"Randomizing weapons"
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.
"Randomizing weapons"
How do I get a weapon to spawn one of a set of different weapons while it's on the ground? Like DBT did in Aeons of Death. 

You make an actor that is invisible and dissappears after it's done it's job. You make it A_Jump with a chance (or even a string of A_Jump lines), and at each possible outcome (ie, the jump doesn't happen or there's nowhere left to go) you have it spawn a weapon, then dissappear (to stop it doing anymore)
I did
, it said
where (xxxx,xxxx) is the coordinates (that I can't remember, but it's the shotgun in Entryway)
I changed the frames for _Shotgun (in decorate) from NULL A to SHOT A and I only get a shotgun, not a HeavyShotgun, not a RiotGun or a DoubleBarrelHandgun. I'll post the decorate as soon as I get home.

Code: Select all
_Shotgun at (xxxx,xxxx) has no frames
I changed the frames for _Shotgun (in decorate) from NULL A to SHOT A and I only get a shotgun, not a HeavyShotgun, not a RiotGun or a DoubleBarrelHandgun. I'll post the decorate as soon as I get home.

- Ryan Cordell
- Posts: 4349
- Joined: Sun Feb 06, 2005 6:39 am
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Capital of Explodistan
Yep.
OK, I'm home now, here's teh decorate:
I have defined all the sprites and decorate for these weapons. 

OK, I'm home now, here's teh decorate:

Code: Select all
Forget it, I changed it.

Last edited by Jimmy on Fri Jun 30, 2006 1:45 pm, edited 1 time in total.
Here's the new decorate, it's still only spawning an IDShotgun.
Code: Select all
actor _Shotgun 2001
{
States
{
Spawn:
SHOT A 0 A_Jump(136,2)
SHOT A 1 A_SpawnItem("IDShotgun")
Stop
SHOT A 0 A_Jump(136,2)
SHOT A 1 A_SpawnItem("IDSuperShotgun")
Stop
SHOT A 0 A_Jump(136,2)
SHOT A 1 A_SpawnItem("M16AssaultRifle")
Stop
SHOT A 0 A_Jump(136,2)
SHOT A 1 A_SpawnItem("HeavyShotgun")
Stop
SHOT A 0 A_Jump(136,2)
SHOT A 1 A_SpawnItem("RiotGun")
Stop
SHOT A 1 A_SpawnItem("DoubleBarrelHandgun")
Stop
}
}