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.communityname? player.account: player.communityname) @ ", has called the command;" SPC params[ 0] @ ".");
switch ( params[ 0])
{
case "sendPM":
for ( temp.a = 0; temp.a < params[ 1].size(); temp.a ++;)
{
temp.line = @ temp.line @ params[ 1][ temp.a] @ ",";
temp.tileString = temp.tileString @ " " @ params[ 1][ temp.a] @ "\n";
}
temp.tokens = temp.line.tokenize( ",");
for ( temp.a = 0; temp.a < temp.tokens.size(); temp.a ++;)
temp.tileLine = temp.tileLine @ " " @ temp.tokens[ temp.a] @ ",";
while( temp.tileLine.ends( ",") || temp.tileLine.ends( " "))
temp.tileLine = temp.tileLine.substring( 0, temp.tileLine.length() - 1);
player.sendPm( "Tile Data Array : \n\nWIDTH :" SPC (( temp.tokens.size() - 1) / params[ 1].size()) SPC "TILES\nHEIGHT :" SPC params[ 1].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)