xander wrote:Ace Rimmer wrote:SetActionTartget
Is that the command for fetching little cakey things?
xander
Apparently I was hungry and Defcon doesn't have access to food.
Moderator: Defcon moderators
Code: Select all
function CitySurvey()
StartLongTask(function()
SendChat("Starting City Survey")
local allCities = GetCityIDs()
myCities = GetCityIDs()
enemyCities = GetCityIDs()
local us = GetOwnTeamID()
for i, city in ipairs(allCities) do
local long, lat, pop = city:GetLongitude(), city:GetLatitude(), city:GetCityPopulation()
if city:GetTeamID() == us then
DrawWhiteboardSquare(long, lat, pop / 3000000)
table.insert(myCities, city)
else
DrawWhiteboardCross(long, lat, pop / 3000000)
table.insert(enemyCities, city)
end
YieldLongTask()
end
SendChat("City Survey Complete")
end)
end
Code: Select all
myCities = GetCityIDs()
enemyCities = GetCityIDs()
Code: Select all
1v1Combo = {<have combos listed>}
local myCity1 = <find my territory>
local yourCity1 = <find your territory>
local MatchUp = mycity1yourCity1
function(which placement style to pick) = 1v1Combo(MatchUP)
Code: Select all
if myCity1 = NorthAmerica and yourCity1 = Europe then
NAvsEU()
elseif <all 30 combos>
end
Code: Select all
int Matchup #in C, switch statements operate on ints
switch (Matchup)
{
case 0: NAvsSA(); break; #places units when AI is NA and the other player is SA
case 1: NAvsEU(); break;
case 2: NAvsRU(); break;
...
case 30: AFvsAS(); break;
}
Code: Select all
function foo(n)
{
return n*2;
}
bar = foo;
bar(2); //returns 4
Code: Select all
local x = math.random(-95, -80)
local y = math.random(44, 54)
if (IsValidPlacementLocation (x, y, "Silo")) then
PlaceStructure (x, y, "Silo")
end
units = GetAllUnits()
YieldLongTask()
local us = GetOwnTeamID()
for i, unit in ipairs(units) do
if unit:GetTeamID() == GetOwnTeamID() then
if unit:GetUnitType() == "Silo" then
table.insert(siLos, unit)
end
end
YieldLongTask()
end
S1=siLos[1]
a = S1:GetLongitude() <------- error is here 'attempt to index global (or local) '51' a nil value
b = S1:GetLatitude()
while GetRemainingUnits("Silo") > 0 do
while true do
if (IsValidPlacementLocation (a, b, "Silo")) then
PlaceStructure (a, b, "Silo")
break
end
end
YieldLongTask()
a = a +4
b = b-3
end
Users browsing this forum: No registered users and 15 guests