Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Online Level NPC Editor (OLNE) (https://forums.graalonline.com/forums/showthread.php?t=134264280)

MattKan 02-01-2012 03:20 AM

New bug :P

I have a NPC with this script:

PHP Code:

//#CLIENTSIDE
function onCreated()
{
  
showcharacter();
  
this.head "head434.png";
  
this.colors[0] = "white";
  
this.colors[1] = "blue";
  
this.colors[2] = "blue";
  
this.colors[3] = "black";
  
this.colors[4] = "lightblue":
  
this.shield "no-shield.png";
  
this.attr[1] = "hat92.png";
  
this.dir 3;


You'll notice I made a typo in this.colors[4] and used a : instead of a ; on accident.

Now, when I press "Apply", I see the button get pushed, but the GUI remains and is not destroyed. If I minimize it and try to press F9 to exit OLE, I'm told "MattKan is currently editing this level's NPCs".

I relog.

The NPC Editor is now unable to select the NPC, and I'm forced to edit the level as a .txt to remove it. (When I attempt to select it I get the same error message, that I'm editing the level.)

fowlplay4 02-01-2012 05:42 AM

Try this version.

MattKan 04-08-2012 02:24 AM

Er, when I try to use set a NPC with a new image not used anywhere else in the level, the NPC just resets itself and removes the entire script. o_o

This wasn't happening before now... any tips?

MattKan 04-14-2012 05:47 PM

Reinstalled and now the entire editor isn't working.

Is anybody else experiencing problems? Perhaps Stefan changed something that's breaking it.

Emera 04-14-2012 06:07 PM

I've been attempting to use it on Era iPhone Dev, and when I press F9 literally nothing happens. I don't know if it's related to the server or the script though. I've checked through it and everything seems OK.

MattKan 04-14-2012 09:43 PM

There must have been some GS2 change that's breaking this, Emera.

Which is annoying, can it be fixed?

fowlplay4 04-14-2012 10:23 PM

Quote:

Originally Posted by MattKan (Post 1692108)
There must have been some GS2 change that's breaking this, Emera.

Which is annoying, can it be fixed?

I believe it's related to the fact I store the script in the showimg object, and it gets re-created which wipes out the script. It can be fixed it just needs to be re-written in a couple sections.

MattKan 04-15-2012 09:30 PM

Emera, delete the weapon for it, restart the NPC Server, then reinstall and it should work.

Edit: Nope, doesn't actually work. Back to the original issue of not being able to spawn new NPCs with new images.

MattKan 05-04-2012 12:21 AM

Fp4 will you please fix this if you have a chance? :)

torfbeta 06-22-2012 04:26 AM

It keeps saying this to me: Could not find the file myworld_a8.nw for this level! check your configuration.

Devil_Lord2 06-22-2012 05:10 AM

Does anyone else have problems with both the Client RC and Online Level NPC Editor both causing client crashes? (I am on a Mac and V6)

NPCs being wiped on death?

Or random Icons showing up / light effects hovering around as icons?

MattKan 06-22-2012 05:32 AM

It probably has something to do with another script on Shaded Legend.

BlueMelon 06-22-2012 03:05 PM

I have experienced client crash yes.

cbk1994 06-22-2012 04:11 PM

Quote:

Originally Posted by Devil_Lord2 (Post 1698027)
Does anyone else have problems with both the Client RC and Online Level NPC Editor both causing client crashes? (I am on a Mac and V6)

NPCs being wiped on death?

Or random Icons showing up / light effects hovering around as icons?

I haven't noticed any of this on v6 on OS X.

MattKan 10-27-2012 10:35 PM

This stopped working today...

PHP Code:

