Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Staff Block Glitch (https://forums.graalonline.com/forums/showthread.php?t=134266409)

Fysez 05-09-2012 10:46 PM

Staff Block Glitch
 
So I came across a pretty bad glitch.
I've placed all around the Gmap, A ton of Staff Blocks with chat on them telling me what i'm going to need to add. They are everywhere.

Little did I know, Updating Staff Blocks would make it so i cannot delete them either. The only thing I changed was chat, So it had nothing to do with deleting them. I'm unable to delete any of these staff blocks what-so-ever.
Help?! It's pretty bad

cbk1994 05-09-2012 10:52 PM

This is not a bug with the game client. I'm going to request this be moved into the NPC scripting forum...

...and in that case, post all scripts involved. We can't possibly help you without information. There is no single staff block script; hundreds have existed throughout Graal's history.

Emera 05-09-2012 10:53 PM

try chatting update level and delete them. If you don't have a delete function in your script already, then you've been silly and you'll need to go to RC and type /clearnpcs [your level or gmap] to get rid of them.

Example:
/clearnpcs mymap.gmap
/clearnpcs mylevel.nw

cbk1994 05-09-2012 10:54 PM

Quote:

Originally Posted by Emera (Post 1694183)
type /clearnpcs [your level or gmap] to get rid of them.

Note that this will remove all local DB NPCs on the level, which could have unintended consequences (but I doubt it will for your server). Ideally you want to edit your script to add some way to delete the blocks instead.

Fysez 05-09-2012 10:55 PM

Quote:

Originally Posted by cbk1994 (Post 1694182)
This is not a bug with the game client. I'm going to request this be moved into the NPC scripting forum...

...and in that case, post all scripts involved. We can't possibly help you without information. There is no single staff block script; hundreds have existed throughout Graal's history.

Is their a way to Graal Generate another Gmap identically?
Using the colors I saw Graal Generate can also use

Emera 05-09-2012 10:56 PM

Quote:

Originally Posted by cbk1994 (Post 1694184)
Note that this will remove all local DB NPCs on the level, which could have unintended consequences (but I doubt it will for your server). Ideally you want to edit your script to add some way to delete the blocks instead.

If the NPC's are already layed down without a delete function in them, doesn't that make it impossible to delete them if you don't already have a delete function scripted into the class you're using?

cbk1994 05-09-2012 10:58 PM

Quote:

Originally Posted by Emera (Post 1694188)
If the NPC's are already layed down without a delete function in them, doesn't that make it impossible to delete them if you don't already have a delete function scripted into the class you're using?

No. You can destroy them via script (loop through npcs and call destroy()), or add something to their class (if they're joined to a class).

Quote:

Originally Posted by Fysez (Post 1694185)
Is their a way to Graal Generate another Gmap identically?
Using the colors I saw Graal Generate can also use

Yes, but what are you trying to do? If you want to delete the blocks, then delete the blocks. If you want a new GMAP based on the original, that's a totally different topic (and deserving of its own forum thread in the levels forum).

Fysez 05-09-2012 11:01 PM

Quote:

Originally Posted by cbk1994 (Post 1694190)
No. You can destroy them via script (loop through npcs and call destroy()), or add something to their class (if they're joined to a class).



Yes, but what are you trying to do? If you want to delete the blocks, then delete the blocks. If you want a new GMAP based on the original, that's a totally different topic (and deserving of its own forum thread in the levels forum).

The problem is, I have the destroy script. It was a glitch that if you update the level I found, It would perminantly stay their. That's what i'm trying to fix.
I thought maybe If i generated a new Gmap, It would delete them since they're images.

They don't show up in Offline Editor either.

cbk1994 05-09-2012 11:03 PM

Quote:

Originally Posted by Fysez (Post 1694193)
The problem is, I have the destroy script. It was a glitch that if you update the level I found, It would perminantly stay their. That's what i'm trying to fix.
I thought maybe If i generated a new Gmap, It would delete them since they're images.

Still waiting on you to post your code. We can't help you unless you give us more information.

edit: thanks Tig for moving the thread; Fysez, please pay attention to where you're making threads.

Fysez 05-09-2012 11:11 PM

I cannot

Fysez 05-09-2012 11:16 PM

Just please tell me how to duplicate a Gmap...

Emera 05-09-2012 11:19 PM

Quote:

Originally Posted by cbk1994 (Post 1694190)
No. You can destroy them via script (loop through npcs and call destroy()), or add something to their class (if they're joined to a class).

Oh, sexy. Never thought about doing that.

Fysez, he's trying to help you here, there no need to be impatient.

You could use loadFolder() to get a list of the level names you need to clone from the folder you GMAP levels are located in, but you're going to have to find a way to create a new GMAP file with all of the level names sorted in order.

If there's an easier way to do it, I'm sure one of the more advanced scripters on the forums will be able to help you out.

Fysez 05-09-2012 11:26 PM

Quote:

Originally Posted by Emera (Post 1694200)
Oh, sexy. Never thought about doing that.

Fysez, he's trying to help you here, there no need to be impatient.

You could use loadFolder() to get a list of the level names you need to clone from the folder you GMAP levels are located in, but you're going to have to find a way to create a new GMAP file with all of the level names sorted in order.

If there's an easier way to do it, I'm sure one of the more advanced scripters on the forums will be able to help you out.

Well the reason I say I cannot share the script isn't because i'm being rude or don't want to post it in forums is because,
I figured maybe if I deleted the scripts, It would delete them all.
What was I thinking? I don't know.

I have a back-up folder in which I store scripts.
I didn't store this one x.x

BlueMelon 05-10-2012 12:13 AM

I'm assuming you used putnpc2 to drop the npc then joined it to a class.

So, recreate the class? And maybe delete it when they enter the level.

function onPlayerEnters(){ this.destroy(); }

Its not a glitch, its your fault you didn't add a destroy() method.

cbk1994 05-10-2012 12:46 PM

Quote:

Originally Posted by Fysez (Post 1694202)
Well the reason I say I cannot share the script isn't because i'm being rude or don't want to post it in forums is because,
I figured maybe if I deleted the scripts, It would delete them all.
What was I thinking? I don't know.

I have a back-up folder in which I store scripts.
I didn't store this one x.x

Then post this information in the original post. Trying to help you is like pulling teeth. How can we possibly help you if you don't give us any information? Unless there's something else you haven't told us, you don't need to recreate the GMAP, you need to delete the staff blocks.

You would benefit from reading this, especially the sections "Be precise and informative about your problem" and "Describe the goal, not the step".

To delete all staff blocks in a level, assuming all staff blocks have the image "block.png":

PHP Code:

// put this in a database NPC
function onCreated() {
  
temp.lvl findLevel("mygmap.gmap");
  
temp.lvlNPCs temp.lvl.npcs;
  
  for (
temp.npc temp.lvlNPCs) {
    if (
temp.npc.img == "block.png") {
      
temp.npc.destroy();
    }
  }


Adjust the image check to work with your situation.


All times are GMT +2. The time now is 05:12 PM.

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