Another question about IsWithinTownInfluence. If I use AIStation.IsWithinTownInfluence, it works. But If I use AITile.IsWithinTownInfluence, I get an index IsWithinTownInfluence does not exist.
Is that a bug or am I using it wrong.
Area.Validate(AITile.IsWithinTownInfluence,current_town);
Thanks,
MarkS
IsWithinTownInfluence
Moderator: OpenTTD Developers
Re: NoAI Branch - An AI Framework
Well, it should work, so the most logic reason I can think up: are you using the latest binaries? As that function is added not too long ago, so please make sure you have the latest binary (r13418, http://nightly.openttd.org/noai/files/).reylas wrote:Another question about IsWithinTownInfluence. If I use AIStation.IsWithinTownInfluence, it works. But If I use AITile.IsWithinTownInfluence, I get an index IsWithinTownInfluence does not exist.
Is that a bug or am I using it wrong.
Area.Validate(AITile.IsWithinTownInfluence,current_town);
Thanks,
MarkS
The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoAI Branch - An AI Framework
Ok, that was it. I was using an old binary. I know where to check now, so I will check that first.TrueLight wrote:Well, it should work, so the most logic reason I can think up: are you using the latest binaries? As that function is added not too long ago, so please make sure you have the latest binary (r13418, http://nightly.openttd.org/noai/files/).reylas wrote:Another question about IsWithinTownInfluence. If I use AIStation.IsWithinTownInfluence, it works. But If I use AITile.IsWithinTownInfluence, I get an index IsWithinTownInfluence does not exist.
Is that a bug or am I using it wrong.
Area.Validate(AITile.IsWithinTownInfluence,current_town);
Thanks,
MarkS
Next question. Is it possible to copy a List from one variable to another? I am building two TownLists then running some Valuators on them. I noticed that except for one Valuator, they are the same. In order not to run my custom function more than once, I would like to run it on one list, then copy that list to another variable like this:
local Town1 = AITownList();
local Town2 = AITownList();
(some Valuators on Town1)
Town2 = Town1;
This fails with no error (openTTD just goes into la la land). I have tried both with and without the declaration of Town2. What am I doing wrong?
Thanks,
MarkS.
Re: NoAI Branch - An AI Framework
This may work (not tested)reylas wrote:
Next question. Is it possible to copy a List from one variable to another? I am building two TownLists then running some Valuators on them. I noticed that except for one Valuator, they are the same. In order not to run my custom function more than once, I would like to run it on one list, then copy that list to another variable like this:
local Town1 = AITownList();
local Town2 = AITownList();
(some Valuators on Town1)
Town2 = Town1;
This fails with no error (openTTD just goes into la la land). I have tried both with and without the declaration of Town2. What am I doing wrong?
Thanks,
MarkS.
Code: Select all
local oldlist = AITownList();
oldlist.Valuate(blah blah blah);
oldlist.keepValue(blah);
local newlist = AIList();
newlist.AddList(oldlist);
Who is online
Users browsing this forum: No registered users and 6 guests