Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-26-2011, 08:10 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Omega's Tile Editor

Well, I made this as an experiment to test my abilities. You all will probably be pissed, cause in fact it is a tile Editor. :P But I think mine is somewhat unique, maybe not to you, but I'm satisfied with it currently. Maybe when my server needs some of the features in the to-do list, I will add them. But for now, I'm not worried about them. If anyone wants to go ahead and add the features. Also, I have attached my server's current tileset, you can use it on your server, just give recognition appropriately.

I think my favorite achievement was keeping this under 1000 lines. :P

But here's the break down in the top of the file.

PHP Code:
/***********************************************************
                 _____________________
                |                     |
                | OMEGA's Tile Editor |
                |_____________________|
  
  HOW TO USE :
  
    Simply, click and drag your mouse to select tiles either 
    on the Tileset Image, Prefabricated object, or the Graal 
    Screen to select tiles. If tileset tiles are selected, 
    just move your mouse into the Graal Screen and left-mouse 
    click to place them, same with prefabricated tiles. When 
    Graal Screen tiles are select you can either move them by 
    left clicking and moving the mouse. ( The fill tile will 
    replace where these tiles were) You can also right-click 
    to copy these tiles and move your mouse where want these
    tiles to be. You can place by either mouse button. Middle-
    mouse scroll button will scroll through the layers and 
    pushing the middle mouse button will toggle the layer fade.

  Functonality :
  
    - Layer Support 
        Can edit Layers, 0 through 10, by either typing in 
        the layer Number or using the +/- buttons.
    - Flood Fill
        Can flood fill, large areas may/can lag though. Fill
        tile can be seen in the top-left.
    - Delete Fill
        Pressing either, delete or backspace, while level 
        tiles are select will replace currently selected tile 
        with fill tile.
    - Update Button
        Sends a command to the NPC-Control, to update your
        current level.
    - PreFab Button
        Opens a list of object that you can add to your 
        level. You can also, add or delete these objects.
    - Fade Layers
        You can fade the layers to see what's on the current 
        layer.
    - Grid Effect
        Draws a grid so you can see where each tile is.
    - Show/Hide NPCs
        If checked, NPC's will be shown, otherwise all NPCs
        will hidden.
    - External capabilities
        If checked, the Tile Editor will be directed to an 
        external window, allowing an unobstructed editing
        area.
    - Get Tile Array
        Button in the bottom-right will be active when you 
        have tiles selcted. Click to make the NPC-Control 
        PM you both a line-style array of the current 
        selected tiles and a block-style array of the 
        current selected tiles, in hexadecimal.
        
  OTHER FEATURES :
  
    - Name of the current level you can edit is displayed 
      in the title of the editor.
    - Displays either level coordinates or Tileset 
      coordinates in the bottom-left of editor. Depending 
      on what you mouse over.
    - Also, displays both the Decimal and Hexadecimal value
      of the tile your mouse is currently over.
    - Shows width and height (in tiles) of the selection.
    - Shows current tile in the top left. Hover to get tileset
      coordinates and hexa/decimal values.
    - Hides player when editing.
      
  KNOWN BUGS :
  
    - Mouse cursor doesn't change back until you move it after a flood-fill
    - External Mode, selecting highlight doesn't work, you can still select though. ( Graak Bug: PM Stefan to fix)
  
  TO-DO LIST :
    
    - Add multi-tile flood filling.
    - Add a My Objects, Tile Object List.
    - Make so you can add/remove tile objects to your list.
    - Add keyboard commands, eg. Copy/Cut/Past/Undo/Redo.
    - Add middle mouse button functionality.
    - Fix Delete tiles issue.
    
***********************************************************/ 
Also, for the updateLevel and tileArray features add this to your Control-NPC

PHP Code:
function onActionServerside()
{
  
sendtoNC"NPC-Server:" SPC ( !player.communitynameplayer.accountplayer.communityname) @ ", has called the command;" SPC  params0] @ ".");
  switch ( 
params0])
  {
    case 
"sendPM":    
      for ( 
temp.0temp.params1].size(); temp.++;)
      {      
        
temp.line = @ temp.line params1][ temp.a] @ ",";
        
temp.tileString temp.tileString "  " params1][ temp.a] @ "\n";      
      }     
      
temp.tokens temp.line.tokenize",");
      for ( 
temp.0temp.temp.tokens.size(); temp.++;)
        
temp.tileLine temp.tileLine " " temp.tokenstemp.a] @ ",";        
      while( 
temp.tileLine.ends",") || temp.tileLine.ends" "))
        
temp.tileLine temp.tileLine.substring0temp.tileLine.length() - 1); 
      
player.sendPm"Tile Data Array : \n\nWIDTH :" SPC (( temp.tokens.size() - 1) / params1].size()) SPC "TILES\nHEIGHT :" SPC params1].size() SPC "TILES\n\n{" temp.tileLine "}\n\n{\n" temp.tileString "}");    
    break;   
    case 
