LuaCreator a new tool for scenario editiing and scripting

Discussion about RailWorks scenario creation.

LuaCreator a new tool for scenario editiing and scripting

Unread postby RudolfJan » Mon Sep 14, 2015 7:21 am

Hi all,

Since a few months i'm working on a toolkit to make it much easier to create LUA scripts for scenarios. As a by product, the toolkit will contain also a number of handy scenario editing tools. A very first version is now available for download:

https://drive.google.com/open?id=0B5xmS3GoYKV1UjBJeHhIOFlOSzQ

My intention is to issue a new release about everry month, using this URL.

What can you do with this first version?
    Create a list of routes and scenarios. Not yet for routes packed in .ap files, but that will come soon.
    You can open the scenario folder in windows explorer (no more need to serach trhough lists of GUIDs)
    You can view some scenario properties
    You can view the instructions list
    Deleta rolling start saves and current saves from the tool (one mouse click)
    You can edit scenario properties and scenario.bon from the tool
    You can edit and compile LUA scripts from the tool.

In the next release, you probably can do some more things:
    View more scenario properties
    Get a skeleton LUA script, including all relevant trigger events
    Read routes and scenarios in .ap lists
Rudolf

http://www.hollandhiking.nl/trainsimulator
Here you will find the latest version of the Senario Authors Guide, TSW starters Guide, LuaCreator and TSWTools and more ...
RudolfJan
 
Posts: 134
Joined: Sun Jun 28, 2009 1:36 pm
Location: Netherlands

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby JerryC » Mon Sep 14, 2015 7:44 am

Any tool that can make creating scenarios less like a poke in the eye with a sharp stick is a welcome addition!
JerryC
 

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby Chacal » Mon Sep 14, 2015 2:58 pm

This sounds great, I can't wait to try it!
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6485
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby RudolfJan » Tue Sep 15, 2015 1:23 pm

Working hard on version 0.2 now. First improvements are working now.
Rudolf

http://www.hollandhiking.nl/trainsimulator
Here you will find the latest version of the Senario Authors Guide, TSW starters Guide, LuaCreator and TSWTools and more ...
RudolfJan
 
Posts: 134
Joined: Sun Jun 28, 2009 1:36 pm
Location: Netherlands

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby OldProf » Thu Sep 17, 2015 5:39 am

JerryC wrote:Any tool that can make creating scenarios less like a poke in the eye with a sharp stick is a welcome addition!


I was going to respond to this post, in defense of the scenario editor, but then I looked at your signature motto and realized that there was no need to do so. !*YAAA*! !!howdy!!
Tom Pallen (Old Prof)

{Win 10 Home 64-bit; Intel Core i7 6700 @ 3.40GHz; 16.0GB Single-Channel @ 1063 MHz (15-15-15-364); 2047MB NVIDIA GeForce GTX 960}
User avatar
OldProf
 
Posts: 2743
Joined: Wed Sep 09, 2009 10:09 am

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby JerryC » Fri Oct 02, 2015 2:48 pm

Very funny. Remember that before complaining about my next product having no scenarios. !*YAAA*!

Anyway, this is a great tutorial. It has actually even helped to set up messages for triggering locomotive controls that are not dependent on external scenarios. However, I have to ask if you have ever actually been able to trigger a function or a message in an AI vehicle? I have tried to trigger both text and audio messages using an AI train and have had no success. I've tried using both the AI train's unit number and using the AI consist name. What i'm trying to do is trigger a dispatch message to the player train when the AI passes a certain point.

There does seem to be more than one way to skin the cat though. Failing the AI trigger, I suppose you might be able to trigger it by getting the next signal state.
JerryC
 

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby OldProf » Sat Oct 03, 2015 6:29 am

JerryC wrote:... However, I have to ask if you have ever actually been able to trigger a function or a message in an AI vehicle? I have tried to trigger both text and audio messages using an AI train and have had no success. I've tried using both the AI train's unit number and using the AI consist name. What i'm trying to do is trigger a dispatch message to the player train when the AI passes a certain point.

There does seem to be more than one way to skin the cat though. Failing the AI trigger, I suppose you might be able to trigger it by getting the next signal state.


I'm ready to swear that triggering a written on-screen message with an AI engine was possible at one time, but I don't think it's possible anymore. I'll put together a test scenario and see what happens.

A much more serious wish on my part is being able to start an AI train moving when the player train passes a particular track marker.

"If wishes were fishes, we'd all have a fry," as my mother used to say.
Tom Pallen (Old Prof)

