Official ScriptUO EasyUO Scripts > Script development tools

TrailMyx's Master Rail Engine/Developer

(1/37) > >>

TrailMyx:

--- Code: ---;-----------------------------------------------------------
; Script Name: TrailMyx's Master Rail Developer
; Authors: TrailMyx
; Version: 0.55a
; Client Tested with: 6.0.3.1
; EUO version tested with: 1.5 127
; Shard: OSI, FS
; Revision Date:  10/1/2007
; Public Release: ...
; Global Variables Used: None
; Purpose: Records and plays back rails.  Saves them to files.
;-----------------------------------------------------------

--- End code ---


--- Code: ---;-----------------------------------------------------------
; Script Name: TrailMyx's Master Rail Engine Subs
; Authors: TrailMyx
; Version: 0.30k
; Client Tested with: 6.0.3.1
; EUO version tested with: 1.5 127
; Shard: OSI, FS(Alexandria[RunUO])
; Revision Date:  9/28/2007
; Public Release: ...
; Global Variables Used: None
; Purpose: Plays rails recorded by TrailMyx's Master Rail Generator.
;   Allows user to have multiple rails loaded into memory and includes many
;  support functions to help automate rail-enabled script development.
;-----------------------------------------------------------
;  Functions:
;  call %railsubs TM_Initialize ; Initializes rail engine namespace to SUBROUTINE mode
;  call %railsubs TM_Close ; clears namespaces use for rail engine.
;  call %railsubs TM_LoadRail c:\rail1.txt
;  call %railsubs TM_RunRail RAIL1 PRESENT END FW
;                            RAIL1 0 5 BW
;  call %railsubs TM_SelectRail RAIL1  ; can select by either rail NAME or rail INDEX
;  call %railsubs TM_RailsLoaded  ; returns number of rails presently in memory
;  call %railsubs TM_DetermineCurrentRail ; returns index of rail presently selected
;  call %railsubs TM_DetermineCurrentRailName  ; return rail NAME of presently selected rail
;  call %railsubs TM_DetermineCurrentWaypointIndex ; returns current waypoint index for present rail
;  call %railsubs TM_GetRailNameForIndex 0  ; return rail NAME of index 0.
;  call %railsubs TM_DetermineCurrentRailWaypoints ; returns number of waypoints for presently selected rail
;  call %railsubs TM_DetermineRailWaypoints 3 ; determines number of waypoints for rail index/name 3
;  call %railsubs TM_GotoClosestRailIndexedWaypoint ; proceeds to the closest waypoint of selectable rail
;  call %railsubs TM_GotoClosestWaypoint ; proceeds to the closest waypoint of present rail
;  call %railsubs TM_GotoClosestGlobalWaypoint ; searches all rails in memory to find the closest waypoint.
;  call %railsubs TM_Push  ; pushes present waypoint and rail onto stack
;  call %railsubs TM_Pop   ; recalls last pushed waypoint and rail, sets rail and present_index of waypoint
;  call %railsubs TM_ServerInitialize ; initializes global namespace and puts rail engine into SERVER mode.
;  call %railsubs TM_GetStatus ; returns rail engine server status --> IDLE, RUNNING, ERROR
;  call %railsubs TM_GetServerMode ; returns configured server mode --> SERVER, SUBROUTINE
;  call %railsubs TM_PingServer ; returns PING if server doesn't respond, PONG if server is available.
;  call %railsubs TM_GetPresentServerCommand ; this is the present command the server is processing
;  call %railsubs TM_SetPresentServerCommand ; Used to issue STOP command, halting rail
;  call %railsubs TM_PercentWaypointRun ; -1, defined by rail, 0- walk all the time, 100 - run all the time.
;  call %railsubs TM_ShowDebug
;  call %railsubs TM_HideDebug
;
; Do not re-produce these subroutines without the express permission from the author, TrailMyx.   email: trailmyx@yahoo.com
;

--- End code ---




Finally, I'm getting around to releasing this to you.  I've been busy using this system in a couple projects, so I've had some time to do some deep testing with it.  

This release comes in 4 parts:
1) Rail Developer/Creator
2) Rail Engine
3) Rail Converter (converts CEO and Roadkill formats to TM_RE)
4) PDF document  (very rough first-pass, will be amended as more time presents itself)

