Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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:	721
Size:	199.5 KB
ID:	50435   Click image for larger version

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

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

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

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

Click image for larger version

Name:	ole6.png
Views:	519
Size:	137.4 KB
ID:	50440  
Attached Files
File Type: zip leveleditor.zip (55.1 KB, 565 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
 


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


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