retupmoc258
New Member
- Reaction score
- 1
So this is what I have and for some reason when I save this the Jasshelper says "Expected returns" Why does my function need to return something? I just intend for a trigger to use call this function and give it the information it wants used and then go to work spawning creatures according to what it gave it.
JASS:
function SpawnFunc takes rect WhichRect integer MinSpawnRange integer MaxSpawnRange integer MinSpawnNum returns nothing
local group SpawnGroup = CreateGroup()
local integer SpawnInt
set HeroTot = 0
set EnemyTot = 0
set SpawnGroup = GetUnitsInRectAll(WhichRect)
call ForGroup(SpawnGroup, function OwnerIsPlayerOneGroup )
call DestroyGroup(SpawnGroup)
if ( HeroTot >= 1 ) then
return
endif
// Spawn Trigger Here
if ( EnemyTot <= MinSpawnNum ) then
set bj_forLoopAIndex = ( EnemyTot + 1 )
set bj_forLoopAIndexEnd = ( MinSpawnNum + 2 )
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set SpawnInt = GetRandomInt(MinSpawnRange, MaxSpawnRange)
call CreateNUnitsAtLoc( 1, udg_Monster_UnitType[SpawnInt], Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(WhichRect), GetRandomDirectionDeg() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "patrol", GetRandomLocInRect(WhichRect) )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
else
return
endif
endfunction