New LUA function?
Moderator: Moderators
- DaveDewhurst
- Very Active Forum Member
- Posts: 1994
- Joined: Wed Nov 28, 2007 10:21 am
- Location: Birkenhead
- Contact:
New LUA function?
Whilst trying to understand why London - Faversham runs slow (in another thread), I was looking at the .out file for the 395.
Although mostly gibberish you can read some bits, like calls and variable names.
I was intrigued to see the clock parts listed as names because;
1. I would have thought it was unneeded to script a clock as the game will automatically set the clock as long as your parts are named correctly in a clock blueprint. (see the ICE2 for an example)
2. To script a clock you would need to be able to get the current time.
Reading a bit further down I think I see a new call (I dont recall ever seeing this one before)
"SysCall ScenarioManager:GetTimeOfDay"
Its obviously lost its formatting and any arguments but could this be the function a lot of us have been waiting for?
Dave
Although mostly gibberish you can read some bits, like calls and variable names.
I was intrigued to see the clock parts listed as names because;
1. I would have thought it was unneeded to script a clock as the game will automatically set the clock as long as your parts are named correctly in a clock blueprint. (see the ICE2 for an example)
2. To script a clock you would need to be able to get the current time.
Reading a bit further down I think I see a new call (I dont recall ever seeing this one before)
"SysCall ScenarioManager:GetTimeOfDay"
Its obviously lost its formatting and any arguments but could this be the function a lot of us have been waiting for?
Dave
- ChrisBarnes
- Very Active Forum Member
- Posts: 1494
- Joined: Sat Jul 25, 2009 3:45 pm
- Location: North Yorkshire
Re: New LUA function?
Interesting find Dave, I think a few new call functions were added to the game including the particle velocity function, but sadly these don't seem to have been documented in the wiki or elsewhere.
Chris
Chris
Just Trains BR 4, 5, 6, 7 and LNER K4 & V2 script and simulation author
- DaveDewhurst
- Very Active Forum Member
- Posts: 1994
- Joined: Wed Nov 28, 2007 10:21 am
- Location: Birkenhead
- Contact:
Re: New LUA function?
Well.
It works
SysCall ("ScenarioManager:GetTimeOfDay")
returns seconds since midnight.
Dave
It works
SysCall ("ScenarioManager:GetTimeOfDay")
returns seconds since midnight.
Dave
Re: New LUA function?
I think I just had a flash back to MSTS!
Scottish Born Scenario Writer
i7 6700K 4.4GHz Overclock - 16Gb Corsair VengeanceDDR4 3200MHz - Asus MaximusVIII Mobo - Asus GTX1080 A8G 8GB GDDR5X - 240Gb+480Gb Crucial BX200 SSD Windows10 (64Bit) - Corsair HX750i
i7 6700K 4.4GHz Overclock - 16Gb Corsair VengeanceDDR4 3200MHz - Asus MaximusVIII Mobo - Asus GTX1080 A8G 8GB GDDR5X - 240Gb+480Gb Crucial BX200 SSD Windows10 (64Bit) - Corsair HX750i
- AndiS
- Very Active Forum Member
- Posts: 6207
- Joined: Fri Sep 23, 2005 4:43 pm
- Location: Jester's cell in ivory tower
- Contact:
Re: New LUA function?
The funny thing is that I need a book now where I note all my ideas and why they don't work, so when someone comes up with a great find like this, I remember what I wanted to do with it.
I keep thinking for a day now and all I remember was writing a much improved train movement log (as a service function of the signals). With the real time of day, this could actually help scenario creators understand where all the AI trains stayed when they are too far from the player train to observe.
I keep thinking for a day now and all I remember was writing a much improved train movement log (as a service function of the signals). With the real time of day, this could actually help scenario creators understand where all the AI trains stayed when they are too far from the player train to observe.
Re: New LUA function?
Now the only thing is needed, is a good solution for displaying dynamic text, and digits, in game, which is not like the hiding unhiding method with interior visibility.
- AndiS
- Very Active Forum Member
- Posts: 6207
- Joined: Fri Sep 23, 2005 4:43 pm
- Location: Jester's cell in ivory tower
- Contact:
Re: New LUA function?
Are Texture Sets and SetText too limiting for you?
Hasn't someone already done destination displays?
Or are you thinking about more complex things like proportional font?
There are scriptable scenery items, however, no one has found a good use for them as of yet. This GetTimeOfDay function could change that. You could expand the clock idea to animated figurines like they have it on old town halls. Unfortunately, those are rarely in view of a railway line.
But what about ringing the church bells every full hour (and quarter of an hour) to tell the time? At least for SADs route, the scripting and sound effort should pay off.
Hasn't someone already done destination displays?
Or are you thinking about more complex things like proportional font?
There are scriptable scenery items, however, no one has found a good use for them as of yet. This GetTimeOfDay function could change that. You could expand the clock idea to animated figurines like they have it on old town halls. Unfortunately, those are rarely in view of a railway line.
But what about ringing the church bells every full hour (and quarter of an hour) to tell the time? At least for SADs route, the scripting and sound effort should pay off.
Re: New LUA function?
Texture sets are not working inside the cab. And that method is still one of the worst solutions that i've ever seen in a game
Other games have solutions just to write and draw dynamically anything on certain surfaces.
- DaveDewhurst
- Very Active Forum Member
- Posts: 1994
- Joined: Wed Nov 28, 2007 10:21 am
- Location: Birkenhead
- Contact:
Re: New LUA function?
Station lights that go on at the correct timeAndiS wrote:Are Texture Sets and SetText too limiting for you?
Hasn't someone already done destination displays?
Or are you thinking about more complex things like proportional font?
There are scriptable scenery items, however, no one has found a good use for them as of yet. This GetTimeOfDay function could change that. You could expand the clock idea to animated figurines like they have it on old town halls. Unfortunately, those are rarely in view of a railway line.
But what about ringing the church bells every full hour (and quarter of an hour) to tell the time? At least for SADs route, the scripting and sound effort should pay off.
Platforms fuller at peak times.
AI using correct Day/Night lights
etc
etc
Dave
- AndiS
- Very Active Forum Member
- Posts: 6207
- Joined: Fri Sep 23, 2005 4:43 pm
- Location: Jester's cell in ivory tower
- Contact:
Re: New LUA function?
Yeah - that was it! More specifically, I remember struggling (before the introduction of projected light) with additive light panes fixed to coaches and it was clear that you would need day and night versions and no one knew how to decide dynamically between them.DaveDewhurst wrote:Station lights that go on at the correct time
AI using correct Day/Night lights
Now that you mention AI, I would add AI that does not whistle at night times (or whistle less, depending on the regulations).
Wasn't there some feature in the platform population blueprint for that? I vaguely remember it being complex, with different population densities for different times. But I never tried it out. And I might confuse it with the road blueprints now, but I don't think so.Platforms fuller at peak times.
Overall conclusion: If you have a forum, you don't need a notebook nor a memory.
Re: New LUA function?
TextureSets are limited to 2x32 Letters in one object. I want to create a EBuLa for german trains and there you need 5x15 cells to display text with some have more than 64 letters to display. I wont script that matrix for texture sets. With dynamic (font based) text display it would be easy to do such a high dynamic display.AndiS wrote:Are Texture Sets and SetText too limiting for you?
Yes. On a loco with 16 positions of single seperated letters, but not as texture set. But we have tested it with a plattform destination display and it works "good" but its totaly limited and you have to declare those displays as signals.AndiS wrote:Hasn't someone already done destination displays?
And for the GetTimeOfDay syscall: it's old. Syscalls are all over there in that sim, but they are not documented, and you have to dig out them by trying worse things. And SysCalls are made for scenario scripting, but works also in vehicles. And note, use this calls with care. Do not create vehicles with wrong or destructing implementations of some syscalls, because if RSC wont that, they cut them out or make it unusable without seperate tools.