Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Changeing enemy CSet not working...

4 replies · 1,616 views · Started 17 July 2007

the code fragment:

int def_cset = trg_ene->CSet;
if (trg_ene->CSet == def_cset) {
trg_ene->CSet = 5;}
else {
trg_ene->CSet = def_cset;}

this is in a while loop
everything else in the loop works so I know the script is running right, but the enemy should change colors right?

(btw I tried many different CSet changes: random, incremental, etc, and no change whatsoever... 😞 )

Well, it depends how exactly your loop is set up. I assume it looks something like this:

while(true) {
int def_cset = trg_ene->CSet;
if (trg_ene->CSet == def_cset) {
trg_ene->CSet = 5;
} else {
trg_ene->CSet = def_cset;
}
Waitframe();
}

If that's the case, it won't work the way you think. Look at where it records the "def_cset". The proper way to do this is:

int def_cset = trg_ene->CSet;
while(true) {
if (trg_ene->CSet == def_cset) {
trg_ene->CSet = 5;
} else {
trg_ene->CSet = def_cset;
}
Waitframe();
}

This appears to be a bug. I wrote some test scripts and I can't get the CSet to change either. (I had a similar problem with npc->Rate.)

I'll report it as a bug.

Same here. In my custom weapon scripts, the enemy is supposed to flash Csets and then return to the original Cset. Usually, the script is ignored entirely. Sometimes, the enemy's Cset changes permanently, leaving you with an off-colored enemy. The behavior has never been correct.