PDA

View Full Version : Changeing enemy CSet not working...



ShadowMancer
07-17-2007, 02:52 AM
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... :( )

pkmnfrk
07-17-2007, 06:57 AM
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();
}

Dan Furst
07-17-2007, 11:07 AM
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.

C-Dawg
07-17-2007, 11:24 AM
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.

ShadowMancer
07-17-2007, 02:30 PM
okay so its not just me. Thank you for testing it out. I'll have to live without the flashing cset for now