"updateLevel":   
      
sendToRc"/updatelevel" SPC player.level.name);    
    break;
  }

Also, much thanks and gratitude from me to both DustyPorViva and fowlplay4.

Edit : Fixed a small issue, file is now updated. ( fixed hiding of your player)
Attached Thumbnails
Click image for larger version

Name:	tile_editor0.png
Views:	521
Size:	56.0 KB
ID:	52746   Click image for larger version

Name:	tile_editor1.png
Views:	451
Size:	41.2 KB
ID:	52747   Click image for larger version

Name:	tile_editor2.png
Views:	495
Size:	48.0 KB
ID:	52748   Click image for larger version

Name:	glife_tiles8.png
Views:	442
Size:	166.9 KB
ID:	52749  
Attached Files
File Type: txt Omega's Tile Editor.txt (39.2 KB, 481 views)
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!

Last edited by MrOmega; 04-26-2011 at 03:31 PM..
Reply With Quote
  #2  
Old 04-26-2011, 09:12 AM
imbavik imbavik is offline
Mercia
imbavik's Avatar
Join Date: Apr 2011
Location: Norway
Posts: 23
imbavik has a little shameless behaviour in the past
Send a message via MSN to imbavik
that's Awsome!
i was wondering if someone whould make the fill function soon

great script!
Reply With Quote
  #3  
Old 04-26-2011, 12:59 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
It can fill single-tile right now, shouldn't be too hard to add multi-tile, just need to add some checks for width/height.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!

Last edited by MrOmega; 04-26-2011 at 01:22 PM..
Reply With Quote
  #4  
Old 04-26-2011, 01:10 PM
imbavik imbavik is offline
Mercia
imbavik's Avatar
Join Date: Apr 2011
Location: Norway
Posts: 23
imbavik has a little shameless behaviour in the past
Send a message via MSN to imbavik
Quote:
Originally Posted by MrOmega View Post
It can fill ight now, just with the fill tile
Well, i like your script anyways
Reply With Quote
  #5  
Old 04-26-2011, 03:17 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Nice was wondering when this would show up.
__________________
Quote:
Reply With Quote
  #6  
Old 04-26-2011, 09:40 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
Make sure to verify the player's account before you let them update the level .
__________________
Reply With Quote
  #7  
Old 04-27-2011, 12:06 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Quote:
Originally Posted by cbk1994 View Post
Make sure to verify the player's account before you let them update the level .
well this only to be given to trusted staff
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #8  
Old 04-27-2011, 12:19 AM
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 MrOmega View Post
well this only to be given to trusted staff
Doesn't matter. A script injector or even a good memory editor can send triggers to any NPC or weapon on the server.
__________________
Reply With Quote
  #9  
Old 04-27-2011, 05:31 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Quote:
Originally Posted by cbk1994 View Post
Doesn't matter. A script injector or even a good memory editor can send triggers to any NPC or weapon on the server.
I see, will work on it tomorrow.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #10  
Old 04-27-2011, 05:38 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
if (player.hasRight("updatelevel")) sendToRc( "/updatelevel" SPC player.level.name);

__________________
Quote:
Reply With Quote
  #11  
Old 04-27-2011, 05:43 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Quote:
Originally Posted by fowlplay4 View Post
if (player.hasRight("updatelevel")) sendToRc( "/updatelevel" SPC player.level.name);

Is that an aactual var? O.o

if so, cool, didn't know about it.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #12  
Old 04-27-2011, 10:35 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by fowlplay4 View Post
if (player.hasRight("updatelevel")) sendToRc( "/updatelevel" SPC player.level.name);

why not "if (player.hasRight("updatelevel")) player.chat = "update level";" ? sending to rc seems like you would spam it



awesome work Omega!
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #13  
Old 04-27-2011, 10:43 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Deas_Voice View Post
why not "if (player.hasRight("updatelevel")) player.chat = "update level";" ? sending to rc seems like you would spam it

awesome work Omega!
I believe this works as well:

fileupdate(player.level.name);
__________________
Quote:
Reply With Quote
  #14  
Old 06-09-2011, 11:07 PM
patrickp2p patrickp2p is offline
Registered User
patrickp2p's Avatar
Join Date: May 2011
Location: Maryland
Posts: 159
patrickp2p is an unknown quantity at this point
How do you select flood fill? It doesn't tell you how. It just tells you what it's about... D:
__________________
"If your bible got caught in a rain and thunderstorm, would it rip? My bible is the rain and the thunder."

Love me or hate me? O:

<--Are Questions Accepted Here? (:
Reply With Quote
  #15  
Old 06-20-2011, 03:09 AM
Ohk4y Ohk4y is offline
Registered User
Ohk4y's Avatar
Join Date: Jun 2011
Posts: 43
Ohk4y is an unknown quantity at this point
Send a message via AIM to Ohk4y
Love it.
Great Job!
__________________
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 09:46 AM.


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