Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-20-2010, 01:05 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Level Editor

I've been working on a level editor for the past few days after seeing Dusty's tile functions and realizing how I could use them effectively.


You can change the key needed to be pressed to open the editor in onKeyPressed() on the clientside. The default is F9.

(npcserver) needs folder rights to "r [folders that can load]/*.nw" to load and "rw [folders that can load and save]/*.nw" to load and save them online. Default folder is "levels/*.nw", so you should give (npcserver) folder rights to it.
NPC Code:
r levels/mainlevels/*.nw
rw levels/uploadedlevels/*.nw


The above will allow it to load the levels in levels/mainlevels/ but not save, and will allow it to load and save levels in levels/uploadedlevels/.

You can change the folder that will load/save online by changing temp.folder. You can also add checks for who is trying to load/save, but temp.folder has to be the folder and (if you want) file name start they can use. Default setting is "levels/[accountname]_". Remember that you must include "/"'s and can't load multiple folders at the same time; It is suggested you have people save to their own folders/a to-be-moved folder instead of a main folder which an admin can move for security.
PHP Code:
temp.folder "levels/mainlevels/"//Will allow the editor to load the folder "levels/mainlevels/".
temp.folder "levels/uploadedlevels/" @player.account"_"//Will allow the editor to load the folder "levels/uploadedlevels/" with every level starting with the player's account and an underscore. 
Offline loading occurs in the player's "Graal/levels/" folder and saving occurs in the player's "Graal/scriptfiles/[servername]/" folder on their computer.


Near future updates:
  • Layers (ASAP)
  • Multiple tile selection/placement
  • Right-click fill


Thanks to Dusty for his tile functions (http://forums.graalonline.com/forums...hp?t=134258008), Aeko for the button images, and Skyld for the NPC scripting syntax highlighting profile (the ones used in Scripted RC).
Attached Thumbnails
Click image for larger version

Name:	ole1.png
Views:	627
Size:	199.5 KB
ID:	50435   Click image for larger version

Name:	ole2.png
Views:	538
Size:	213.9 KB
ID:	50436   Click image for larger version

Name:	ole3.png
Views:	428
Size:	214.2 KB
ID:	50437   Click image for larger version

Name:	ole4.png
Views:	404
Size:	213.3 KB
ID:	50438   Click image for larger version

Name:	ole5.png
Views:	421
Size:	203.2 KB
ID:	50439  

Click image for larger version

Name:	ole6.png
Views:	432
Size:	137.4 KB
ID:	50440  
Attached Files
File Type: zip leveleditor.zip (55.1 KB, 473 views)
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 02-20-2010 at 05:41 AM.. Reason: screenshots
Reply With Quote
  #2  
Old 02-20-2010, 05:59 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
The interface needs some work, and I would recommend removing signs completely. You might also want to eventually add tabs like with the offline level editor.

Besides that, it looks off to a good start
__________________
Reply With Quote
  #3  
Old 02-20-2010, 03:04 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
nice work, man.
i think you should use a "GuiTreeViewCtrl" for loading levels, if people are going to use this for all their levels.
and tabs for working with more then 1 level.


awesome work, keep at it!
__________________
.
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
  #4  
Old 02-20-2010, 08:22 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Like I said on RC, you need multiple tile selection :3 And even without there's no sort of feedback showing that you've selected a tile, it is pretty confusing at first.

Ooo, and flood fill
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #5  
Old 02-22-2010, 02:15 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Small update:
Added hints for textboxes with little to no information (links, signs, NPCs, and the tileset changer).
Attached Files
File Type: zip leveleditor.zip (55.2 KB, 219 views)
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #6  
Old 02-23-2010, 12:48 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Another update:
LAYER SUPPORT!
This might not be 100% but I think it's good enough for use. If there's a problem post what it is here.
Also, ignore the white pixel at the top left of the level in view. I needed to add that so you didn't get a black screen over your level. It won't actually be there in the level.
Attached Files
File Type: zip leveleditor.zip (56.2 KB, 227 views)
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 02-23-2010 at 01:47 AM..
Reply With Quote
  #7  
Old 02-23-2010, 01:06 AM
Soala Soala is offline
Ideas on Fire
Soala's Avatar
Join Date: Jun 2007
Location: In my head
Posts: 3,208
Soala is a jewel in the roughSoala is a jewel in the rough
Geez Switchy, stop getting x100 times better everyday <3
Reply With Quote
  #8  
Old 02-24-2010, 12:10 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Fixed some transparent tileset problems.
Attached Files
File Type: zip leveleditor.zip (56.2 KB, 287 views)
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #9  
Old 02-24-2010, 02:08 AM
TSAdmin TSAdmin is offline
Forum Moderator
TSAdmin's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,980
TSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to behold
For adding/editing level links, I wouldn't just make someone face 6 text fields filled with numbers, they should probably have text labels denoting what changing the number in the field will change (New X, New Y, X, Y, W, H)
__________________
TSAdmin (Forum Moderator)
Welcome to the Official GraalOnline Forums! Where sharing an opinion may be seen as a declaration of war!
------------------------
· User Agreement · Code of Conduct · Forum Rules ·
· Graal Support · Administrative Contacts ·
Reply With Quote
  #10  
Old 02-24-2010, 03:03 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by TSAdmin View Post
For adding/editing level links, I wouldn't just make someone face 6 text fields filled with numbers, they should probably have text labels denoting what changing the number in the field will change (New X, New Y, X, Y, W, H)
Quote:
Originally Posted by Switch View Post
Small update:
Added hints for textboxes with little to no information (links, signs, NPCs, and the tileset changer).
fillin up space dawg
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #11  
Old 02-24-2010, 05:26 AM
TSAdmin TSAdmin is offline
Forum Moderator
TSAdmin's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,980
TSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to behold
Quote:
Originally Posted by Switch View Post
reply
I know, but not quite what I'm getting at. Hints are one thing, the thing is you have to hover your mouse over them to find out what they are though there's more than sufficient room to just add text labels, which is what my reply addressed.

Quote:
Originally Posted by TSAdmin View Post
For adding/editing level links, I wouldn't just make someone face 6 text fields filled with numbers, they should probably have text labels denoting what changing the number in the field will change (New X, New Y, X, Y, W, H)
__________________
TSAdmin (Forum Moderator)
Welcome to the Official GraalOnline Forums! Where sharing an opinion may be seen as a declaration of war!
------------------------
· User Agreement · Code of Conduct · Forum Rules ·
· Graal Support · Administrative Contacts ·
Reply With Quote
  #12  
Old 02-24-2010, 05:50 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by TSAdmin View Post
I know, but not quite what I'm getting at. Hints are one thing, the thing is you have to hover your mouse over them to find out what they are though there's more than sufficient room to just add text labels, which is what my reply addressed.
I see what you're saying.
At the time of making them I didn't want to make the window larger than it was because it was fitting perfectly so I just added hints, but I could replace them with some GuiTextCtrls.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #13  
Old 02-24-2010, 06:12 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
Well since you're scripting it, cut the fat and improve it instead of mimicking what we already have.

I.e: X, Y, Width, and Height really aren't needed.

Things that would be useful:

- NPC Filters (Hiding Character NPCs only, Hiding other NPCs, Hide All NPCs)
- Improved Link Editing (Hover-over link to see/edit exit details)

Also, Nice work.
__________________
Quote:
Reply With Quote
  #14  
Old 02-28-2010, 07:35 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by fowlplay4 View Post
Well since you're scripting it, cut the fat and improve it instead of mimicking what we already have.

I.e: X, Y, Width, and Height really aren't needed.

Things that would be useful:

- NPC Filters (Hiding Character NPCs only, Hiding other NPCs, Hide All NPCs)
- Improved Link Editing (Hover-over link to see/edit exit details)

Also, Nice work.
I was working with the assumption that most level artists wanted to get into the new style of level NPC scripting and only using join() for most things, so I just put everything in a list (including signs and links) so you can edit everything from 1 place easily, especially when you put one over another and want to get the specific one.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #15  
Old 02-28-2010, 03:12 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Text labels are always good do that it also works on touchscreen
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:01 PM.


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