Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-09-2012, 10:46 PM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
Unhappy 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
Reply With Quote
  #2  
Old 05-09-2012, 10:52 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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.
__________________
Reply With Quote
  #3  
Old 05-09-2012, 10:53 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
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
Reply With Quote
  #4  
Old 05-09-2012, 10:54 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Emera View Post
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.
__________________
Reply With Quote
  #5  
Old 05-09-2012, 10:55 PM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
Quote:
Originally Posted by cbk1994 View Post
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
Reply With Quote
  #6  
Old 05-09-2012, 10:56 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by cbk1994 View Post
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?
Reply With Quote
  #7  
Old 05-09-2012, 10:58 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Emera View Post
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 View Post
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).
__________________
Reply With Quote
  #8  
Old 05-09-2012, 11:01 PM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
Quote:
Originally Posted by cbk1994 View Post
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.
Reply With Quote
  #9  
Old 05-09-2012, 11:03 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Fysez View Post
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.
__________________
Reply With Quote
  #10  
Old 05-09-2012, 11:11 PM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
I cannot
Reply With Quote
  #11  
Old 05-09-2012, 11:16 PM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
Just please tell me how to duplicate a Gmap...
Reply With Quote
  #12  
Old 05-09-2012, 11:19 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by cbk1994 View Post
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.
Reply With Quote
  #13  
Old 05-09-2012, 11:26 PM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
Quote:
Originally Posted by Emera View Post
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
Reply With Quote
  #14  
Old 05-10-2012, 12:13 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
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.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #15  
Old 05-10-2012, 12:46 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Fysez View Post
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.
__________________

Last edited by Tigairius; 05-10-2012 at 06:17 PM.. Reason: links approved
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:02 PM.


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