[RFD] Signaling

Development discussion about Transport Empire. Other discussion to General forum please.

Moderator: Transport Empire Moderators

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

XeryusTC wrote:Only an example script won't help, we would also need a bit of documentation/manual ;).
The proper documentation should be in the answers to 2 and 3. The hooks should all be properly documented as to what causes them to be called, what data they provide, and what results they expect to receive/acheive, and the script should be properly commented.

And, just in case there's a misunderstanding: By "hooks" I meant "things that cause the Lua code to be called", not "things that the Lua code can call". Maybe that's not the right word (callbacks? bindings?) but that's the one I used.

Clearly, there also has to be some way for the Lua scripts to query, and possibly set, the game state, and those should also be properly documented in #2.

This is basically a "Show me it can be done sanely" line of questioning. What game-state is required? How complex is the script? How often does it get called?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

DaleStan wrote:And, just in case there's a misunderstanding: By "hooks" I meant "things that cause the Lua code to be called", not "things that the Lua code can call". Maybe that's not the right word (callbacks? bindings?) but that's the one I used.
There was a misunderstanding on my part then :).
DaleStan wrote:Clearly, there also has to be some way for the Lua scripts to query, and possibly set, the game state, and those should also be properly documented in #2.

This is basically a "Show me it can be done sanely" line of questioning. What game-state is required? How complex is the script? How often does it get called?
Usually you would call a script everytime an event occurs (this how it's done in TRoS GUIv2, which is the only current scripting part in TRoS). it will become overkill when you'll try to call a script everytime a train passes a signal. The best way of "culling" this is to build scriptable signals, everytime a train passes (looks ahead probably) this signal it will call the script.
For complexity: you can make a script as complex as you want, but we want to discorage that behaviour so there would have to be loads of C++ wrappers.
Anyway, it would become quite a job to make signals scriptable. It would be quite hard to get a decent speed out of it when event driven (although my above solution would solve it for a big part). And ofcourse scripting signals should be easy enough so your avarage 14 year old with 2 weeks of PHP experience can do it, and for others there could be some (ingame) editor.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Post by aarona »

So should we have scriptable signals?

If we do, then we need not discuss this further.

If we don't then we need to compromise on what the best method of signalling is, and how its going to work.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

I just prefer the latter for now and keep the first in the back of our head.
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

I would prefer build in signal systems too, but we could always implement scripting support when there is a big demand for it.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
User avatar
Dave
Moderator
Moderator
Posts: 17243
Joined: 26 Dec 2005 20:19
Location: North London

Post by Dave »

A bit of both maybe?

Surely there should be a default system, which can be edited?
Official TT-Dave Fan Club

Dave's Screenshot Thread! - Albion: A fictional Britain
Flickr


Why be a song when you can be a symphony? r is a...
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Dave Worley wrote:A bit of both maybe?

Surely there should be a default system, which can be edited?
Isn't that what I said? Start with the latter and keep the first in the back of our head :roll: .
User avatar
Dave
Moderator
Moderator
Posts: 17243
Joined: 26 Dec 2005 20:19
Location: North London

Post by Dave »

Hyronymus wrote:
Dave Worley wrote:A bit of both maybe?

Surely there should be a default system, which can be edited?
Isn't that what I said? Start with the latter and keep the first in the back of our head :roll: .
Sorry I assumed you meant it in another context.
Official TT-Dave Fan Club

Dave's Screenshot Thread! - Albion: A fictional Britain
Flickr


Why be a song when you can be a symphony? r is a...
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Don't be sorry, I'm not too clear all the time.

Locked until the DD discussion arrives at this issue.
Locked

Return to “Transport Empire Development”

Who is online

Users browsing this forum: No registered users and 20 guests