Page 7 of 17

Re: NoGo - A Scriptable Game Framework

Posted: 03 Dec 2011 21:55
by MinchinWeb
Would it be possible to add a list of the GameScirpts loaded, similar to the AI's, on the "Command Line Help" screen?
AI's Loaded
AI's Loaded
Fullscreen capture 03122011 24943 PM.bmp.jpg (47.83 KiB) Viewed 2758 times

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 10:06
by Hyronymus
TrueBrain, is it possible to make a scrip that influences the game in such a way that it sends emergency vehicles from a grf to a vehicle crash site i.e.?

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 10:20
by TrueBrain
Hyronymus wrote:TrueBrain, is it possible to make a scrip that influences the game in such a way that it sends emergency vehicles from a grf to a vehicle crash site i.e.?
Although I like the idea somewhat, I see no way to technical implement something like that. Someone will have to come up with something nifty for that .. unsure atm :) So I guess the answer is: no :P

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 10:39
by Hyronymus
TrueBrain wrote:
Hyronymus wrote:TrueBrain, is it possible to make a scrip that influences the game in such a way that it sends emergency vehicles from a grf to a vehicle crash site i.e.?
Although I like the idea somewhat, I see no way to technical implement something like that. Someone will have to come up with something nifty for that .. unsure atm :) So I guess the answer is: no :P
Where lies the problem exactly then, just out of curiousity :)?

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 10:54
by Transportman
TrueBrain wrote:
Hyronymus wrote:TrueBrain, is it possible to make a scrip that influences the game in such a way that it sends emergency vehicles from a grf to a vehicle crash site i.e.?
Although I like the idea somewhat, I see no way to technical implement something like that. Someone will have to come up with something nifty for that .. unsure atm :) So I guess the answer is: no :P
My suggestion for an implementation:
A script should detect where a crash happened, build a bus station near it and send vehicles from a depot to that bus station and after a set amount of time return to the depot/have their order removed to keep them driving around in towns.

So, the only thing that is really needed in this case is a way to detect where the crash happened. The rest is already possible I think (building stuff and give orders are things AI's already can do).

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 11:01
by TrueBrain
Hyronymus wrote:
TrueBrain wrote:
Hyronymus wrote:TrueBrain, is it possible to make a scrip that influences the game in such a way that it sends emergency vehicles from a grf to a vehicle crash site i.e.?
Although I like the idea somewhat, I see no way to technical implement something like that. Someone will have to come up with something nifty for that .. unsure atm :) So I guess the answer is: no :P
Where lies the problem exactly then, just out of curiousity :)?
You cannot order a vehicle to go to a tile is the biggest issue I guess :) And who is going to pay for it! :P

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 11:38
by Zuu
Transportman wrote:So, the only thing that is really needed in this case is a way to detect where the crash happened. The rest is already possible I think (building stuff and give orders are things AI's already can do).
There is an event for crashed vehicles. CluelessPlus for example listen to this event and tries to turn level crossings into bridges if its buses/trucks get hit by a train.

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 12:11
by TrueBrain
Bit of general progress report. I have been fiddling a lot with translations. The Squirrel side is now as good as done. The OpenTTD side is a pita. Unsure about any ETA in those regards.

I also added tons of fun stuff.
- Create Subsidy
- Create News
- Create custom town text
- Scroll (in singleplayer) the user screen to a certain position

It is all getting together slowly :) I hope to push a new version soon with all these goodies in there, but for now I am working on translations ...

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 15:16
by Zuu
Are there people who would be interested to help out writing text for a tutorial, if a framework is built in NoGo? Assuming this tutorial will be more of a kind where the user will have to do what the tutorial says that he/she should do.

I hope NoGo will get a way that we can highlight buttons in the interface. We recently also got the ability to move the viewport. So it should be doable. While the AI tutorial did build road etc., it uses libraries that are not yet available for NoGo, and it might make more sense that the player should build himself with the help of which buttons etc. to use.


Edit: In a early test I have something like this:

Code: Select all

	this._chapter_sequence = [];

	this._chapter_sequence.append( MessageStep("Hello and welcome to the bus tutorial") );
	this._chapter_sequence.append( MessageStep("Thanks for taking this tutorial") );

	this._chapter_sequence[0]._next = this._chapter_sequence[1];
