NoGo - A Scriptable Game Framework - v1.5

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: NoGo - A Scriptable Game Framework

Post 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 2750 times
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post 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.?
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post 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
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post 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 :)?
Transportman
Tycoon
Tycoon
Posts: 2792
Joined: 22 Feb 2011 18:34

Re: NoGo - A Scriptable Game Framework

Post 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).
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post 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
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoGo - A Scriptable Game Framework

Post 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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post 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 ...
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoGo - A Scriptable Game Framework

Post 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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoGo - A Scriptable Game Framework

Post 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 ).
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post 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.
The only thing necessary for the triumph of evil is for good men to do nothing.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post 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.)
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post 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?
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post by TrueBrain »

Yes.

(short answer best answer :D)
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post 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?
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

the more important question: can the GS enforce "quantum effects" on the fire truck, so it won't be blocked by vehicles?
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post 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.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post 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.
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: NoGo - A Scriptable Game Framework

Post 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:
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post 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 :)
The only thing necessary for the triumph of evil is for good men to do nothing.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 10 guests