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

Screen->CreateNPC; [<=704]

46 replies · 7,681 views · Started 02 January 2008

ffc script fort_knight1{
void run(){
int t;
int switch = 0;
npc one = Screen->CreateNPC(179);
Waitframes(4);
one->HP = 40;
int hp;
int x = this->X;
int y = this->Y;

while(true){
if(!(one->isValid())){Quit();}
hp = one->HP; Trace(hp);
t++;
this->X = 120 + 56*Cos(2*t);
this->Y = 72 + 40*Sin(2*t);

one->X = x+8;
one->Y = y+8;
x = this->X;
y = this->Y;

if(hp <= 20 && switch == 0){
Game->PlaySound(10);
this->Data = 3033;
switch = 1;
}
if(hp <= 10 && switch == 1){
Game->PlaySound(10);
this->Data = 3034;
switch = 2;
}
Waitframe();
}
}
}

Most of the time, this script will work fine and dandy.
On apparently random occasions, 'one' is just not created at all...

I've spent a long time looking at this now, and I don't think it's anything to do with the script.

http://two.xthost.info/Joe123/The&#37;20Legend%20of%20Zelda%20-%20The%20Fort%20Knights.zip

Dmap 7 screen (1,3)
Dmap 13 screen (2,3)
Dmap 18 screen (3,5)
Dmap 23 screen (7,2)

If you use Go To (level 4 cheat is 4) you should be able to access them easily.

The first one is the script I posted, the other three show the same problem, but with slight variations on the script (it just moves in a different pattern).

It doesn't occur every time, and I'm afraid I don't know what governs when it does occur, but it appears to happen about 50% of the time though...

It didn't happen a single time for me. Every time I entered one of the rooms, the knight started circling or moving side-to-side, depending on the location.

As I said, it never fails. Here is the log from entering and exiting the room several times:


Zelda Classic v2.11 Beta (Build 18)
Allocating quest path buffers (4.00k/4.00k)...OK
Allocating map buffer (833.53k/837.53k)... OK
Allocating combo buffer (5.98k/843.51k)... OK
Allocating string buffer (9.75M/10.57M)... OK
Allocating door combo buffer (159.50k/10.73M)... OK
Allocating dmap buffer (234.00k/10.96M)... OK
Allocating combo buffer (1.62M/12.58M)... OK
Allocating color data buffer (314.11k/12.88M)... OK
Allocating tile buffer (511.88k/21.38M)... OK
Allocating trash buffer (97.66k/21.48M)... OK
Allocating item buffer (31.00k/21.51M)... OK
Allocating weapon buffer (2.50k/21.51M)... OK
Allocating guy buffer (22.00k/21.53M)... OK
Allocating combo class buffer (29.91k/21.56M)... OK
Initializing Allegro... OK
Checking Files... OK
Allocating bitmap buffers... OK
Loading data files:
Zelda.Dat...OK
Fonts.Dat...OK
SFX.Dat...OK
Initializing sound driver... OK
Used switch: -fullscreen
Triplebuffer available
Loading saved games... Loading Quest...

Decrypting...okay.
Opening...okay.
Reading Header...okay.
Reading Rules...okay.
Reading Strings...okay.
Reading Doors...okay.
Reading DMaps...okay.
Reading Misc. Data...okay.
Reading Misc. Colors...okay.
Reading Game Icons...okay.
Reading Items...okay.
Reading Weapons...okay.
Reading Maps...okay.
Reading Combos...okay.
Reading Combo Aliases...okay.
Reading Color Data...okay.
Reading Tiles...okay.
Reading Tunes...okay.
Reading Cheat Codes...okay.
Reading Init. Data...okay.
Reading Custom Guy Data...okay.
Reading Custom Link Sprite Data...okay.
Reading Custom Subscreen Data...okay.
Reading FF Script Data...okay.
Reading SFX Data...okay.
Done.
Loading Quest...

Decrypting...okay.
Opening...okay.
Reading Header...okay.
Reading Rules...okay.
Reading Strings...okay.
Reading Doors...okay.
Reading DMaps...okay.
Reading Misc. Data...okay.
Reading Items...okay.
Reading Weapons...okay.
Reading Custom Guy Data...okay.
Reading Maps...okay.
Reading Combos...okay.
Reading Color Data...okay.
Reading Tiles...okay.
Reading Tunes...okay.
Reading Cheat Codes...okay.
Reading Init. Data...okay.
Reading Custom Link Sprite Data...okay.
Done.
Loading Quest...

Decrypting...okay.
Opening...okay.
Reading Header...okay.
Reading Rules...okay.
Reading Strings...okay.
Reading Doors...okay.
Reading DMaps...okay.
Reading Misc. Data...okay.
Reading Misc. Colors...okay.
Reading Game Icons...okay.
Reading Items...okay.
Reading Weapons...okay.
Reading Maps...okay.
Reading Combos...okay.
Reading Combo Aliases...okay.
Reading Color Data...okay.
Reading Tiles...okay.
Reading Tunes...okay.
Reading Cheat Codes...okay.
Reading Init. Data...okay.
Reading Custom Guy Data...okay.
Reading Custom Link Sprite Data...okay.
Reading Custom Subscreen Data...okay.
Reading FF Script Data...okay.
Reading SFX Data...okay.
Done.
OK
Loading Quest...

