- Joined
- Nov 30, 2007
- Messages
- 1,202
Tried to convert my trigger into it. It doesn't compile because of "gg_rct", globals from another trigger, udg_UDex_Enabled and stuff like that. Help? Undeclared variables in short.
JASS:
globals
string array PlayerColor
string array CityName
unit array City
integer array CityType
unit array CityController
endglobals
function Setup takes nothing returns boolean
local rect array citySpawn
local integer i
local integer j
local player p
local unit u
local real x
local real y
local boolean b1
local boolean b2
set udg_UDexEnabled = false
// Harvest Setup
set RESOURCE_STRING[0] = "Silver"
set RESOURCE_STRING[1] = "Copper"
set RESOURCE_STRING[2] = "Lumber"
set RESOURCE_STRING[3] = "Wheat"
set RESOURCE_STRING[4] = "Weaponry"
set RESOURCE_TYPE[0] = 'n00K'
set RESOURCE_TYPE[1] = 'n00E'
set RESOURCE_TYPE[2] = 'n00H'
set RESOURCE_TYPE[3] = 'n00F'
set i = 0
loop
exitwhen RESOURCE_TYPE[i] == null
set RESOURCE_MINING_TIME[i] = 10
set RESOURCE_PER_HIT[i] = 1
set i = i + 1
endloop
set RESOURCE_MAX_CARRY_WORKER = 10
// City Setup
set CityName[0] = "Sparta"
set CityName[1] = "Athens"
set CityName[2] = "Larissa"
set CityName[3] = "Thebes"
set citySpawn[0] = gg_rct_CITY000
set citySpawn[1] = gg_rct_CITY001
set citySpawn[2] = gg_rct_CITY002
set citySpawn[3] = gg_rct_CITY003
set CityType[0] = 'htow'
set i = 0
set p = Player(0) //PLAYER_NEUTRAL_AGGRESSIVE
if (udg_UDexEnabled == false) then
loop
exitwhen citySpawn[i] == null
set x = GetLocationX(GetRectCenter(citySpawn[i]))
set y = GetLocationY(GetRectCenter(citySpawn[i]))
set City[i] = CreateUnit(p, CityType[0], x, y, 0)
call RemoveRect(citySpawn[i])
set i = i + 1
endloop
endif
// Faction Setup
// Player Setup
set b1 = false // Remove Computers
set j = 'hpea' // Controller Unit Type
set i = 0
loop
exitwhen i > 11
if (udg_UDexEnabled == false) then
if (GetPlayerSlotState(Player(i)) != PLAYER_SLOT_STATE_EMPTY and GetPlayerController(Player(i)) != MAP_CONTROL_COMPUTER ) then
set CityController[i] = CreateUnit(Player(i), j, 0, 0, 0)
call ShowUnit(u, false)
elseif (GetPlayerController(Player(i)) == MAP_CONTROL_COMPUTER and b1 == false) then
set CityController[i] = CreateUnit(Player(i), j, 0, 0, 0)
call ShowUnit(u, false)
endif
endif
endloop
set u = null
set p = null
return false
endfunction
//===========================================================================
function InitTrig_Main_Setup takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerAddCondition(t, Condition( function Setup ) )
call DestroyTrigger(t)
set t = null
endfunction
JASS:
globals
string array RESOURCE_STRING
integer array RESOURCE_TYPE
integer array RESOURCE_MINING_TIME
integer array RESOURCE_MAX_CARRY_WORKER
integer array RESOURCE_MAX_CARRY_CARAVAN
integer array RESOURCE_PER_HIT
integer array ResourcePlayer
integer array ResourceCity
integer array WorkerGetHome
integer array WorkerGetWork
boolean array WorkerMining
endglobals
Last edited: