Page 1 of 1

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

Unread postPosted: Sat Jan 17, 2015 12:05 pm
by OldProf
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!*

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

Unread postPosted: Sat Jan 17, 2015 12:08 pm
by artimrj
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.

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

Unread postPosted: Sat Jan 17, 2015 12:16 pm
by robbit
notepad++ is a good one but it is just the editor no need to compile

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

Unread postPosted: Sat Jan 17, 2015 1:50 pm
by jwtheiv
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

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

Unread postPosted: Sun Jan 18, 2015 10:46 am
by OldProf
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.

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

Unread postPosted: Sun Jan 18, 2015 11:32 am
by jwtheiv
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

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

Unread postPosted: Mon Jan 19, 2015 10:50 am
by OldProf
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.)

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

Unread postPosted: Mon Jan 19, 2015 11:21 am
by jwtheiv
That's really odd - I just checked and was able to d/l it without issue.

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

Unread postPosted: Mon Jan 19, 2015 12:32 pm
by artimrj
I dl'd and unrared it just fine. On my crappy work computor running VISTA.