Lua editor that works in Win 7, 64-bit?

Discussion about RailWorks scenario creation.

Lua editor that works in Win 7, 64-bit?

Unread postby OldProf » Sat Jan 17, 2015 12:05 pm

I think I've worked up the nerve to attempt writing LUA scripts for displaying messages in scenarios again. The last time I experimented with this the LUA software I tried to use caused severe problems in Windows 7, 64-bit. So what I'm looking for now is an editor-compiler or whatever is needed to attempt this task.

!*don-know!*
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: Lua editor that works in Win 7, 64-bit?

Unread postby artimrj » Sat Jan 17, 2015 12:08 pm

LUAs are text files. I use notepad2 cause it formats everything nicely and makes it easy to read. Compiling is another story. Not sure where to get that or why you would want it. It turns your LUA into an unreadable OUT file.
Bob Artim - Generation X²
I don't have a PHD, I have a DD214... Freedom carries sacrifice
I'm crawling in the dark looking for the answer
User avatar
artimrj
 
Posts: 4722
Joined: Sun Jan 31, 2010 3:07 pm
Location: Beaver, Pennsylvania

Re: Lua editor that works in Win 7, 64-bit?

Unread postby robbit » Sat Jan 17, 2015 12:16 pm

notepad++ is a good one but it is just the editor no need to compile
robbit
 
Posts: 838
Joined: Fri Jul 15, 2011 11:29 am
Location: Maine

Re: Lua editor that works in Win 7, 64-bit?

Unread postby jwtheiv » Sat Jan 17, 2015 1:50 pm

No need at all to compile. You just have ScenarioScript.lua in your scenario directory (change the guid's in it to either a new one generated by rwtools or you can also change it to match the guid of the scenario itself - either works). Then set up your html files in a subdirectory entitled En
My Train Simulator Workshop
Occasional repaints located on RWA
User avatar
jwtheiv
 
Posts: 494
Joined: Mon Jul 23, 2012 10:46 am
Location: Baltimore, MD

Re: Lua editor that works in Win 7, 64-bit?

Unread postby OldProf » Sun Jan 18, 2015 10:46 am

jwtheiv wrote:No need at all to compile. You just have ScenarioScript.lua in your scenario directory (change the guid's in it to either a new one generated by rwtools or you can also change it to match the guid of the scenario itself - either works). Then set up your html files in a subdirectory entitled En


RW_Tools. HTML, and subdirectory are familiar terms, but what does guid mean?

Really? all I need to do is write a plain text LUA script, save it in the correct folder, and refer to it in some instruction or other? Hmmm. Sounds too easy. Of course, there are rules for writing, as in any language. Looks like it's time for me to start examining some files in scenarios that include LUA instructions.

Thanks now and in advance for any more tips & tidbits.
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: Lua editor that works in Win 7, 64-bit?

Unread postby jwtheiv » Sun Jan 18, 2015 11:32 am

The scenario guide from here is great -
http://railworksamerica.com/index.php/c ... ting_guide


But in general, your file structure will look something like this -
filestructure.jpg


In the game, you will then add in trigger event (not CONDITIONS) field the name of the event. In this scenario, I use p695-initial as a little pop-up 10 seconds after the scenario starts.

in the lua, I call it like this:

Code: Select all
if event =="p695-initial" then
    SysCall ( "ScenarioManager:ShowInfoMessageExt", "c79180dc-0223-48f1-b036-c2a868a2151f", "p695-initial.html", 25, MSG_LEFT + MSG_TOP, MSG_SMALL, FALSE );
    return TRUE;
  end


Notice that it defaults to looking in the language directory - I don't call the html file as "En/p695-initial.html", but simply,"p695-initial.html"
html-files.jpg
You do not have the required permissions to view the files attached to this post.
My Train Simulator Workshop
Occasional repaints located on RWA
User avatar
jwtheiv
 
Posts: 494
Joined: Mon Jul 23, 2012 10:46 am
Location: Baltimore, MD

Re: Lua editor that works in Win 7, 64-bit?

Unread postby OldProf » Mon Jan 19, 2015 10:50 am

Thanks, jwtheiv, for the link to a script writing guide. I'd like to examine it, but the link isn't working: I've tried several times with both Firefox and Explorer, but all I get is an empty version of UploadRWA_3.zip that produces an error when I attempt to open it.

Nerts! Hoping that Bob will check this and fix it soon. (Thanks in advance, Bob.)
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: Lua editor that works in Win 7, 64-bit?

Unread postby jwtheiv » Mon Jan 19, 2015 11:21 am

That's really odd - I just checked and was able to d/l it without issue.
My Train Simulator Workshop
Occasional repaints located on RWA
User avatar
jwtheiv
 
Posts: 494
Joined: Mon Jul 23, 2012 10:46 am
Location: Baltimore, MD

Re: Lua editor that works in Win 7, 64-bit?

Unread postby artimrj » Mon Jan 19, 2015 12:32 pm

I dl'd and unrared it just fine. On my crappy work computor running VISTA.
Bob Artim - Generation X²
I don't have a PHD, I have a DD214... Freedom carries sacrifice
I'm crawling in the dark looking for the answer
User avatar
artimrj
 
Posts: 4722
Joined: Sun Jan 31, 2010 3:07 pm
Location: Beaver, Pennsylvania


Return to Scenario Creation

Who is online

Users browsing this forum: No registered users and 1 guest