Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch -> GS + AI API Addition: OnHouseDestroyed #5390

Closed
DorpsGek opened this issue Dec 14, 2012 · 4 comments
Closed

Patch -> GS + AI API Addition: OnHouseDestroyed #5390

DorpsGek opened this issue Dec 14, 2012 · 4 comments
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

XFrankX opened the ticket and wrote:

This patch adds a functionality to the GameScript + AI engine called OnHouseDestroyed. It's triggered when some company destroys a house in a town.

A Forum thread has been created for this patch:

http://www.tt-forums.net/viewtopic.php?f=33&t=63629

The patch returns the ID of the company which destroyed a house, the ID of the town where the house got destroyed and the population of the house that got destroyed. This Function can be usefull in gamescripts when you want for example an anti-cheat / anti-troll function!

The Patch attached is for the latest TRUNK (14-12-2012).

Best regards,

Frank
Server Admin BTPro
http://openttd.btpro.nl

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5390
@DorpsGek
Copy link
Member Author

XFrankX wrote:

Oops, Attachment didn't come through...

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5390#comment11752

@DorpsGek
Copy link
Member Author

LordAro wrote:

1 issue i noticed:

- "script/api/game/game_event.hpp.sq" there is a strange line with some extra whitespace, which is odd, as that file is generated by a script. You did use squirrel_export.[sh|awk], right?


This comment was imported from FlySpray: https://bugs.openttd.org/task/5390#comment11793

@DorpsGek
Copy link
Member Author

Zuu wrote:

If you look at the existing Event classes, none of them include "On" in their name. Instead events in NoAI and NoGo only uses "Event" as prefix. Thus I suggest that your event is renamed to ScriptEventHouseDestroyed (instead of ScriptEventOnHouseDestroyed).

Also, guided by the design goal that AIs should have about the same information available as players, I would suggest that this event is only available to game scripts. To accomplish this you can look at for example script_goal.hpp and see how it uses "@api game" to make it GameScript only. Re-run squirrel_export.sh to re-generate the .sq files as LordAro suggested.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5390#comment11885

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Won't implement

Mass closure of patch tickets with no recent commentary. Goal is to reduce patch queue as an experiment to see if it aids faster reviewing and rejection/acceptance (it may not). If this offends you and the patch is maintained and compiles with current trunk, discuss with andythenorth in irc. (andythenorth has no ability to review patches but can re-open tickets). Thanks.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5390

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Goal/Game script patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
@frosch123 frosch123 added the component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) label Apr 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

2 participants