View Single Post
  #1  
Old 08-21-2011, 11:55 PM
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
Online Level NPC Editor (OLNE)

Purpose
To allow quick and painless updating of hard-coded level NPCs while in-game.

On Zodiac for me, it was to finally change those yellow lights outside of OSL to orange.

Video


How-to Install
Add the script as a weapon on your server. Also update the levelfolders array on the server-side to match your server's folder setup. I set a default one that covers a fairly common/generic set though so it may not be required.

Also upload npc_placeholder.png in your server's images folder for blank NPCs to display properly. You can re-configure it to an image of your liking as well.

You will also need to give the (npcserver) write access to the level. I.e: rw levels/*.nw

In order to make changes to the levels you will also need write access to the levels as well.

OLNE Usage is automatically logged to logs/olne_log.txt

How-to Use
Press F9 to toggle the editor on and off.

It works pretty much exactly like it does in the offline level editor. Most showcharacter, and showimgpart NPCs (even the ones that use math in them) are displayed correctly as well. The editor windows are also unique to each NPC so you can open multiple NPCs at once.

Left-click to select an NPC.

Left-click and drag to move an NPC. NPCs will be made transparent while you're dragging them to make them easier to place in groups. I.e: Placing a light image over a lamp.

Double-click to open the NPC Script Editor.

Right-clicking an NPC will duplicate it.

Except when it comes to creating new NPCs. In my editor it's a mouse gesture.
  1. Hold down the right mouse button after 0.3 seconds the menu will appear. (You can re-configure this time easily)
  2. While holding down the right mouse, hover your mouse over the NPC you want to create.
  3. It will be created upon hovering over it and you can continue holding down the right mouse button to drag it into position.

If you make a change and don't want to save it, you can simply leave the level (or: reconnect, update level) to discard your changes as well. A level will only be updated if you make a change though.

Press F9 to save your changes and exit the editor.

Drawbacks
It does support GMAPs but only for editing the level you are currently in so be cautious of that. It will display the boundaries of the level when on a GMAP while dragging the NPC, as long as you keep it in the boundaries it will save in the correct spot.

Due to the way NPCs are stored in the level I also have it so levels get locked to prevent other users from making changes while you are. You will get a message stating who is currently editing the level if a locking conflict occurs.

Doesn't support default baddies, or chests nor do I plan on supporting them.

Editor doesn't support testing or styling. Use http://fp4.ca/gs2beautifier if you really need your code styled for you.

Detection of showimgpart, and showcharacter is lazy. It picks up the first occurrence and doesn't care if the line is commented out or not. Personally I kind of like it this way, lets me assign an editor-only image to an otherwise blank editor NPC.

The Script

Latest version at http://forums.graalonline.com/forums...1&postcount=69.
Attached Images
 
__________________
Quote:

Last edited by TSAdmin; 09-07-2013 at 09:02 PM.. Reason: getVarValue loop limit fix, updated link to download
Reply With Quote