Re: Some API extension ideas
Posted: 23 Aug 2009 20:46
I didn't find functions to get/set name of stations. I wanted to get the generated station name to make vehicle group name. So this is another extension idea.
The place to talk about Transport Tycoon
https://www.tt-forums.net/
Look into Denver & Rio Grande source code. It renames it's stations. So does TransAI.Blustuff wrote:I didn't find functions to get/set name of stations. I wanted to get the generated station name to make vehicle group name. So this is another extension idea.
AIBaseStation is a superclass of AIStation. As such, all AIBaseStation functions (GetName/SetName/etc.) also work for AIStation.Blustuff wrote:I didn't find functions to get/set name of stations. I wanted to get the generated station name to make vehicle group name. So this is another extension idea.
It has been suggested before: http://bugs.openttd.org/task/2853ac84 wrote:Why the API does not have function like AIVehicle::SetServiceInterval(vehicle_id, days)?
It was never requested before, or there is another reason?
Hope name is clear and explain function's purpose.
The function would simply return false then. It's similar to company names.Lord Aro wrote:yeah but what about multiple instances running?
I think this would be nice. Yellow contrasts very nicely with the generally green color of the game. So it's nice for screenshots. It would be nice to be able to set the color and president details and even have a code for keeping the same face.Kogut wrote:I need function (probably it should be in AICompany) that change company colour (blue or yellow is better than pink).
I agree, but I "solve" it by hitting reload until the desired colour comes upDustin wrote:I think this would be nice. Yellow contrasts very nicely with the generally green color of the game. So it's nice for screenshots.
And the top of it - portraits/logo import, but, seems, it will be hardly possible.Dustin wrote:It would be nice to be able to set the color and president details and even have a code for keeping the same face
Nope they are not included. It doesnt even have a function for getting square roots. However in regards to the square root function other AIs have their own, so I guess you could search the net for some fancy replacement functions.Roujin wrote:EDIT: could it be that those are already included in squirrel? I feel kinda dumb...
A simple search would have found topics discussing the exact same idea.Roujin wrote:Okay, maybe it has already been discussed (and rejected? I hope not :/), but I'd really like to have some trigonometric functions.
Sin, cos, tan and their inverses...
Join #openttd.noai - the channel where TB doesnt roamRoujin wrote:I somehow don't feel motivated to continue on my AI right now though.
Getting banned like that from the irc channel hurt me.
Maybe I'm just too sensitive for this community.
I hardly believe he doesn't know. However, I still don't understand why there is no mathematical function. It isn't a matter of speed and I think Yexo told us "your AI don't need such functions". Actually they do.Roujin wrote:The problem was probably me assuming that TrueBrain knew the answer to my question, and was just being unhelpful. That was obviously wrong. I was wrong. Sorry.
I did say that and was wrong. That doesn't mean I'll include those functions in the API. A main reason against including those in the API still is that they are floating point calculations, which OpenTTD tries to avoid as much as possible (because the results are not guaranteed to be the same on each platform). The existing squirrel support for floating point numbers can't be removed because it's used by too many AIs, but that doesn't mean we should add more floating point functions.Blustuff wrote:It isn't a matter of speed and I think Yexo told us "your AI don't need such functions". Actually they do.