but I hope to improve this to make it fairly easy to add tutorial steps and configure how a step ends and possible allow for non-linear patterns.

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 15:44
by Kogut
Zuu wrote:
Transportman wrote:So, the only thing that is really needed in this case is a way to detect where the crash happened. The rest is already possible I think (building stuff and give orders are things AI's already can do).
There is an event for crashed vehicles. CluelessPlus for example listen to this event and tries to turn level crossings into bridges if its buses/trucks get hit by a train.
Unfortunately AIs are restricted to info about their own vehicles ("Event Vehicle Crash, indicating a vehicle of yours is crashed" - http://noai.openttd.org/api/trunk/class ... ashed.html ).

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 15:50
by TrueBrain
Kogut wrote:
Zuu wrote:
Transportman wrote:So, the only thing that is really needed in this case is a way to detect where the crash happened. The rest is already possible I think (building stuff and give orders are things AI's already can do).
There is an event for crashed vehicles. CluelessPlus for example listen to this event and tries to turn level crossings into bridges if its buses/trucks get hit by a train.
Unfortunately AIs are restricted to info about their own vehicles ("Event Vehicle Crash, indicating a vehicle of yours is crashed" - http://noai.openttd.org/api/trunk/class ... ashed.html ).
But we are talking about GS here, which do receive the notifications of all companies. So his idea is valid and works for that situation.

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 15:51
by TrueBrain
I am pushing a new version as we speak. It contains everything except the translation part (as that isn't done yet). It contains all the new goodies mentioned a few posts above here. Please test/try/abuse/give feedback, all much appreciated :)

One noticeable bug was fixed: funding towns is no longer funding infinite months, in case the GS is controlling the growth ;) Tnx to Xaroth for noticing and reporting.

This new version bumps the savegame, so don't expect your savegame to be loadable by the next version of NoGo (and it is incompatible with trunk). So don't start a long running game with this, unless you want to finish it with this build ;) Just a piece of warning there :)

I also updated my initial post to indicate roughly what NoGo can already do.

(PS: the docs are also updated at http://devs.openttd.org/~truebrain/nogo ... tated.html , in case you want to browse around all the goodies available to you.)

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 17:27
by Hyronymus
Transportman wrote:
TrueBrain wrote:
Hyronymus wrote:TrueBrain, is it possible to make a scrip that influences the game in such a way that it sends emergency vehicles from a grf to a vehicle crash site i.e.?
Although I like the idea somewhat, I see no way to technical implement something like that. Someone will have to come up with something nifty for that .. unsure atm :) So I guess the answer is: no :P
My suggestion for an implementation:
A script should detect where a crash happened, build a bus station near it and send vehicles from a depot to that bus station and after a set amount of time return to the depot/have their order removed to keep them driving around in towns.

So, the only thing that is really needed in this case is a way to detect where the crash happened. The rest is already possible I think (building stuff and give orders are things AI's already can do).
And why does it have to build such a depot if you can provide such depots by default if you let cities build fire and police departments, as well as hospitals?

TrueBrain: about paying for it: if you declare no running costs for emergency vehicles and no purchase costs, doesn't that make them free?

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 19:06
by TrueBrain
Yes.

(short answer best answer :D)

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 20:10
by Hyronymus
TrueBrain wrote:Yes.

(short answer best answer :D)
Yeah, they are :P.

Let's assume one uses Zimmlock's fire department as fire truck depot. Can NoGo check the existence of the closest-by fire department and dispatch a fire truck towards the crash site from there?

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 20:51
by Eddi
the more important question: can the GS enforce "quantum effects" on the fire truck, so it won't be blocked by vehicles?

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 21:01
by Hyronymus
Eddi wrote:the more important question: can the GS enforce "quantum effects" on the fire truck, so it won't be blocked by vehicles?
You mean having right of way everywhere? Good point but maybe they can be teleported a bit? I mean, they don't have to start at the fire depot if the distance is quite big. Just a thought.

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 21:35
by Eddi
"teleporting" may be tricky, but it could be handled the same way as just creating the vehicle in the first place, i.e. just making it disappear somewhere and make a new vehicle appear somewhere else. for lack of fire stations you could just pick a random tile in the area to create the vehicle, or the town center, or whatever.

but "quantum effects" is already a game feature (watch traffic jams for a while), so it should be possible to just set a flag on a vehicle to enable this. if possible, all vehicles it passes this way should stop for a short period of time.

Re: NoGo - A Scriptable Game Framework

Posted: 04 Dec 2011 21:53
by Supercheese
Wow, actually being able to have emergency vehicles automatically dispatched... that sounds too good to be true (though I hope it isn't!) :shock:

Re: NoGo - A Scriptable Game Framework

Posted: 05 Dec 2011 00:12
by TrueBrain
We are drifting out of scope here a bit :D I like the idea, I do a lot, but it is not a primary function of NoGo. Just nice if it also happen to be possible :)

If you are serious about something like this, I guess best thing to do is open a new thread and talk about it? I am sure some of you will have insane ideas and find a nice way to implement it :)