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)

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

MattKan 06-20-2015 01:38 PM

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

All the colors are whack and it makes it hard to read. This may be a v6 problem, but has anybody run into anything similar?

Kirko 06-20-2015 01:52 PM

Quote:

Originally Posted by MattKan (Post 1736814)
http://i.imgur.com/iXnUVPC.png

All the colors are whack and it makes it hard to read. This may be a v6 problem, but has anybody run into anything similar?

I had that problem also I found out it's because the profile for the gui is assigned to SyntaxHighlightProfile but that profile isn't given in the script. I did get to fix it somewhat.

PHP Code:

new GuiScrollCtrl("LevelNPC_" temp.npc_id "_ScriptScroll") {
      
profile GuiBlueScrollProfile;
      
scrollprofile GuiBlueScrollProfile;
      
useownprofile true;
      
profile.fillColor "255 255 255";
      
profile.opaque true;
      
profile.border 1;
      
profile.bitmap "guiblue_scroll_noback.png";
      
horizsizing "width";
      
vertsizing  "height";
      
clientwidth  temp.ww;
      
clientheight temp.wh 40;
      
      new 
GuiMLTextEditCtrl("LevelNPC_" temp.npc_id "_Script") {
        
profile SyntaxHighlightProfile;
        
useownprofile true;

        
//you really just need to add this
        
profile.fontcolor "0 0 0"
        
profile.fontcolorhl "175 0 0";
        
profile.fontcolorna "0 0 0";
        
profile.fontcolorsel "0 0 0";
        
profile.fontcolorlink "255 0 255";
        
profile.fontcolorlinkhl "255 0 0";
        
profile.cursorColor = { 0,  0,  0255 };
        
profile.fillcolorhl "80 180 255";
        
profile.fontsize 15;
        
profile.fonttype  "Courier New"
        
        
        
horizsizing "width";
        
syntaxhighlighting true;
        
wordwrap false;
        
clientheight temp.wh;
        
clientwidth  temp.ww 40;
        
width -= 4;
        
        
setlines(temp.npc_script);
        
temp.scriptctrl this;

        
autoindenting true;
        
tabspaces 2;
      }
    } 


MattKan 06-20-2015 02:29 PM

Thanks!

callimuc 06-24-2015 07:30 PM

Quote:

Originally Posted by xXziroXx (Post 1736888)
Figured I'd share this

Figured I'd link you to the proper thread ;)

MysticalDragon 06-24-2015 07:33 PM

Quote:

Originally Posted by MattKan (Post 1736814)
http://i.imgur.com/iXnUVPC.png

All the colors are whack and it makes it hard to read. This may be a v6 problem, but has anybody run into anything similar?

Yea its not a v6 issue. I think the issue is it used old depricated profiles from the old client-rc which as been redone completely. I van grab you the new profiles if need be.

fowlplay4 06-24-2015 08:08 PM

1 Attachment(s)
Here is my fix, simply replace the whole createEditorFunction function with this:

PHP Code:

// Create Editor Window
function createEditorWindow(temp.npc_idtemp.npc_imgtemp.npc_xtemp.npc_ytemp.npc_script) {
  new 
GuiMLTextEditProfile("SyntaxHighlightLegacyProfile") {
    
fontType fileexists("DejaVuSansMono.ttf") ? "DejaVuSansMono" "Courier";
    
fontSize = (thiso.options.scriptfontsize <= 14 thiso.options.scriptfontsize);
    
cursorColor "0 0 0";
    
fillColorHL "255 255 0";
    
fontColor "0 0 0";
    
fontColorHL "192 0 0"// control words like if, else etc.
    
fontColorSEL "0 16 0"// identifiers 0,96,0
    
fontColorLink "192 0 192"// strings
    
fontColorLinkHL "0 0 255"// numbers
  
}
  new 
GuiWindowCtrl("LevelNPC_" temp.npc_id "_Window") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
this.npc_id temp.npc_id;
    
temp.ww clientwidth 600;
    
temp.wh clientheight 500;
    
= (screenwidth temp.ww) / 2;
    
= (screenheight temp.wh) / 2;
    
isexternal true;
    
text format("NPC Script Editor (X: %s Y: %s)"temp.npc_x 64temp.npc_y 64);
    
destroyonhide true;
    
thiso.trigger("CenterExternalWindow"this);
    
    new 
GuiScrollCtrl("LevelNPC_" temp.npc_id "_ScriptScroll") {
      
profile GuiBlueScrollProfile;
      
scrollprofile GuiBlueScrollProfile;
      
useownprofile true;
      
profile.fillColor "255 255 255";
      
profile.opaque true;
      
profile.border 1;
      
profile.bitmap "guiblue_scroll_noback.png";
      
horizsizing "width";
      
vertsizing  "height";
      
clientwidth  temp.ww;
      
clientheight temp.wh 40;
      
      new 
GuiMLTextEditCtrl("LevelNPC_" temp.npc_id "_Script") {
        
profile SyntaxHighlightLegacyProfile;
        
useownprofile true;
        
profile.fillcolorhl "80 180 255";
        
profile.fontcolorlink "255 0 255";
        
profile.fontsize 15;
        
        
horizsizing "width";
        
syntaxhighlighting true;
        
wordwrap false;
        
clientheight temp.wh;
        
clientwidth  temp.ww 40;
        
width -= 4;
        
        
setlines(temp.npc_script);
        
temp.scriptctrl this;

        
autoindenting true;
        
tabspaces 2;
      }
    }
    new 
GuiButtonCtrl("LevelNPC_" temp.npc_id "_ScriptClose") {
      
profile GuiBlueButtonProfile;
      
horizsizing "left";
      
vertsizing  "top";
      
clientwidth  64;
      
clientheight 32;
      
temp.ww 68;
      
temp.wh 40 4;
      
text "Close";
      
thiso.catchevent(this.name"onAction""onCloseScript");
    }
    new 
GuiButtonCtrl("LevelNPC_" temp.npc_id "_ScriptApply") {
      
profile GuiBlueButtonProfile;
      
horizsizing "left";
      
vertsizing  "top";
      
clientwidth  64;
      
clientheight 32;
      
temp.ww 68 64 4;
      
temp.wh 40 4;
      
text "Apply";
      
thiso.catchevent(this.name"onAction""onApplyScript");
    }
    new 
GuiTextEditCtrl("LevelNPC_" temp.npc_id "_Image") {
      
profile GuiBlueTextEditProfile;
      
clientwidth 256;
      
clientheight 24;
      
4;
      
temp.wh 24 10;
      
text temp.npc_img;
      
thiso.catchevent(this.name"onAction""onUpdateImage");
      
temp.imgctrl this;
    }
    
this.scriptctrl temp.scriptctrl;
    
this.imgctrl    temp.imgctrl;
  }


or re-download the script in this attachment:

xXziroXx 06-25-2015 07:38 AM

Quote:

Originally Posted by callimuc (Post 1736889)
Figured I'd link you to the proper thread ;)

Oh gee, the facepalm is real. :noob:

Cubical 06-25-2015 03:43 PM

everyone in this thread should fight

Draenin 06-25-2015 05:37 PM

Quote:

Originally Posted by MysticalDragon (Post 1736890)
Yea its not a v6 issue. I think the issue is it used old depricated profiles from the old client-rc which as been redone completely. I van grab you the new profiles if need be.

I'll stick with the one posted above for now, but it would be really nice to get the syntax highlighting colors fixed in a future update.

Any word on whether the OLNE / OLLE might be unified into one editor, or are they definitely gonna have to stay separate?


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

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