I may attach some more sample code as time goes on, or post more examples.

Here's a quick summary of the capabilities of this rail system:
[*] Rail engine can manage any number of rails simultaneously only limited to memory.
[*] Rail files are saved in 2K chunks, so even large rails can be saved and loaded very quickly.
[*] 2 modes of operation, SUBROUTINE and SERVER.
           a)SERVER mode allows scripts to run in NON-BLOCKING mode so they don't have to wait while the engine completes a rail command.
           b)SUBROUTINE mode runs each of the rail subroutines directly, but script execution is blocked until the rail finishs/fails.
[*] Lots of support functions including: Please check out the PDF file for more information (attached)
- TM_GotoClosestWaypoint - find the closest waypoint within walking range of the current rail
- TM_GotoClosestGlobalWaypoint - searchs all rails loaded into memory to find the closest waypoint; it's smart enough to know to choose the right waypoint just in case another one is close, but the z-axis may put that waypoint on another level.  i.e. Wandering in a house with multiple levels.
- TM_Push, TM_Pop - save and restore waypoint/rail information if you need to make a detour
...more functions are added all the time.  Part of why I haven't released this yet.
[*] Interactive rail developer; graphically allows you to record your waypoints while you walk, edit by adding, deleting, changing each waypoint.
[*] Each waypoint may have an associated "callback" function that will be called by the engine.  So you can add special code for waypoints that require special attention.
[*] Each rail file may have a separate callback script, so the rails can be completely independent of one another
[*] Ability to move toward and named type of item such as a specific NPC, moongate, teleporter, etc[/list]


Getting started:

This couldn't be easier.  Start the rail developer, stand where you want to start end press "Start Record" button.  Then just walk.  When you want to end recording, press the "Stop Record".  Enter the filename you'd like to save to and a unique label; the engine uses this label to reference your rail in memory.  Then press "Save"  You're done!  Of course you can step through your rail or run it from the developer, it's your choice.

Now, if you'd like to have the rail engine test your script, enter your rail filename and label into the following simple code and run it.  Yes, it's that easy.


--- Code: ---set %railsubs tool_railengine30f.txt
set %rail_filename railfile.txt
set %rail_label  RAIL_LABEL1

call %railsubs TM_Initialize  

call %railsubs TM_LoadRail %rail_filename

if #RESULT = #TRUE
{
  display ok Rail file not found
  stop
}
set #LPC 1000

call %railsubs TM_RunRail %rail_label 0 END FW  
if #RESULT = #TRUE
{
  display ok Rail error occurred.
}

call %railsubs TM_Close
stop
--- End code ---



Notes:
[*]I will keep the revisions under 1.0 until I get enough feedback to let me know the stability is good enough to validate full release.  So consider this a BETA release.[/list]

Release History
Engine:
Version 0.30k - 4/14/2007 Current release

Developer/Creator:
Version 0.55a - 4/14/2007 Current release

Converter:
Un-versioned release - will begin version number with next release.  Will also include a header. 4/14/2007

PDF document
Revision 2 4/14/2007

Scripts using this Engine
PM me if you use this and would like me to add your script to this list!

[*]ScriptUO Heartwood Quester v1.x
[*]ScriptUO Heartwood Quester v2.x
[*]TrailMyx's Zoo Collector
[*]TrailMyx's Quest List Builder
[*]SuperSlayer's World Idoc Traveler Version
[/list]



xxcaptainxx:
Can i only record from the points i am at or is it possible to type the cordinates in and save it that way?

TrailMyx:
With this version, you can only update a waypoint where you might be standing.  I think somewhere I made a version of the rail editor that you could tweak the coordinates.  Not sure what I did with that version, however.

TrailMyx:
Give version 55b a whirl.  There's a "Manual Update" button on that one so you can select a waypoint and then manually adjust the X/Y/Z coords.

I know what you are trying to do, but you are going to find that you will no longer be able to use the same rail going forward as you do going backward.  That's the nice thing about the quester is that you only need one rail to run into and out of heartwood. 

xxcaptainxx:
i made the rail work for going in.  but on the way back i can get it to enter the portal again

Navigation

[0] Message Index

[#] Next page

Go to full version