NoGo - A Scriptable Game Framework - v1.5
Moderator: OpenTTD Developers
Re: NoGo - A Scriptable Game Framework - v1.1
I had a crash. I attached the crash.* files. The crash occured when I tried to clone a train with shared orders.
- Attachments
-
- crash.zip
- (385.68 KiB) Downloaded 72 times
Re: NoGo - A Scriptable Game Framework - v1.1
I'll wait on Truebrain opinion. If it's a bug I gladly write a simple GS example.Kogut wrote:Probably it is not a bug as AIIndustry::GetLastMonthTransported and value visible for humans in industry details window is single variable for industry, without separate data for companies.
Re: NoGo - A Scriptable Game Framework - v1.1
Basic rule of thumb: if a human can see it, so can an AI/GS. In the same way and method. Same holds for here. The production and amount transported is per Industry, not per company/industry. So yeah, not a bug.
That said, I can see why you would want to know this information per company, but atm it is not possible. Guess it should go on my wish-list. Not sure if it is something we would really want you to want
That said, I can see why you would want to know this information per company, but atm it is not possible. Guess it should go on my wish-list. Not sure if it is something we would really want you to want

The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoGo - A Scriptable Game Framework - v1.1
Bug in trunk. Will be fixed in next NoGo sync (tomorrow-ish).macee wrote:I had a crash. I attached the crash.* files. The crash occured when I tried to clone a train with shared orders.
The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoGo - A Scriptable Game Framework - v1.1
Probably the same for me, see attachments. A shame, it looked like it would be fun but I didn't even get to grow a city once before crashing 
Other than that there were two things that struck me:
- the error says the generated file(s) are in c:\users\(etc) , but since my Windows is localised, it is not. Not NoGo related but... still.
- the line with "xx city xx" underneath the city name, sometimes is too close to the city name: in the screenshot there's not even a row between them.

Other than that there were two things that struck me:
- the error says the generated file(s) are in c:\users\(etc) , but since my Windows is localised, it is not. Not NoGo related but... still.
- the line with "xx city xx" underneath the city name, sometimes is too close to the city name: in the screenshot there's not even a row between them.
Re: NoGo - A Scriptable Game Framework - v1.1
They are, actually. The name translation is a special Explorer thingy that doesn't change the file/folder names on disk. If you simply paste "C:\Users" into the explorer address bar or the text field in the start menu it will open the proper folder.bokkie wrote:the error says the generated file(s) are in c:\users\(etc) , but since my Windows is localised, it is not. Not NoGo related but... still.
-- Michael Lutz
Re: NoGo - A Scriptable Game Framework - v1.1
Cloning with shared orders is a trunk bug yes.bokkie wrote:Probably the same for me, see attachments. A shame, it looked like it would be fun but I didn't even get to grow a city once before crashing
Other than that there were two things that struck me:
- the error says the generated file(s) are in c:\users\(etc) , but since my Windows is localised, it is not. Not NoGo related but... still.
- the line with "xx city xx" underneath the city name, sometimes is too close to the city name: in the screenshot there's not even a row between them.
I have no clue what you mean with the last one. "a row between them". I have no clue what you mean. If you mean that when zooming out the town sign and a sign on the exact same tile as the town center creep closer and closer together, yes, that is how signs work in general


The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoGo - A Scriptable Game Framework - v1.1
Apparantly, I'm not clear
. How do you call it... spacing? padding? It looks odd because both lines of text touch each other. Usually, there's at least a line (row) of pixels between.
(Dutch is easier
)