{Win 10 Home 64-bit; Intel Core i7 6700 @ 3.40GHz; 16.0GB Single-Channel @ 1063 MHz (15-15-15-364); 2047MB NVIDIA GeForce GTX 960}
User avatar
OldProf
 
Posts: 2743
Joined: Wed Sep 09, 2009 10:09 am

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby JerryC » Sat Oct 03, 2015 11:35 am

I tried the "Get next signal state" approach (no pun intended) last eve, but with no success. That does not mean this method does not work though; my LUA-Kung Fu is weak. I shall have to study further.

According to what i've ready from other sources since writing the GP40 scenarios last year, you should be able to do all sorts of things to the AI through the Script: blow horns, turn on the lights, stop, start - but i've yet to be able to make them do anythng. If I do remember correctly, the HSC route has several scenarios that call on the AI to do things, using the unit number just like the tutorial states.
JerryC
 

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby RudolfJan » Tue Oct 13, 2015 11:35 am

JerryC wrote:I tried the "Get next signal state" approach (no pun intended) last eve, but with no success. That does not mean this method does not work though; my LUA-Kung Fu is weak. I shall have to study further.

According to what i've ready from other sources since writing the GP40 scenarios last year, you should be able to do all sorts of things to the AI through the Script: blow horns, turn on the lights, stop, start - but i've yet to be able to make them do anythng. If I do remember correctly, the HSC route has several scenarios that call on the AI to do things, using the unit number just like the tutorial states.

I did some experiments, but no success till now. If I am in the right mood, I will try again...
Rudolf

http://www.hollandhiking.nl/trainsimulator
Here you will find the latest version of the Senario Authors Guide, TSW starters Guide, LuaCreator and TSWTools and more ...
RudolfJan
 
Posts: 134
Joined: Sun Jun 28, 2009 1:36 pm
Location: Netherlands

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby OldProf » Thu Oct 15, 2015 8:54 am

Sorry this took so long -- I forgot about it!

Anyway, I wrote a short scenario to test whether an AI train can send an on-screen message to the player without any LUA scripting: I'm pleased to report that the answer is yes!

Details: I gave the AI train three instructions.
1. Trigger with message: message appeared on screen.
2. Drive to with message: message did not appear on screen.
3. Trigger with message: message appeared on screen.

So, it's obvious that an AI's trigger instructions can send a message that appears on the screen while the player is carrying out instructions. Caution: if the AI's message is triggered just as a message generated by the PT's instructions appears, the AI message will bump the PT message off the screen!

!!howdy!!
Tom Pallen (Old Prof)

{Win 10 Home 64-bit; Intel Core i7 6700 @ 3.40GHz; 16.0GB Single-Channel @ 1063 MHz (15-15-15-364); 2047MB NVIDIA GeForce GTX 960}
User avatar
OldProf
 
Posts: 2743
Joined: Wed Sep 09, 2009 10:09 am

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby Chacal » Thu Oct 15, 2015 9:02 am

Interesting... this means we can simulate radio calls to dispatcher from AI trains, as a way to inform the player of the whereabouts of other trains.
Thanks for the research.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6485
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: LuaCreator a new tool for scenario editiing and scripting

Unread postby RudolfJan » Thu Oct 15, 2015 12:01 pm

OldProf wrote:Sorry this took so long -- I forgot about it!

Anyway, I wrote a short scenario to test whether an AI train can send an on-screen message to the player without any LUA scripting: I'm pleased to report that the answer is yes!

Details: I gave the AI train three instructions.
1. Trigger with message: message appeared on screen.
2. Drive to with message: message did not appear on screen.
3. Trigger with message: message appeared on screen.

So, it's obvious that an AI's trigger instructions can send a message that appears on the screen while the player is carrying out instructions. Caution: if the AI's message is triggered just as a message generated by the PT's instructions appears, the AI message will bump the PT message off the screen!

!!howdy!!

This is great, thanks for sharing, but maybe you should use the Alert message:

Code: Select all
SysCall("ScenarioManager:ShowAlertMessageExt", header, text, duration, event)

If you add another alert message it will appear just below the previous one in the upper right corner. It's my favourite message type, because it is not so intrusive on game play.
Rudolf

http://www.hollandhiking.nl/trainsimulator
Here you will find the latest version of the Senario Authors Guide, TSW starters Guide, LuaCreator and TSWTools and more ...
RudolfJan
 
Posts: 134
Joined: Sun Jun 28, 2009 1:36 pm
Location: Netherlands


Return to Scenario Creation

Who is online

Users browsing this forum: No registered users and 1 guest

cron