Quantcast
Channel: ZDoom
Viewing all articles
Browse latest Browse all 3391

Scripting • Re: [ZSCRIPT] How do I check for a CVar in a RandomSpawner?

$
0
0
For custom random spawner logic, you need to override the ChooseSpawn method. As for CVARs, they can be referenced directly from ZScript - the functions are there mostly if you need to access the metadata (e.g. value type). NB: Your CVAR must be marked server, or it will break multiplayer.

Code:

Class RandShotgunGuy : RandomSpawner replaces ShotgunGuy{    override Name ChooseSpawn()    {        return Random(1, 11) <= 10 || !wm_sv_rand_spawn_stealth             ? 'WShotgunGuy'             : 'SWShotgunGuy';    }}
Is it possible to replicate it in DECORATE?

Statistics: Posted by EmperorGrieferus — Mon Aug 26, 2024 9:51 pm



Viewing all articles
Browse latest Browse all 3391

Trending Articles