(Dutch is easier

Re: NoGo - A Scriptable Game Framework - v1.1
Well, if that is what you meant, I already repliedbokkie wrote:Apparantly, I'm not clear. How do you call it... spacing? padding? It looks odd because both lines of text touch each other. Usually, there's at least a line (row) of pixels between.
(Dutch is easier)


The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoGo - A Scriptable Game Framework - v1.2
New Release (1.3). Big changelog (well, not in size, but in patch-size):
- Added a info.nut setting called: IsDeveloperOnly. When defined, and returning true, the GS will only show up in the GUI when the AI Developers tool is active. Loading a saved game with a GS will always load the GS, whatever this flag returns.
- Added lots of small fixes and stability issues.
- Updated to latest trunk.
- With great help from mostly Rubidium: translation support.
To talk a bit about the last entry:
If your GS now has a directory called 'lang', in which you put a file 'english.txt', in the same format as OpenTTD's language files (STR_YOURNAME :<a string>), you can now allow translation of such strings, even over the network. For example, if you make a file 'dutch.txt', which has the same STR_YOURNAME entry, but with a different translation, it will show the translation on clients that selected dutch, and english for all the others.
To use this string in your GS, you have to use GSText. It is pretty documented, but to give you a small summary: GSTown.SetText(0, GSText(STR_YOURNAME)).
I enabled it for most functions that accept 'const char *', now called 'Text *'. Let me know if I forgot one you think should have it.
Translations are saved in the savegame, so if you load the savegame without the GS, you still see all translated stuff.
Bugs, problems. Let me know. The promised GUI with buttons like yes/no/cancel/etc got sidetracked because of translation stuff. Will do that tomorrow, and hopefully finish it
PS: there is no 1.2. I f*** up a tag, and had to skip a version
- Added a info.nut setting called: IsDeveloperOnly. When defined, and returning true, the GS will only show up in the GUI when the AI Developers tool is active. Loading a saved game with a GS will always load the GS, whatever this flag returns.
- Added lots of small fixes and stability issues.
- Updated to latest trunk.
- With great help from mostly Rubidium: translation support.
To talk a bit about the last entry:
If your GS now has a directory called 'lang', in which you put a file 'english.txt', in the same format as OpenTTD's language files (STR_YOURNAME :<a string>), you can now allow translation of such strings, even over the network. For example, if you make a file 'dutch.txt', which has the same STR_YOURNAME entry, but with a different translation, it will show the translation on clients that selected dutch, and english for all the others.
To use this string in your GS, you have to use GSText. It is pretty documented, but to give you a small summary: GSTown.SetText(0, GSText(STR_YOURNAME)).
I enabled it for most functions that accept 'const char *', now called 'Text *'. Let me know if I forgot one you think should have it.
Translations are saved in the savegame, so if you load the savegame without the GS, you still see all translated stuff.
Bugs, problems. Let me know. The promised GUI with buttons like yes/no/cancel/etc got sidetracked because of translation stuff. Will do that tomorrow, and hopefully finish it

PS: there is no 1.2. I f*** up a tag, and had to skip a version

The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoGo - A Scriptable Game Framework - v1.3
When starting a new game I had OpenTTD crash on me. It is possible that there is a bug in my GS code as I did some coding before starting OpenTTD to test my GS code.
- Attachments
-
- crash.dmp
- (1.4 MiB) Downloaded 67 times
-
- crash.png (12.12 KiB) Viewed 876 times
-
- crash.log.txt
- (10.31 KiB) Downloaded 93 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: NoGo - A Scriptable Game Framework - v1.3
By setting AI count to zero, I can postpone the crash to after the world has been generated, but it still happens and with a similar stack trace (looks the same, but have not verified it).
Edit: Sorry, the world generation was not done. It was at step 57 / 96 in town generation. Or at least that is what was displayed in the GUI at the time when the crash happened.
Edit: Sorry, the world generation was not done. It was at step 57 / 96 in town generation. Or at least that is what was displayed in the GUI at the time when the crash happened.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: NoGo - A Scriptable Game Framework - v1.3
Another update (1.4):
- Fixes crash when no language files are available
- Fixes crash when going back to the main menu (under almost all conditions)
- Many coding style fixes, small bugs, typos, ...
- Fixes crash when no language files are available
- Fixes crash when going back to the main menu (under almost all conditions)
- Many coding style fixes, small bugs, typos, ...
The only thing necessary for the triumph of evil is for good men to do nothing.
- MinchinWeb
- Traffic Manager
- Posts: 225
- Joined: 01 Feb 2011 12:41
- Contact:
Re: NoGo - A Scriptable Game Framework - v1.4
I'm trying to get my Road Pathfinder to work, however, if seems to be hung up on GSTile.IsBuildable(next_tile). The function requires, as a precondition (as noted here), that a company is in scope, however, I'm trying to build as the 'game', so no company is in scope.
Is there a way around the precondition, or could the condition be removed (does 'build-ability' change depending on what company is in scope?), or an alternate function be provided when trying to build as the 'game'?
As well, when trying to build roads as the 'game,' I don't seem to be able to build bridges...feature or bug? I haven't tried, but I imagine tunnels work the same way.
Is there a way around the precondition, or could the condition be removed (does 'build-ability' change depending on what company is in scope?), or an alternate function be provided when trying to build as the 'game'?
As well, when trying to build roads as the 'game,' I don't seem to be able to build bridges...feature or bug? I haven't tried, but I imagine tunnels work the same way.
Last edited by MinchinWeb on 19 Dec 2011 05:59, edited 1 time in total.
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
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
Re: NoGo - A Scriptable Game Framework - v1.4
You have to look at this the other way around. I blocked all functions from being able to build anything as GameScript owner, with a small list that form the exceptions. Atm this is only BuildRoad. We will have to look function by function if it should be opened more. Basically, the API is too big for me to oversee all functions and possibilities. For that I have you guys 
So best is, instead of wondering if it is a bug or anything, just ask yourself: would it be fair if a GameScript can build this free of charge. And just let me know what you think should be opened. I will review them and let you know
In this case, IsBuildable, Build(Road)Bridge and Build(Road)Tunnel are no problem, and should indeed be opened up. For 1.5
If you find others, please do let me know

So best is, instead of wondering if it is a bug or anything, just ask yourself: would it be fair if a GameScript can build this free of charge. And just let me know what you think should be opened. I will review them and let you know

In this case, IsBuildable, Build(Road)Bridge and Build(Road)Tunnel are no problem, and should indeed be opened up. For 1.5

If you find others, please do let me know

The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoGo - A Scriptable Game Framework - v1.4
everything that's possible in the scenario editor is a good hint. i.e. placing/removing road (bridges, tunnels), founding towns (possibly removing towns? that may be tricky with all the references), terraforming, placing objects.
- MinchinWeb
- Traffic Manager
- Posts: 225
- Joined: 01 Feb 2011 12:41
- Contact:
Re: NoGo - A Scriptable Game Framework - v1.4
Ok, I put my thinking cap on, and the functions I need/would like right now are:TrueBrain wrote:You have to look at this the other way around. I blocked all functions from being able to build anything as GameScript owner, with a small list that form the exceptions. Atm this is only BuildRoad. We will have to look function by function if it should be opened more. Basically, the API is too big for me to oversee all functions and possibilities. For that I have you guys
So best is, instead of wondering if it is a bug or anything, just ask yourself: would it be fair if a GameScript can build this free of charge. And just let me know what you think should be opened. I will review them and let you know
My Wish List:
- GSRoad.BuildRoad
GSRoad.BuildOneWayRoad
GSRoad.BuildRoadFull
GSRoad.BuildOneWayRoadFull
GSRoad.RemoveRoad
GSRoad.RemoveRoadFull
GSBridge.BuildBridge
GSBridge.RemoveBridge
GSTunnel.BuildTunnel
GSTunnel.RemoveTunnel
GSTile.IsBuildable
GSTile.IsBuildableRectangle

As a thought exercise:
A reasonable expansion might be canals. Then the following functions would make the list. Again, maybe removals should be restricted to non-owned or town-owned canals.
- GSMarine.BuildBuoy
GSMarine.BuildLock
GSMarine.BuildCanal
GSMarine.RemoveBuoy
GSMarine.RemoveLock
GSMarine.RemoveCanal
This is probably reasonable. With this power you could turn a GameScript into a sort of dynamic scenario maker and manager. The additional functions involved:Eddi wrote:everything that's possible in the scenario editor is a good hint. i.e. placing/removing road (bridges, tunnels), founding towns (possibly removing towns? that may be tricky with all the references), terraforming, placing objects.
- GSIndustryType.BuildIndustry
GSIndustryType.ProspectIndustry
GSTile.RaiseTile
GSTile.LowerTile
GSTile.LevelTile
GSTile.DemolishTile
GSTile.PlantTree
GSTile.PlantTreeRectangle
DemolishTile would be a lot of power. I think a good way to counterbalance most abuses would be to only allow destruction of non-owned and town-owned squares without explicitly moving to an active company mode. It would be handy too if this function (or one like it) could be used to remove industries too.
The other functions that the scenario manager would be that a GameScript wouldn't at this point would be the ability to found a town or directly set industry production levels.
Other (useful?) functions:
Other additions to the GameScript framework that might be useful is the ability to deny the player to do certain actions. For example, when running the train section of the tutorial, they can only build trains. Or to restrict a player to certain regions of the map: in the tutorial you could force them to build a station where it will gather/accept cargo or maybe in a head-to-head situation (one player can only build on one side of the map).
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
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
Re: NoGo - A Scriptable Game Framework - v1.4
Ah! Useful list
Tnx 
Oneway road I considered, but dismissed. It is not something for a GS to build as super-user in my opinion. Feel free to convince me otherwise with a clear usecase
BuildBridge / BuildTunnel (for road) is done, will be in next update.
Marine stuff ... I need to think about that for a bit
Tile manipulation sounds like a good idea too yeah, will see what I can do.
Industry: I can see the pros/cons. Have to think about it a bit
Trees: ugh, we already have enough trees in the game as it is


Oneway road I considered, but dismissed. It is not something for a GS to build as super-user in my opinion. Feel free to convince me otherwise with a clear usecase

BuildBridge / BuildTunnel (for road) is done, will be in next update.
Marine stuff ... I need to think about that for a bit

Tile manipulation sounds like a good idea too yeah, will see what I can do.
Industry: I can see the pros/cons. Have to think about it a bit

Trees: ugh, we already have enough trees in the game as it is

The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoGo - A Scriptable Game Framework - v1.4
I bring you a new update: 1.5.
Changelog:
- Add: BuildBridge / BuildTunnel for GS
- Add: disable highlight of widget you click on, when it is being highlighted
- Fix: many small fixes and bugs.
- Fix: document WindowClass much better
- Fix: make sure WindowNumber in a WindowClass is unique, and it links to a single Widget array
Most likely more I forgot about.
PS: I committed NoGo to trunk
1.5 will be last custom build, tomorrow night you can just download the latest nightly.
Changelog:
- Add: BuildBridge / BuildTunnel for GS
- Add: disable highlight of widget you click on, when it is being highlighted
- Fix: many small fixes and bugs.
- Fix: document WindowClass much better
- Fix: make sure WindowNumber in a WindowClass is unique, and it links to a single Widget array
Most likely more I forgot about.
PS: I committed NoGo to trunk

The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoGo - A Scriptable Game Framework - v1.5
NICE!
Not too much of a surprise but somehow you were a bit careful yourself
Not too much of a surprise but somehow you were a bit careful yourself

Who is online
Users browsing this forum: No registered users and 13 guests