Howdy,
Is there a way to valuate my list of stations to leave only MY stations?
Please advise,
Kev!
myList.valuate(AIStation.IsValidStation)
Moderator: OpenTTD Developers
myList.valuate(AIStation.IsValidStation)
I DO like a nice caboose...
Re: myList.valuate(AIStation.IsValidStation)
In fact your list of stations only includes your own stations. It is not even possible to (easily) obtain a list of opponent stations from the API.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: myList.valuate(AIStation.IsValidStation)
Hmm...
Perhaps I should define "my list of stations"?...Since I did not know how to get a list of my stations I did this...
I make a tilelist, add a rectangle around the town and valuate for IsRoadStationTile...this give me a list including other players stations? then I iterate and see if they are mine... using IsValidStaion...
I thought there must be an easier way, and so my question? Maybe I should ask how to get a list of my stations?
..other than keeping track of them as I build them?
Please advise,
Kev!
Perhaps I should define "my list of stations"?...Since I did not know how to get a list of my stations I did this...
I make a tilelist, add a rectangle around the town and valuate for IsRoadStationTile...this give me a list including other players stations? then I iterate and see if they are mine... using IsValidStaion...
I thought there must be an easier way, and so my question? Maybe I should ask how to get a list of my stations?
..other than keeping track of them as I build them?
Please advise,
Kev!
I DO like a nice caboose...
Re: myList.valuate(AIStation.IsValidStation)
http://noai.openttd.org/docs/trunk/clas ... nList.html
and for your 2nd question:
from your stations list, valuate it by owner and keep only your own company as :
stationlist=yourlistoftiles
stationlist.Valuate(AITile.IsStationTile);
stationlist.KeepValue(1); // keep only tiles with a station on it
stationslist.Valuate(AITile.GetOwner)
local me=AICompany.ResolveCompanyID(AICompany.COMPANY_SELF);
stationslist.KeepValue(me); // keep only your own stations
and for your 2nd question:
from your stations list, valuate it by owner and keep only your own company as :
stationlist=yourlistoftiles
stationlist.Valuate(AITile.IsStationTile);
stationlist.KeepValue(1); // keep only tiles with a station on it
stationslist.Valuate(AITile.GetOwner)
local me=AICompany.ResolveCompanyID(AICompany.COMPANY_SELF);
stationslist.KeepValue(me); // keep only your own stations
Last edited by krinn on 09 Jul 2011 23:51, edited 1 time in total.
Re: myList.valuate(AIStation.IsValidStation)
WOW!
I guess AIStationList would do the trick? and valuate on IsWithinTownInfluence...yeah...that's the ticket!
Sorry for the fuss, nothing to see here...heh...I'll just stop typing now?
Thanks,
Kev!
I guess AIStationList would do the trick? and valuate on IsWithinTownInfluence...yeah...that's the ticket!
Sorry for the fuss, nothing to see here...heh...I'll just stop typing now?
Thanks,
Kev!
I DO like a nice caboose...
Re: myList.valuate(AIStation.IsValidStation)
look here, i've done it for depot tiles (similar to you, but with depot, and this is easier this time than browsing depot list)
http://dev.openttdcoop.org/projects/ai- ... uilder.nut
look at line 175
http://dev.openttdcoop.org/projects/ai- ... uilder.nut
look at line 175
Re: myList.valuate(AIStation.IsValidStation)
Krinn!
You da man.
Thank you so much! I could not figure out the depots...that was gonna be my next question!
You read my mind...
Now to buy a bus, give some orders and send it off! Very exciting!
Thanks again,
Kev!
You da man.

You read my mind...
Now to buy a bus, give some orders and send it off! Very exciting!
Thanks again,
Kev!
I DO like a nice caboose...
Who is online
Users browsing this forum: No registered users and 10 guests