Scripttriggerclient() was used with wrong target: -Dev/NPCEditor (must be weapon or guiat line 48 in script of -Dev/NPCEditor (in level stroseria_10-05.nw at pos (00)) 

Sure it has something to do with Stefan restarting our server today and all the changes he made to triggerclient(). Will be interesting to see if the rest of our server is broken, too.

cbk1994 10-27-2012 11:49 PM

Quote:

Originally Posted by MattKan (Post 1706518)
This stopped working today...

PHP Code:

Scripttriggerclient() was used with wrong target: -Dev/NPCEditor (must be weapon or guiat line 48 in script of -Dev/NPCEditor (in level stroseria_10-05.nw at pos (00)) 

Sure it has something to do with Stefan restarting our server today and all the changes he made to triggerclient(). Will be interesting to see if the rest of our server is broken, too.

He warned about this a few weeks ago. It shouldn't be surprising that this broke.

fowlplay4 10-27-2012 11:54 PM

Here's an updated version, I've also changed it so the script and image aren't stored in the findimg object anymore.

Edit: Fixed applying the image.

Kiwi27 10-28-2012 01:29 AM

[9:56:33 AM] Vinka: Could you tell fp4 that whenever u edit an npc script within a level with olne and click apply, the line where image name is inserted turns to "-".

From Vinka.

fowlplay4 10-28-2012 02:48 AM

Quote:

Originally Posted by Kiwi27 (Post 1706529)
[9:56:33 AM] Vinka: Could you tell fp4 that whenever u edit an npc script within a level with olne and click apply, the line where image name is inserted turns to "-".

From Vinka.

Fixed. Either re-download the entire script from my post above or replace the function at the bottom with this one:

PHP Code:

function onApplyScript(obj) {
  if (!
this.active) {
    
obj.parent.destroy();
    return;
  }
  
temp.npc_id obj.parent.npc_id;
  
temp.npc_script obj.parent.scriptctrl.getlines();
  
temp.npc_img obj.parent.imgctrl.text.trim();
  
obj.parent.destroy();
  
with (findimg(temp.npc_id)) {
    
image temp.npc_img;
    
image fileexists(image) ? image PLACEHOLDER;
    
temp.npc_x 64;
    
temp.npc_y 64;
  }
  
setNPCImage(temp.npc_idtemp.npc_img);
  
setNPCScript(temp.npc_idtemp.npc_script);
  if (
temp.npc_id 0) {
    
changesMade();
    
updateNPCImage(temp.npc_idtemp.npc_imgtemp.npc_xtemp.npc_ytemp.npc_script);
  }



greggiles 12-07-2012 09:05 PM

Script: triggerclient() was used with wrong target: npcEdit (must be weapon or gui) at line 82 in script of npcEdit (in level cabi_ak-02.nw at pos (0, 0))

It keeps doing this :(

callimuc 12-07-2012 09:26 PM

Quote:

Originally Posted by greggiles (Post 1708891)
Script: triggerclient() was used with wrong target: npcEdit (must be weapon or gui) at line 82 in script of npcEdit (in level cabi_ak-02.nw at pos (0, 0))

It keeps doing this :(

change line 82 to this:

PHP Code:

player.triggerclient("gui"this.name"leveldata"temp.leveldatatemp.readonly); 


cbk1994 12-07-2012 11:36 PM

Quote:

Originally Posted by greggiles (Post 1708891)
Script: triggerclient() was used with wrong target: npcEdit (must be weapon or gui) at line 82 in script of npcEdit (in level cabi_ak-02.nw at pos (0, 0))

It keeps doing this :(

Read the ~4 posts before yours.

Draenin 03-10-2013 04:11 AM

Suggestion for the next version, if you should happen to update it:

An option to copy-paste NPCs from level to level on a gmap.

Basically, you'd need to store the information in a 'clipboard,' similar to the way Pixel's tile editor utilizes that kind of function as well.

fowlplay4 03-10-2013 10:16 AM

I've been using it quite a bit lately (extremely useful in dungeon work), and would of found copying sets of certain npcs (was doing light details in numerous levels) really handy.

I will look into making a clipboard feature. My idea:

Press CTRL+[0-9] to set the clipboard position. (Position 0 by default)
Press CTRL+C to copy to the clipboard. (Save clipboard data locally in text files)
Press CTRL+V to paste NPC at your mouse position based on clipboard data.

I also think if you put a comment in the NPC like:

//DESC:Tree

When you change clipboard slots it will say 'Clipboard Slot # (Tree)'

callimuc 03-10-2013 05:32 PM

Quote:

Originally Posted by fowlplay4 (Post 1714901)
I've been using it quite a bit lately (extremely useful in dungeon work), and would of found copying sets of certain npcs (was doing light details in numerous levels) really handy.

I will look into making a clipboard feature. My idea:

Press CTRL+[0-9] to set the clipboard position. (Position 0 by default)
Press CTRL+C to copy to the clipboard. (Save clipboard data locally in text files)
Press CTRL+V to paste NPC at your mouse position based on clipboard data.

I also think if you put a comment in the NPC like:

//DESC:Tree

When you change clipboard slots it will say 'Clipboard Slot # (Tree)'

sounds awesome! would love to see that happen

Joshua_P2P 04-03-2013 02:11 AM

question does there have to be a npc in the level to use it or can it place npcs in a new level?

fowlplay4 04-03-2013 02:38 PM

Quote:

Originally Posted by Joshua_P2P (Post 1715733)
question does there have to be a npc in the level to use it

No.

iAxeis 04-21-2013 11:48 PM

Very nice so flexible and easy to work with :D!

fowlplay4 09-07-2013 07:35 PM

1 Attachment(s)
There was a bug in getVarValue, values set to ( I.e. this.attr[1] = ""; ) would cause the script to hit the loop limit and break during the loading phase.

You can either replace getVarValue with this one, or re-download the script I'm going to attach.

PHP Code:

function getVarValue(varinpc_script) {
  
// Find Variable
  
temp.aa npc_script.positions(vari);
  for (
temp.atemp.aa) {
    
// Check for Assignment
    
temp.npc_script.substring(temp.a);
    
temp.temp.s.pos("=");
    
temp.temp.s.pos(";");
    
// Make Sure Semi-Colon is After Assignment
    
if (temp.temp.c) {
      
// Ignore ""
      
if (temp.s.pos("\"\"") >= 0) return "";
      
// Determine Value
      
temp.temp.s.substring(temp.e+1);
      
temp.sc temp.s.pos(";");
      
temp.temp.s.substring(0, (temp.sc == -temp.s.length() : temp.sc));
      
temp.temp.s.trim();
      if (
temp.s.size() == 2) {
        
temp.s.delete(0);
        
temp.temp.s[0];
      }
      
// Remove Double-Quotes
      
while (temp.s.starts('"')) temp.temp.s.substring(0);
      while (
temp.s.ends('"')) temp.temp.s.substring(0,temp.s.length()-1);
      
// (0) White Color Fix
      
if (vari.starts("colors") && (temp.== "0")) {
        
temp."white";
      }
      
// Return Value
      
return temp.s;
    }
  }
  return 
NULL;


@Mods:

Remove the attachments from these posts:

http://forums.graalonline.com/forums...5&postcount=39
http://forums.graalonline.com/forums...1&postcount=42
http://forums.graalonline.com/forums...2&postcount=57

And update the script in my main post with this one or link it to here.

TSAdmin 09-07-2013 09:05 PM

I've made the changes you requested and linked the latest download in the main post to your post above. Let me know if there's anything I've overlooked :)

fowlplay4 09-07-2013 11:28 PM

thx m8

Just debugged another issue.

If get errors you "You don't have access to this level!" or similar and your rights and (npcserver) are set correctly then make sure you haven't replaced the default hasright function with one in a player joined class.

Alpho 02-19-2015 03:22 PM

Are any more updates coming to the NPC Editor?

Alpho 04-14-2015 09:00 PM

Here's what I've done to the NPC Editor

http://i.imgur.com/uRCvPly.png

Draenin 04-20-2015 08:35 PM

A major error has been coming up for Kraak, who is currently using a mac for editing. Basically as soon as he types in the 'join' command, Graal as a whole will crash, and we're not entirely sure why since the issue doesn't happen on Windows.

This is what the error report kicks back to him:

http://pastebin.com/k6iVgEFj

Alpho 04-22-2015 03:03 PM

Quote:

Originally Posted by Draenin (Post 1735798)
A major error has been coming up for Kraak, who is currently using a mac for editing. Basically as soon as he types in the 'join' command, Graal as a whole will crash, and we're not entirely sure why since the issue doesn't happen on Windows.

This is what the error report kicks back to him:

http://pastebin.com/k6iVgEFj

That has happened to me before. Do this instead:
PHP Code:

function onCreated() {
  
this.join("foo_bar");



Anero 04-23-2015 11:29 AM

Pretty useful tool. Thumbs up!

xAndrewx 04-23-2015 01:06 PM

Is there a tool similar to a notepad? So you can view all NPCs in the level like a text editor and modify the scripts that way?

Tim_Rocks 04-23-2015 06:08 PM

Notepad ++ ?

Draenin 04-24-2015 02:47 AM

Yeah, just opening up a NW file with notepad / wordpad should allow you to edit the file directly, although you'll have to kind of blindly place the NPCs unless you know exactly where their coordinates are going to be.

It's especially useful for checking levels for script errors or to make sure nobody's trying to hide a script that tampers with the game.

xAndrewx 04-24-2015 02:32 PM

Quote:

Originally Posted by Draenin (Post 1735879)
Yeah, just opening up a NW file with notepad / wordpad should allow you to edit the file directly, although you'll have to kind of blindly place the NPCs unless you know exactly where their coordinates are going to be.

It's especially useful for checking levels for script errors or to make sure nobody's trying to hide a script that tampers with the game.

Yeah I know, but I want an in game notepad haha.

All the iEra staff use online tools because they're awesome :)

I'd use the online text editor to read all the NPCs in the level


All times are GMT +2. The time now is 09:37 AM.

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