Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Script crashed my systems. (https://forums.graalonline.com/forums/showthread.php?t=134262237)

Jiroxys7 02-26-2011 08:20 PM

Script crashed my systems.
 
So I was working on a buff that gave a particle effect that only the person with it could see. it was going fine, I just needed to figure out a way to stop the particles when the buff wore off.

So I did function doEffect(cmd){}
this housed the particle script, and if the player didn't have the buff, then cmd would == "destroy". it would then do:
with(findimg(200)){
with(emitter){
this.destroy();
}
}
return;

Once that ran, some problems came up and I immediately removed that portion of the script. my GUI that showed the player's current buffs vanished, but the script is still in the weapon. And I didn't identify any missing weapons.
Two more things are broken that I've seen so far. Major things.
1: I can no longer place buffs on myself.
2: I have GUI that pops up once you hit a certain level and it lets you pick your element. the GUI shows up fine, but the list doesn't show.

The biggest problem is, that because of whatever the hell happened, I can't get these scripts back on-line. I've tried updating the scripts, reconnecting, restarting my client, and restarting the NPC-server. all to no avail.

What happened to my scripts? and how can I get them working again? x_x

Jiroxys7 02-26-2011 08:36 PM

Seems that this.destroy() deleted the weapon from my attributes. This fixed everything that broke. I figured that this.destroy() was going to destroy the emitter. So problem solved. I just freaked out. Sorry about that.

While I'm on the subject though, is there a way to destroy the emitter? I'm also concerned about any other images that might be using that index. or does it only count the images in it's own script? (since ive noticed that ganis with showimg(200) don't interfere with eachother)

Crow 02-26-2011 09:10 PM

Set emitter.emitautomatically to false instead of destroying it.

Jiroxys7 02-26-2011 09:31 PM

Quote:

Originally Posted by Crow (Post 1633402)
Set emitter.emitautomatically to false instead of destroying it.

Ah, of course. Thank you, Crow. :)

Crow 02-26-2011 09:40 PM

Also (was in a hurry when I made the other post): You're right about every script having access to all image indexes, not interfering with other scripts using the same ones.


All times are GMT +2. The time now is 06:49 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.