Decrypting...okay.
Opening...okay.
Loading Quest...

Decrypting...okay.
Opening...okay.
Loading Quest...

Decrypting...okay.
Opening...okay.
Loading Quest...

Decrypting...okay.
Opening...okay.
Reading Header...okay.
Reading Rules...okay.
Reading Strings...okay.
Reading Doors...okay.
Reading DMaps...okay.
Reading Misc. Data...okay.
Reading Misc. Colors...okay.
Reading Game Icons...okay.
Reading Items...okay.
Reading Weapons...okay.
Reading Maps...okay.
Reading Combos...okay.
Reading Combo Aliases...okay.
Reading Color Data...okay.
Reading Tiles...okay.
Reading Tunes...okay.
Reading Cheat Codes...okay.
Reading Init. Data...okay.
Reading Custom Guy Data...okay.
Reading Custom Link Sprite Data...okay.
Reading Custom Subscreen Data...okay.
Reading FF Script Data...okay.
Reading SFX Data...okay.
Done.
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
40.0000
Armageddon Games web site: http://www.armageddongames.com
Zelda Classic web site: http://www.zeldaclassic.com

Well I released the game about a month ago, and I've had at least 10 people saying they've had the issue.

I think it shows lots of 'Script Attempted to Reference Non-Existent NPC' when it happens, although it was a while back when I checked.

Also, I used to be setting the NPC's health with the script also (I made seperate enemies with the correct amounts of health in an attempt to fix the issue), and when I was doing that the trace value was capped at the NPC's original value; it wasn't being set to the new one.

It happened to me while playing this game also. In lv1 I got a free heart container and item, and the boss of lv2 wasn't in any better working condition, So I quit and took a look at the script file.

But after that first playthrough, I coundn't recreate the bug no matter how hard I tried... O_o

I'm getting these:

Script attempted to reference a nonexistent NPC!
Script attempted to reference a nonexistent NPC!

errors from this script, even though I think I set it up right to make everything valid. The script itself works fine, just can't figure out why it doesn't want to reference the npc for one frame.

ffc script instill_blue_shooter{

void run(int enemyHP, int shoot_amount, int shoot_delay, int speed){

bool find_weapon = false;

if(enemyHP==0)enemyHP=20;
if(shoot_amount==0)shoot_amount=3;
if(shoot_delay==0)shoot_delay=15;
if(speed==0)speed=2;
npc life;

Waitframe();
life = Screen->CreateNPC(254);
life->HP = enemyHP;
life->X=(Rand(13)+1*16);
life->Y=16;

int ffc_num = 17;
ffc F = Screen->LoadFFC(ffc_num);

int delay = 0;
int burst = 1;

int sa = shoot_amount;
int fd = shoot_delay;
int w = 40; //waitframes
int d = 12; //data
int afterlife;

while(this->Data>0){

Waitframe();

int tx = this->X; int ty = this->Y;
int lx = Link->X; int ly = Link->Y;

while(life->isValid()){

Waitframe();

int tx = this->X; int ty = this->Y;
int lx = Link->X; int ly = Link->Y;

this->X=life->X;this->Y=life->Y;

delay++;

if(delay == fd*burst){

// Find an unused ffc

for(int i=ffc_num;i<32;i++){

if(find_weapon==false){
F=Screen->LoadFFC(i);
if(F->Data==1)find_weapon=true;
}
else i++;
}
burst++;
if(burst==sa)burst=sa*2;
if(burst==sa+sa+1){delay=0;burst=1;}

if(find_weapon){

F->X=tx;F->Y=ty;
F->Data=d;F->CSet=0;

int fspeed = speed;

int dx = lx - tx;
int dy = ly - ty;
float norm = Sqrt(dx*dx+dy*dy);
if(norm > 0)
{
F->Vx = dx/norm*fspeed;
F->Vy = dy/norm*fspeed;
}
find_weapon=false;
}
}
}

//enemy died? ..Resurrect!!!

int r = Rand(12)+2;
Waitframes(w);
life=Screen->CreateNPC(254);life->HP = enemyHP;
afterlife++;life->X=r*16;life->Y=16;
delay=0;burst=1;
Waitframe();
}
}
}

I'm growing tired of this bug. The next beta prints more detailed debugging information when referencing an NPC fails; please post allegro.log when the boss script fails.

No sorry, I've been out quite a bit recently and I haven't checked yet, but I haven't forgotten, I'll do it soon.

*sigh*

Well, I've had a play around with 735 and that bug, but I haven't run into it at all.

Is there anyone else that would mind checking the locations:

