Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Online Level Editor : Progress (https://forums.graalonline.com/forums/showthread.php?t=77718)

DustyPorViva 11-27-2007 10:03 AM

Online Level Editor : Progress
 
2 Attachment(s)
So I decided to start an online level editor. I will post the progress of this as I work on it. This will include up-to-date features, planned features, screenshots, and any ideas you all have for it.

Current Features:
  • Loads the current tileset.
  • Docks onto the side of the window, does no obstruct gameplay
  • Can be hidden and opened at will..
  • Loads your predefined object list from clientside. This means you can create object lists for your tileset via the offline editor, and they will transfer to the online editor.
  • Can be resized at intervals of 16 pixels.

Planned Features:
  • New GUI graphics, similar to offline editor.
  • Basic level editing features--tile manipulation and such.
  • Links, Sign, Baddy, Chest manipulation.
  • Infinite(or as many as Graal can handle) layer support. I have a very firm idea of how this will work, so this shouldn't be too hard.
  • 8-directional, non-hindered movement.
  • More advanced tile manipulation tools, such as multiple tile background selection. This will make it possible to bucket-fill with a layout of tiles, instead of just a single tile.
  • When it is possible, external editor window.

So if you have any ideas, go ahead! I also need some help with a few things. Right now I can load the tileobject files, but I don't know how to extract the tile information from what's in them. I'll also need some help with the more complicated things, such as bucket-filling(calculating what can be filled).
Here's some screenshots.

Novo 11-27-2007 11:43 AM

KuJi said:

PHP Code:

Read Tile Objects / New World tiles.

Each tile consists of two letters. For our example we will use "J4"
which is the black tile (0x278 or 632)

function 
onCreated()
{
    
// Read Tile Objects format ex.
    
temp.read = {"J""4"}; // each tile consists of two letters
    
temp.b64 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    
temp.tile = (temp.b64.pos(temp.read[0]) << 6) + (temp.b64.pos(temp.read[1]));
    
    echo(
"Tile: " temp.tile " - " 0x278);


Also... "Bucket-Filling" is known as "Flood-Filling". You can find such by having a pathfinder where the edge-cost is 0, and you want all possible vertex that can be reached.

Tolnaftate2004 11-27-2007 11:48 AM

PHP Code:

function bucketfill(fx,fy,ft) {
  
// fill x, fill y, fill tile
  
temp.rt tiles[fx,fy];
  
tiles[fx,fy] = ft;
  
updateboard(fx,fy,1,1);
  for (
temp.i=0temp.i<4temp.i++) {
    
temp.tx fx+vecx(temp.i);
    
temp.ty fy+vecy(temp.i);
    if (
tiles[temp.tx,temp.ty] == temp.rt)
      
bucketfill(temp.tx,temp.ty,ft);
  }
  return;


I can change this to flood a pattern if you wish, I just need some more details about it (a random tile of several or a pattern?, etc.).

Angel_Light 11-27-2007 02:52 PM

Few more features I suggest,
  • Sand Path Cursor
  • Ability to load more than one tileset
  • Ability to "Scroll" through multiple Tilesets
  • Script Editor?

Laek2007 11-27-2007 04:23 PM

Moondeath has already done a Online editor. But I'm not a huge fan of it.

I'm oldfashion even if someone did a good online editor. I would still use the offline one :)

DustyPorViva 11-27-2007 06:44 PM

Quote:

Originally Posted by Angel_Light (Post 1360670)
Few more features I suggest,
  • Sand Path Cursor
  • Ability to load more than one tileset
  • Ability to "Scroll" through multiple Tilesets
  • Script Editor?

I was going to do the Sand Path... but found no use since most level makers don't really like it, and since you can easily just put the script in a weapon.
As for the tileset thing... to be honest I don't know how to do this.
I also don't know about the script editor... I might, but I think that's a bit out of my league.

Also, thanks a ton for all the info guys, it really helps a lot.

And I'm a big fan of the offline editor as well... but I don't see that getting any updates anymore, so I'm going to try to tailor this as close to the offline one as possible.

Admins 11-28-2007 12:24 AM

I can eventually provide the current online level editor from Kingdoms Debug if you are going to improve that, so that we don't redo the work of each other. You can also contact Skyld for that I think.

I think it would be best to not support classic chests, baddies etc. anymore, and use npcs (putnpc2) for everything, make a new chest class or so.

Inverness 11-28-2007 12:31 AM

I was going to make an online editor myself, so I'd like to take a shot at that.

DustyPorViva 11-28-2007 01:20 AM

1 Attachment(s)
I agree, I guess it is a bit fruitless to work on something already done, but at the same time it's a challenge for me, and a chance for me to have it the way I like it(as well as others who give input). I also agree I should probably remove the baddies/chests/NPCs bit.
I might change my mind when I see the Kingdoms editor though.

Either way, a small update, predefined objects are completely done :) This is what I like the most about it because it incorporates offline editing into online editing. Also makes it easy for those who work with their tilesets offline to be able to continue working with their predefined objects online as well. Also proud because it's barely noticeable loading the data, even on my 500Mhz. Flood-filling is also done, as is setting your flood tile.

(Ya, the screenshot doesn't show the right tiles, but only because there is a custom tileset in use, and no level with pics1.png).

Inverness 11-28-2007 02:18 AM

Hm, for me apparently, level.npcs seems to be empty clientside yet is correct serverside?

Angel_Light 11-28-2007 02:25 AM

Are these implemented?
  • Copying tiles that have been already layed
  • Copying and pasted slected tiles
  • Copy, cut, and paste buttons

as for the multiple tilesets you can just index the tile images and have the player set the tileset image to certain indexes. Then have a scroll bar with the tilest image name and use the tileset image the player has selected.

DustyPorViva 11-28-2007 02:31 AM

Copying tiles that have been already layed - Not yet, but will be. I've already accomplished this offline so I know how to.
Copying and pasted slected tiles - Will be easily done.
Copy, cut, and paste buttons - Also easily done. I'm going to add a toolbar to the top of the screen that has different tool buttons as well as the layer stuff.

As for multiple tilesets, it would be possible to organize them, I'm just unsure how to actually implement them in addtiledefs.

Inverness 11-28-2007 02:35 AM

You can change the tileset of the level but not use more than one o.o
Thats what it sounds like you're trying to do.

Pimmeh 11-28-2007 09:54 AM

Oh when its done I am so gonna hug you untill you give it TO MEH

Inverness 11-29-2007 03:20 AM

1 Attachment(s)
Heres what I've done for my own Level Editor so far. Don't expect the script to be nice and pretty and super-efficient.
I just completed the multiple tile selection and pasting into the level in its most basic form.

Also it joins util_triggercontrol, which can be found here:
http://forums.graalonline.com/forums....php?p=1354520

cbk1994 11-29-2007 04:48 AM

Quote:

Originally Posted by Stefan (Post 1360769)
I can eventually provide the current online level editor from Kingdoms Debug if you are going to improve that, so that we don't redo the work of each other. You can also contact Skyld for that I think.

I think it would be best to not support classic chests, baddies etc. anymore, and use npcs (putnpc2) for everything, make a new chest class or so.

You should release it to the public.

Then I could finally leave Windows 4 good, and go to Mac for developing!

Deas_Voice 01-10-2008 05:52 PM

Quote:

Originally Posted by Inverness (Post 1361156)
Heres what I've done for my own Level Editor so far. Don't expect the script to be nice and pretty and super-efficient.
I just completed the multiple tile selection and pasting into the level in its most basic form.

Also it joins util_triggercontrol, which can be found here:
http://forums.graalonline.com/forums....php?p=1354520

if u say update level the tiles disipairsx_x
but its nice and a good start ;)

Chompy 01-10-2008 06:40 PM

Quote:

Originally Posted by Deas_Voice (Post 1369046)
if u say update level the tiles disipairsx_x
but its nice and a good start ;)

'savelevels=true'

must be in server options

DustyPorViva 02-24-2008 10:16 PM

So I've got a question.
I figure the best way to save levels(thus, using a button), would be to manually change the data in the .nw file text-wise.
I want to be able to show changes made by tiles, but change tiles[x,y] and updating board has some problems... mainly cut bush tiles and such make bushes appear. How to circumvent this, without using images?

Inverness 02-24-2008 10:18 PM

Quote:

Originally Posted by Deas_Voice (Post 1369046)
if u say update level the tiles disipairsx_x
but its nice and a good start ;)

Its not supposed to save. :noob:

cbk1994 02-24-2008 10:18 PM

What I did when messing around making one was update the board and tiles on clientside, and keep an array of the changes, and then if they hit "save" then it triggers the server with the array, which just uses updateboard and changing the tiles. Also had an option that immediately triggers the server as well.

If I can get Jave to fix my IP I can post some code.

DustyPorViva 02-25-2008 12:42 AM

Quote:

Originally Posted by cbkbud (Post 1376528)
What I did when messing around making one was update the board and tiles on clientside, and keep an array of the changes, and then if they hit "save" then it triggers the server with the array, which just uses updateboard and changing the tiles. Also had an option that immediately triggers the server as well.

If I can get Jave to fix my IP I can post some code.

The problem with this is certain tiles will update themselves... bushes and such.

cbk1994 02-25-2008 01:12 AM

Quote:

Originally Posted by DustyPorViva (Post 1376538)
The problem with this is certain tiles will update themselves... bushes and such.

Oh, I see what you mean.

Yeah, only way to do it is through editing the file :(


All times are GMT +2. The time now is 01:04 AM.

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