SwordGrunt wrote:"All arrays must have script (New from 2.8.1), map, global or world scope (the last two are special case arrays though)."
Script arrays are not supported by Zandronum so you'll get odd results attempting to use them. Why not just declare them as map arrays, outside your script?
Perhaps if you share a bit more on what you're using the array for, I could tell you whether or not you really want the script scope on your variable. Usually that's only needed for scripts with multiple instances called (ACS_ExecuteAlways and derivatives) where each instance can use the variable without affecting the others (while I've personally never used it this way, I remember seeing a script that did, I believe it was ZDoom Wars' health bar script).
Alright, here's my full code. This is my first project with ACS, so it's probably nausiating to look at for anyone who's experienced with ACS lol
Code: Select all
#include "zcommon.acs"
#define maxCount 350
script 1 ENTER
{
Sector_SetFade(2, 25, 25, 25); // spooky fog
Sector_SetDamage(2, 20, MOD_POISON);
}
script 2 ENTER
{
int count = 0;
int toSpawn = 1;
while(true)
{
if(count < maxCount)
{
count++;
HudMessage(s:"Time until next spawn:", d:(maxCount - count)/35; HUDMSG_PLAIN, 1, CR_BLUE, 0.5, 0.0, 0);
Delay(1);
}
else // NOTE: Everything commented out is broken, fix it later/never
{
int spawned = 0;
// log(s:"Setting up demons array");
// int demons[10] = {UniqueTID(), UniqueTID(), UniqueTID(), UniqueTID(), UniqueTID(), UniqueTID(), UniqueTID(), UniqueTID(), UniqueTID(), UniqueTID()};
while(spawned < toSpawn)
{
// log(s:"Setting up newID");
int newID = UniqueTID();
spawned += SpawnSpot("Demon", 1, newID);
// TODO: Change demon stuff
Delay(1);
}
toSpawn += 1;
count = 0;
}
}
}
The idea behind my mod was this; every 10 seconds a wave of demons will spawn and attack the player, kind of like Nazi Zombies.
What I was trying to do, was create a bunch of demons and delay the next wave until they're all dead. I originally tried to do it with int demons[toSpawn], but ACC thinks I'm trying to create an array with 0 entries. Then I thought "well, I don't need more than 10 demons for now, I'll just do that for now." So, after reading your comment, it makes sense why Zandronum terminated my script when declaring my array.
Thanks for the help, by the way!