Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Omega's Tile Editor (https://forums.graalonline.com/forums/showthread.php?t=134262983)

MrOmega 04-26-2011 08:10 AM

Omega's Tile Editor
 
6 Attachment(s)
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)

imbavik 04-26-2011 09:12 AM

that's Awsome!:D
i was wondering if someone whould make the fill function soon :)

great script!

MrOmega 04-26-2011 12:59 PM

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.

imbavik 04-26-2011 01:10 PM

Quote:

Originally Posted by MrOmega (Post 1645680)
It can fill ight now, just with the fill tile

Well, i like your script anyways :D

fowlplay4 04-26-2011 03:17 PM

Nice was wondering when this would show up.

cbk1994 04-26-2011 09:40 PM

Make sure to verify the player's account before you let them update the level x_x.

MrOmega 04-27-2011 12:06 AM

Quote:

Originally Posted by cbk1994 (Post 1645732)
Make sure to verify the player's account before you let them update the level x_x.

well this only to be given to trusted staff

cbk1994 04-27-2011 12:19 AM

Quote:

Originally Posted by MrOmega (Post 1645751)
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.

MrOmega 04-27-2011 05:31 AM

Quote:

Originally Posted by cbk1994 (Post 1645753)
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.

fowlplay4 04-27-2011 05:38 AM

if (player.hasRight("updatelevel")) sendToRc( "/updatelevel" SPC player.level.name);

;)

MrOmega 04-27-2011 05:43 AM

Quote:

Originally Posted by fowlplay4 (Post 1645851)
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. :p

Deas_Voice 04-27-2011 10:35 PM

Quote:

Originally Posted by fowlplay4 (Post 1645851)
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!

fowlplay4 04-27-2011 10:43 PM

Quote:

Originally Posted by Deas_Voice (Post 1645991)
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);

patrickp2p 06-09-2011 11:07 PM

How do you select flood fill? It doesn't tell you how. It just tells you what it's about... D:

Ohk4y 06-20-2011 03:09 AM

Love it.
Great Job!

oo_jazz_oo 06-20-2011 03:38 AM

Quote:

Originally Posted by Ohk4y (Post 1655424)
Love it.
Great Job!

May I ask you why you have the chrome webstore logo as your signature?

callimuc 06-20-2011 03:01 PM

Quote:

Originally Posted by oo_jazz_oo (Post 1655428)
May I ask you why you have the chrome webstore logo as your signature?

Probably he´s bored and he want´s to do some covert advertising.


All times are GMT +2. The time now is 08:20 AM.

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