Author Topic: TrailMyx's Master Rail Engine/Developer  (Read 136003 times)

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
TrailMyx's Master Rail Engine/Developer
« on: June 09, 2008, 12:09:26 PM »
0
Code: [Select]
;-----------------------------------------------------------
; 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.
;-----------------------------------------------------------

Code: [Select]
;-----------------------------------------------------------
; 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
;




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
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: [Select]
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



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.
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




There are 5 attachment(s) in this post. You must register and post an acceptable introduction to download
rail_creator_guide2.pdf
tool_rail55c.txt
tool_railconverter1.txt
tool_railengine30k.txt
tool_railengine30l.txt
« Last Edit: December 18, 2009, 11:59:35 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline xxcaptainxx

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: TrailMyx's Master Rail Engine/Developer
« Reply #1 on: August 11, 2008, 06:05:31 PM »
0
Can i only record from the points i am at or is it possible to type the cordinates in and save it that way?

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Master Rail Engine/Developer
« Reply #2 on: August 11, 2008, 06:08:23 PM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Master Rail Engine/Developer
« Reply #3 on: August 11, 2008, 06:15:14 PM »
0
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. 
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline xxcaptainxx

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: TrailMyx's Master Rail Engine/Developer
« Reply #4 on: August 11, 2008, 06:18:21 PM »
0
i made the rail work for going in.  but on the way back i can get it to enter the portal again

Offline xxcaptainxx

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: TrailMyx's Master Rail Engine/Developer
« Reply #5 on: August 11, 2008, 06:35:01 PM »
0
How did you make it work frontwards and backwards?

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Master Rail Engine/Developer
« Reply #6 on: August 11, 2008, 07:25:13 PM »
0
Hmm, not sure I can explain it.

You'll notice there's a "Insert NamedKind" button.  This is to allow you to move toward something with a specific name.  If you get the information for the #FINDID of the "sparkle" for the gate, you'll notice it has a name associated with it (On OSI it does).  Since this name is the same on both sides of the portal, you can use this to move in and out of heartwood.

So you need to isolate the waypoint that transitions you into heartwood, make that function "Move to Named Type" and change the label of that waypoint to the text found in #PROPERTY of the sparkle (on OSI this is VQV_Portal).  If there is no text, then it'll be impossible the way the quester is currently written.  You'll have to re-write it so that you have a rail going into and then out of heartwood.  It's doable, perhaps something you can tackle.

Unfortunately, this was already covered back on uocoders; I had a nice tutorial about how to created heartwood rails.  Too bad that was some of the information that was lost; I just don't have the time to create something like that again.  I shouldn't even be messing with this for freeshards since we don't support it.  I do wish you luck figuring it out.

I did spend a lot of time putting together the PDF file that explains the engine and the creator, and some of this is covered in there, so you should probably read that closely.
« Last Edit: August 11, 2008, 08:30:44 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline xxcaptainxx

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: TrailMyx's Master Rail Engine/Developer
« Reply #7 on: August 17, 2008, 03:34:57 PM »
0
i made a new rail and it works great but when i tell it to save it says it does but it doesn't.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Master Rail Engine/Developer
« Reply #8 on: August 17, 2008, 03:40:47 PM »
0
check your path.  If you have "c:\railname.txt" then it'll be off your main c: since you are using XP.  If you tell it "railname.txt", then the rail will be in the same directory as your easyuo.exe file.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline xxcaptainxx

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: TrailMyx's Master Rail Engine/Developer
« Reply #9 on: August 17, 2008, 04:03:37 PM »
0
i made a new rail (for Quester) renamed it hw_trinket and when it gets to the point of loading it it just tells me rail error

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Master Rail Engine/Developer
« Reply #10 on: August 17, 2008, 04:07:25 PM »
0
you need to be sure to name your file "hw_trinket.txt"  It doesn't automatically default to adding the extension.

Also, what was the label you gave your new rail?  You need to know this too.  If you want it to work correctly, you should copy this information from the old rail.  i.e. same filename and same label.

Please refer to page 4 of the HowTo PDF guide; it's all explained there.
« Last Edit: August 17, 2008, 04:10:14 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline xxcaptainxx

  • Jr. Member
  • **
  • Posts: 47
  • Activity:
    0%
  • Reputation Power: 0
  • xxcaptainxx has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: TrailMyx's Master Rail Engine/Developer
« Reply #11 on: August 17, 2008, 04:10:55 PM »
0
ahh the label may be the problem let me give that a shot

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Master Rail Engine/Developer
« Reply #12 on: August 17, 2008, 04:38:48 PM »
0
ahh the label may be the problem let me give that a shot

Yeh, the label name is hard-wired into the script; it's how the script can manage more than one rail.  Heck, with my rail system, you can have 100s of rails in memory simultaneously.  Generally, the label defaults to "LABEL1".
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Master Rail Engine/Developer
« Reply #13 on: December 04, 2008, 05:48:23 AM »
0
Please leave any feedback regarding the rail engine and developer here.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Superslayer

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: TrailMyx's Master Rail Engine/Developer
« Reply #14 on: December 04, 2008, 06:45:44 AM »
0
Hi TrailMyx. I just took about an hour or so to run through your rail engine and am finding it very cool, and as always, loaded with excellent options.  One question so far though, when I read the rail text that I saved, I'm presented with text that I don't have in WinXP and can only assume it's something I need loaded.  Here's the an example:

Code: [Select]
set %fileout0 Around_House31710127413070?0TrailMyxCB001112
7813070?0TrailMyxCB0012128213060?0TrailMyxCB0013128413020?0T
railMyxCB0014128512980?0TrailMyxCB00151285
12940?0TrailMyxCB0016128312900?0TrailMyxCB0017127912880?0T
railMyxCB0018127512880?0TrailMyxCB00191271
12880?0TrailMyxCB00110126712880?0TrailMyxCB00111126312880?0
TrailMyxCB00112126112920?0TrailMyxCB001131261
12960?0TrailMyxCB00114126213000?0TrailMyxCB00115126513040
?0TrailMyxCB00116127013060?0TrailMyxCB00117127313053?0TrailMyxCB00
 set %callbackfunctions c:\callbacks.txt

I copied and pasted from the file to here.  If you could shed a little light on what is needed to view this that'd be a great help.  Again, great rail engine here, and I will continue to work with this and reply with any info that'd be useful.