How to made spawn conditions in Randomspawner?

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!)
Post Reply
Vamvilodon
Posts: 2
Joined: Tue Jul 29, 2025 6:02 pm

How to made spawn conditions in Randomspawner?

Post by Vamvilodon »

Hi, im working in a replacer option in my mod that spawn diferent actors after the player have more items. My problem its for some reason the condition dont work and i dont really undesrtand why.
The Cvar "Pink" works fine but the "int C" doesnt work. What am i doing wrong?

Code: Select all

[class rzombieman : RandomSpawner replaces ZombieMan
{ 
    override Name ChooseSpawn()
    {
	  int C = players[0].mo.countinv("vitaminC");
        if (pink == 1)
		{
		  if (C == 0)
		  {
            return 'personas';
		  }
		  else if (C >= 0)
		  {
		    return 'pacos';
		  }
		}
	    if (pink == 2)
		    return 'bipedo';
        else
            return 'doomImp';
    }
}]

The Cvar "Pink" works fine but the "int C" doesnt work.
Post Reply

Return to “Scripting”