Random weapon or item spawns

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Posts: 56
Joined: Tue Apr 05, 2022 3:43 am

Random weapon or item spawns

Post by DELTAtheDboi005 »

Hey, just wondering:

How do you make random weapon or item spawns?

Say for example:
There's a shotgun with two fire modes, One is pellets, The other is slugs. And they are separate ammo types.

Or a chaingun with two variants, one is like an automatic grenade launcher, the other is just your standard chaingun.

I can never wrap my head around it, I've seen it in other mods, But have never done it myself. How does work exactly?.

Just curious. :?:
User avatar
Blue Shadow
Posts: 4903
Joined: Sun Nov 14, 2010 12:59 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Random weapon or item spawns

Post by Blue Shadow »

Random spawning is usually done by utilizing the [wiki=Classes:RandomSpawner]RandomSpawner[/wiki] actor class.

Return to “Scripting”