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

777: Crash when playing sounds from item scripts.

25 replies · 4,549 views · Started 11 April 2008

It could be an error with my script, but it didn't crash on the earlier builds from the same script. I performed it twice and confirmed that it was the cause of the crash.

It's in pickup scripts. Sorry. The script checks how many HCPs you have and gives you a heart container at varying intervals of HCPs. Then it plays its respective sound.

If that still doesn't cause problems for anyone else I'll fence off some areas in my quest so it can be tested.

Okay Beefster you may be right....I've since had three crashes, all at the same time the "B" button was pressed. Well at least the good news is that it probably is restricted to items instead of being completely random. The item script I was using?

item script shield{

void run(){

if(white){

is_black=true;
is_white=false;
white = false;
black = true;
Game->PlaySound(36);
}
else{
is_white=true;
is_black=false;
white = true;
black = false;
Game->PlaySound(36);
}
}
}

The bools don't do anything but change ffc7's CSet.

I'll delete this item script and move it to a statement the global script; (if(Link->InputB)) ..and see if the crashes stop.

Dark Nation wrote:Status?

int status = annoying+3; 😛

Beefster, I couldn't really pin it down just yet. Can you's post some code pretty please?

EDIT: D'oh!! I just realized all I have to do is remove Game->PlaySound(); from the item script and see if it still crashes!!! um......gud thing im done gottin smart frum skool...if only my pappy weren't my cousin this wud be fixd' now i reckon...

...sorry about that. I'll test it out.

It's not PlaySound. It randomly crashes regardless of a sound being played.

Also tried this in an item script:

int i;
while(i++<60)Game->PlaySound(i);

..which suprisingly didn't do anything exept get me to turn the sfx down. :P

They're pretty random on my end, like I said. Beefster, you have something with faster results?

Well if Beefster would reply to his thread more than every other week... 😡

Yeah, lemme upload it.
OK, I put it back the way it was when it crashed more frequently...Hopefully you'll see it fairly quickly. Quest. Direct link. Uses b780.

Controls? ..oh yeah, silly me;
A-lasers
B-shield
Start-Swords
R-speed
L-...not working yet.

I'm not getting any crashing at all. Can you strip the code down to the bare minimum needed to produce the crash and then add some trace statements to help determine what line it's crashing on?

That's the problem, sometimes it's completely random. 😞 ..or doesn't crash at all. Today on the other hand, it crashed within a minute every single time I tried to play it.

That's why I was inquiring beefster as to help me out a little. damn, this one's annoying too... It definately crashes only when the B button is pressed though, I'm certain of that.

Can you strip the code down to the bare minimum

XD roflmao!!! 😛

..Umm let me catch my breath, hehe. Yeah, I'll give it a twirl.

Alright. I'll post my quest with many fenced off areas and a changed starting point. Collect Heart pieces for the crash. I'll edit this post in a bit to add the link.

Here it is. I Stripped it down quite a bit and "fenced off" most areas. Just collect a heart piece and it will crash.

Found the line that's causing the bug. Oddly, it's not happening when the sound is actually played. It's happening just after that, in a different, seemingly unrelated, line of code.

Think you can save this patient, doctor? XD

Either way, you know we're all behind you, cheering you on silently. I know I am... Of the little I know about computer code, I totally understand the frustration involved in a debugging case like this. ...No wait. ALL debugging is stressful. XD

Same bug here. Item scripts will usually crash ZQuest at runtime. Happens with pickup scripts or activated scripts indiscriminately. I'll post a quest in a minute.

Thank you Jman. You and DarkNation are our heroes. Now I can FINALLY make custom items again. 😃

Figured I'd be the first to throw in a thank-you since you devs have such a hard job and we often don't make it any easier. We appreciate your hard work. So thanks. 😊

Um, wow. It still doesn't work. The game no longer crashes when using item scripts, but now item scripts are sometimes not working at all. One moment they are and another moment they're not. I even tested this with the Trace command.

I can't be doing something wrong, either... 'cause my scripts compile perfectly... X_X

Actually this is fixed. The post about the items not working at all by Schwa was remedied by the usual -import "std.zh" in another thread.