166
Help & Editing / Re: How do "I" do THAT in Doom Builder?
« on: June 22, 2016, 05:59:07 AM »
Aye, that should work fine. The script can't be named, though. It would need to use a number.
Zandronum doesn't support named scripts yet.
I'd format it like this, though:
You don't have to format it like this, but it only requires one script instead of the wiki's example, which makes use of two and uses a switch statement when it isn't exactly necessary in your case.
Switch statements are generally easier for large structures with a large number of possible outcomes. In smaller instances, if/else works just as well. It's ultimately up to you which way you plan on going about it, though. Everyone's style is different in some way.
Zandronum doesn't support named scripts yet.
I'd format it like this, though:
Code: [Select]
#include "zcommon.acs"
script X OPEN
{
int chance = random(0, 1);
if(chance > 0)
{
// Do things
}
}You don't have to format it like this, but it only requires one script instead of the wiki's example, which makes use of two and uses a switch statement when it isn't exactly necessary in your case.
Switch statements are generally easier for large structures with a large number of possible outcomes. In smaller instances, if/else works just as well. It's ultimately up to you which way you plan on going about it, though. Everyone's style is different in some way.



