LearningCode
New Member
- Reaction score
- 24
I'm trying to convert this TD map I have from GUI to JASS because I think it may make it faster =P
Even if it does not make it faster, I would have learned heaps from it.
And here is my first block:
The trigger is supposed to:
1) Create a 'Worker' for each Player in the map that has its slot filled with a Controller (Not bothering about CPU or Human for now)
2) Select the Created 'Worker' for the Player
But the JASS compiler (Is it called that? I'm using NewGen 1.5d, I think) says that there is a syntax error here:
And I understand why, I can't set an integer value to a force, right?
So.. how do I go about this?
Even if it does not make it faster, I would have learned heaps from it.
And here is my first block:
JASS:
function creation takes nothing returns nothing
local integer a
local force b
local location c
loop
exitwhen (a>8)
set force b=a
if (GetPlayerSlotState( b == PLAYER_SLOT_STATE_PLAYING ) then
set location c=GetPlayerStartLocationLoc(b)
call CreateNUnitsAtLoc(1, 039;e008039;, b, c, bj_UNIT_FACING)
call SelectUnitForPlayerSingle(GetLastCreatedUnit(), b)
set location c= null
endif
set force b= null
set integer a=a+1
endloop
endfunction
function CreateBuilder takes nothing returns nothing
local trigger t
set t= CreateTrigger()
call TriggerAddAction(t, (function creation))
endfunction
The trigger is supposed to:
1) Create a 'Worker' for each Player in the map that has its slot filled with a Controller (Not bothering about CPU or Human for now)
2) Select the Created 'Worker' for the Player
But the JASS compiler (Is it called that? I'm using NewGen 1.5d, I think) says that there is a syntax error here:
JASS:
set force b=a
And I understand why, I can't set an integer value to a force, right?
So.. how do I go about this?