Page 1 of 1

Building roads and TestMode

Posted: 12 Feb 2010 05:58
by SummerBulb
Hi.

New to AIs.

If i want to build a road, using pathfinder.
Lets say the function that builds the road is called BuildRD();
I there a way, using TestMode, to check how much the whole thing will cost me (without building the road, of course)?

I can set the TestMode and check if the build was successful. But hoe do i get the cost?

Thanks,
Bulb.

Re: Building roads and TestMode

Posted: 12 Feb 2010 09:33
by Morloth
Hi SummerBulb,

You can use the following code:

Code: Select all

local bla = AITestMode();
local accounts = AIAccounting();

BuildRD();

local totalCost = accounts.GetCosts();
Good luck with your AI! :)
Bram