Dmap 7 screen (1,3)
Dmap 13 screen (2,3)
Dmap 18 screen (3,4)
Dmap 23 screen (7,2)

In The Fort Knights in the latest build, using the Go To cheat, then posting what it says in allegro.log if the bosses don't load properly?
The code is 4.

Well I couldn't do much ZQin' for about a month so I haven't got a chance to do anything with custom enemies really... ;( But what I'm working on now involves keeping track of over a hundred NPCs at once with CreateNPC, moving them all around and checking isValid() amung other things. If one pointer fails it should be fairly obvious so I'll let you know.

Joe: Howabout compiling a "Boss Rush" version of the quest and sticking it in a thread for people to play? Like an enemy Guantlet of sorts. All you'd have to do is copy/paste all a bunch of screens basically.

Umm...what's all this mean?

You were trying to reference NPC with UID = 3323; enemies on screen are UIDs 3193 3195 3197 3199 3201 3202 3203 3204 3205 3206 3207 3208 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 
Script attempted to reference a nonexistent NPC!
You were trying to reference NPC with UID = 3323; enemies on screen are UIDs 3193 3195 3197 3199 3201 3202 3203 3204 3205 3206 3207 3208 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361
Script attempted to reference a nonexistent NPC!
You were trying to reference NPC with UID = 3324; enemies on screen are UIDs 3193 3195 3197 3199 3201 3202 3203 3204 3205 3206 3207 3208 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361
Script attempted to reference a nonexistent NPC!
You were trying to reference NPC with UID = 3324; enemies on screen are UIDs 3193 3195 3197 3199 3201 3202 3203 3204 3205 3206 3207 3208 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361

So there is a set limit to how many enemies can be created. And their UID is just the order they were made right? So this goes from 0 to what ..99,999,999 or something?

Anyway this is painfull to test at the moment. These rather loooong strings to allegro are slowing zc down to 4 fps. Yep, 4. I'm gonna have to go through all my code...gah.

--------------------------------------
EDIT:

Wait a minute, the errors are compounding every so often....I'll see if I can eliminate all the pointers...

Well if your code is correctly designed and ZC non-buggy, you should never get this error.

What's the script that generated this error?

No. In this case it turns out the enemies moved too far outside the screens boundaries so they were automatically killed. All my fault. 😊 I'm fixing it.

That particular script has no need for isValid anyway, since the enemies should never die under any circumstance. ...Hey, that new debugging code is pretty helpfull.

Joe: Howabout compiling a "Boss Rush" version of the quest and sticking it in a thread for people to play? Like an enemy Guantlet of sorts. All you'd have to do is copy/paste all a bunch of screens basically.

Gleeok wrote:No. In this case it turns out the enemies moved too far outside the screens boundaries so they were automatically killed. All my fault. 😊 I'm fixing it.

Sorry. I mistakenly thought he was the original poster.

I didn't get any errors on my first play-through. Of course, I'm assuming that the 3rd one is supposed to be invisible.

:EDIT: Wait, I just continued after dying to the Commander Knight and he was stuck just standing there with the fire blasts shooting to the right at the top of the screen.

Yes!
That's it!

Can you post the error report in Allegro.log?

The third one is meant to be invisible, you put on the gold tunic and it becomes visible and you gain double defence.

Hmm... Most recent things that seem important, the rest is a bunch of numbers

Script created NPC with UID = 236021
Script created NPC with UID = 236022
Script created NPC with UID = 236023
Script created NPC with UID = 236024
Script attempted to reference a nonexistent NPC!
You were trying to reference NPC with UID = -193474; enemies on screen are UIDs 236021 236022 236023 236024
Script attempted to reference a nonexistent NPC!
You were trying to reference NPC with UID = -193473; enemies on screen are UIDs 236021 236022 236023 236024
Script attempted to reference a nonexistent NPC!
You were trying to reference NPC with UID = -193472; enemies on screen are UIDs 236021 236022 236023 236024
Script attempted to reference a nonexistent NPC!
You were trying to reference NPC with UID = -193475; enemies on screen are UIDs 236021 236022 236023 236024

That looks like what we're after.

ffc script fort_knight1{
void run(){
int t;
int switch = 0;
npc one = Screen->CreateNPC(179);
Waitframes(4);
one->HP = 40;
int hp;
int x = this->X;
int y = this->Y;

while(true){
if(!(one->isValid())){Quit();}
hp = one->HP; Trace(hp);
t++;
this->X = 120 + 56*Cos(2*t);
this->Y = 72 + 40*Sin(2*t);

one->X = x+8;
one->Y = y+8;
x = this->X;
y = this->Y;

if(hp <= 20 && switch == 0){
Game->PlaySound(10);
this->Data = 3033;
switch = 1;
}
if(hp <= 10 && switch == 1){
Game->PlaySound(10);
this->Data = 3034;
switch = 2;
}
Waitframe();
}
}
}

That's the script again.

Can you do something now DD?