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
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: NoGo - A Scriptable Game Framework

Post by Yexo »

I completely agree Eddi. In my opinion it's not "unlikely to change". There has been a feature request for this open on flyspray for a very long time. The main problem is finding a nice way to implement this without breaking backwards compatibility too much.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post by TrueBrain »

How ever that might be, it is far off topic from NoGo, so please do make a new thread about that, and talk there about it :) (not meant in a bad way, but I like to keep this thread to talk about NoGo as much as possible, which does not include extending NoAI :) Sorry!)


On a slightly related note, today I committed the refactoring of the script part of OpenTTD. Although this is (another) step towards NoGo, there is still no code (directly) related to NoGo in trunk. Just FYI!

(just a long overdue generalisation of an awesome framework :D)
The only thing necessary for the triumph of evil is for good men to do nothing.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: NoGo - A Scriptable Game Framework

Post by Transportman »

TrueBrain wrote: - Build on behalf of a company (with great power comes great responsibility!), by create an instance of GSCompanyMode(<value>) in a scope. It works identical to TestMode and ExecMode, only it changes the current company.
Does that mean that someone could make a script that "teleports" vehicles from one depot to the other? Teleport in the sense of buying a clone in one depot when a train enters another depot and selling the original. Of course such a script has to take a lot of things into account, like vehicle availability (can that list also be accessed by a script?), a possible change from electrified tracks to monorail/maglev/non-electric, but if I understand the change you made correct, it is possible to create a teleportation script?

(No, I'm not going to make such a script, I'm just curious if such a script is possible with NoGo)
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
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 »

Yes, you could make a script that "teleport" player vehicles as you describe. It will probably not be free of charge for the player unless a way for GS to give money back to the company is introduced. (I haven't checked yet, but I assume that this GSCompanyMode just set _current_company and not magically makes the commands free)

To trigger this, the script could for example require you to label your depots with signs to address depots as source/destination and which pair it belongs to. It would help if players use the stop-in-depot order.

Edit: The script must however not try to do too many other things, as it would then increase the possible lag between a vehicle entering the depot and being teleported. This is because it needs to either scan all depots for stopped vehicles or scan the entire vehicle list for vehicles stopped in depot. If it would try to do other time consuming tasks, no vehicles would get teleported during that time. [yes, unless you call the teleport scanner from time to time during your very long other task]


And yes, you could also write things like a convert to monorail tool that is triggered by some message, eg. a sign (say hello to TTDPatch-style sign commands again ;-) )
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: NoGo - A Scriptable Game Framework

Post by Expresso »

Would it be possible to script disasters?
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Expresso wrote:Would it be possible to script disasters?
Not until a NoGod script has been written ;).

What kind of disasters are you thinking off, real natural disasters or big fires and such?
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: NoGo - A Scriptable Game Framework

Post by Yexo »

Adding new disasters via a script will be very unlikely. Triggering the existing disasters should be doable (but it's not implemented and I haven't heard plans for it yet either).
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoGo - A Scriptable Game Framework

Post by Kogut »

It is possible to create disasters using code allowing for closing industries, terraforming and executing commands as company.
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 »

Which events would you guys like to have? Feel free to think out of the box ;)
The only thing necessary for the triumph of evil is for good men to do nothing.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

something that i remember being sugggested was a way to create/remove money out of thin air (not give to another company), for certain administrative purposes.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

TrueBrain wrote:Which events would you guys like to have? Feel free to think out of the box ;)
Well... I guess this ties into my suggested news messages:
Hyronymus wrote:What kind of news messages do you foresee being trighered by NoGo? What would be fun is:
- new speed record per vehicle class (upon highest reached speed)
- crowded vehicles on station 1 (upon consecutive vehicles stopping at a station and fully loading x times in a row)
- signal failure (upon a signal showing red for a given time)
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: NoGo - A Scriptable Game Framework

Post by andythenorth »

TrueBrain wrote:Which events would you guys like to have? Feel free to think out of the box ;)
There are some listed on this (now outdated) page :D

http://wiki.openttd.org/Requested_featu ... _Framework

Guess we should update / remove that page soon :wink:

Not all of these are events, but mostly event-related
Industry open/close (possibly with a reason for close, although that might require too much coupling to newgrf)
Town growth (positive or negative)
New town founded
Terrain modification (lower, rise parts)
Bulldoze certain area(s)
Route construction (ideally extended with cb / ability to limit amount of road, track, number of airports, docks etc)
Vehicle leaves/arrives station
Cargo collected/delivered
Detailed control of subsidy framework
Hooks to all company financials
Buy / sell shares
Objects constructed
Town menu options (statue, advertise, bribe etc)
Cheats used
Town rating change

Ideas for challenges include:
- limited resources (connect cities X,Y,Z with limited track / road)
- fastest average travel times while shipping x amount of cargo
- company value
- company profit
- buy all competitors
- deliver x amount of cargo
- connect every town on the map
- connect all industries of type x
- highest ratings for criteria xyz
- "it's political" - map has regions, have to get a good rating in one 'region' before the next region lets you build
- mini challenges (micro managed)

Any of the above by certain dates
User avatar
Dwight_K._Schrute
Traffic Manager
Traffic Manager
Posts: 209
Joined: 01 Sep 2010 11:29

Re: NoGo - A Scriptable Game Framework

Post by Dwight_K._Schrute »

It would be great to allow or disallow a SINGLE city/city to grow. Maybe with a checkbox oder something like that in the town gui.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

a script could read player-built signs (mimic-ing the TTDPatch sign cheats), so you could place a sign "nogrowth" on the town center, and the script might follow it.

on the notion of disasters: "the road between X and Y is blocked by a landslide" (destroy road and disallow building over/around it for a number of ticks/days/months)

PS: any tips on how i would go about connecting the towns by road on game start? (build roads as OWNER_TOWN or OWNER_NONE, a sensible road pathfinder that avoids completely straight stretches (pherhaps a copy of the river pathfinder))
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 »

I had the idea of a disaster: Strike.

The script would then stop all vehicles of a given vehicle type that belongs to one or several companies. The script will have to keep looping over all vehicles and stop them again if the player tries to start them again and when the strike is over finally start all vehicles again.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: NoGo - A Scriptable Game Framework

Post by XeryusTC »

Limit the amount people can terraform. Possibly separate limits for raising and lowering.
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
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoGo - A Scriptable Game Framework

Post by planetmaker »

Ability: Merge two company
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

planetmaker wrote:Ability: Merge two company
improving on that: buying/selling individual "lines" (all connected tiles with same owner/vehicle type, plus all vehicles)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoGo - A Scriptable Game Framework

Post by Kogut »

I like idea of pointless badges/minichallenges (sth like this: http://wiki.luukland.net/Quest_Manual ), so ability to display messages may be quite useful, maybe including messages with images provided by script. Also, ability to save data outside of the savegame may be useful (in tutorials and badge trackers).
Last edited by Kogut on 01 Dec 2011 21:33, edited 1 time in total.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Zuu wrote:I had the idea of a disaster: Strike.

The script would then stop all vehicles of a given vehicle type that belongs to one or several companies. The script will have to keep looping over all vehicles and stop them again if the player tries to start them again and when the strike is over finally start all vehicles again.
This can be funny with salary negotiations or at least a very basic resemblance of salary in the game :D.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 65 guests