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: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
  #2  
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
  #3  
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
  #4  
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
  #5  
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
  #6  
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
  #7  
Old 05-10-2012, 03:27 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by cbk1994 View Post
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();
    }
  }

I just came across this and it looks very insightful,
whether or not I will ever use it to find npc images
to do something, I'd like to give you rep when I can.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



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:59 PM.


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