Frustrating, but Yeah, this bug only appears if you are using (!enemy->isValid()) or something similar. That was what Joe123's problem was in this thread also.
DD or DN, I believe you have this quest already, if not let me know. It's the one with the apporting tonberry.
In 704 if you goto map5, screen 3,3 you'll fight the green jello blobs .)..(It's the only enemy that uses isValid), sometimes when you enter it disappears, other times it behaves normally. I don't remember ever having a problem with 675 with this particular enemy.
Or if that's too much it's the ffc script npc_fuzzball{
-Like I said though, only thing that's different from this npc is I used it to test isValid();.
Aarg, well it may not be isValid at all... >_< , I'm stumped. If Trace finds anything i'll post it up. This one is driving me nuts. 😡
edit* wow, I'm gonna throw in the towel till after the holidays. After I added this:
int td = this->Data; Trace(td);
right after while(true) the ffc's would revert to 0 randomly. Thus giving the illusion of isValid being buggy. So I commented out //if(!isValid), and got the same thing. :angry:
Well I think I figured it out. 704 just doesn't work sometimes. :shrug: Some things that are perfect in the late 600 builds just seem broken altogether with this one. I didn't get any useful data with Trace(); , and, I swear that I have a script that, when sometimes doesn't work, if I insert a dummy if statement at the begining, starts working. 😕😮dd: And by dummy I mean;
if(Link->HP > 999){Link->HP--;}
Well, thats about all I have.
Could you post a small sample quest, containing only a script that isn't working correctly?
Yeah, I was gonna try that when I have some time anyway, Just really busy this week. And for clarification, isValid works fine it seems.
Maybe DN can up the 3-day reply time for this thread before moving this to exterminated.😉
OK, so for these problem, maybe there is no bug. I was having some ffc scripts change npc pointers for various things, and when I made a small test quest it worked fine. Go figure. The best I could do is write a script wrong to simulate the type of glitchyness I got. What I can figure out so far from it is if you point to an invalid npc you get the standard,
Script Attempted to reference a non-existant NPC!
Script Attempted to reference a non-existant NPC!
Then, if on a subsequent line make the pointer valid, then you get odd behavior from the ffc such as; ffc disappearing anywhere from instantly to 15 seconds later, or if the pointer prints another error. What got me was the ffc seemed to work fine at this time, then it vanishes and I get sad.
A small test script to check this:
ffc script tst
{
void run()
{
bool init = true;
npc e;
int rand = Rand(3);
while(true)
{
e->X = this->X;
e->Y = this->Y;
if(init)
{
if(rand==0)e = Screen->CreateNPC(255);
else if(rand==1)e = Screen->LoadNPC(1);
else e = Screen->LoadNPC(2);
init=false;
}
if(this->X > 232) { this->Vx = -1; this->X--;}
if(this->X < 8) { this->Vx = 1; this->X++;}
if(this->Y > 152) { this->Vy = -1; this->Y--;}
if(this->Y < 8) { this->Vy = 1; this->Y++;}
if(e->
Waitframe();
}}}
Which didn't really help me that much in the vanishing department, but managed to spit out 120 error messages per second.
So really, after messing with this a bunch, I think I just miss the times when zc would just crash. :rofl: Then you were pretty certain you did something wrong, rather than trying to figure out why the ffc->Data suddenly became 0. Again, really everything seems to work fine though if you want to remove this from open bugs.
DD, are ffcs data supposed to become 0 for any reason? and when that happens, it shut's off the script running it, right?
No, nothing should be randomly changing the FFC's data, and yes, if data is set to 0, the FFC stops running.
I'm having trouble understanding what you're reporting. You create a NPC, use its pointer. Then the NPC is killed/becomes invalid. A new NPC then appears, at which point your script, using the stale NPC pointer, starts modifying it instead. Then the FFC data becomes 0?
DarkDragon wrote:
I'm having trouble understanding what you're reporting. You create a NPC, use its pointer. Then the NPC is killed/becomes invalid. A new NPC then appears, at which point your script, using the stale NPC pointer, starts modifying it instead. Then the FFC data becomes 0?
I don't even know what I'm reporting anymore. :uhoh: I randomly have a select few scripts that "turn themselves off" sometimes, which I think I fixed somehow, but can't seem to duplicate that in a small environment test quest just yet.
Other than that I've got 99% of the other scripts working great. Whee!!!