XeNiM666
I lurk for pizza
- Reaction score
- 138
Hello. Been busy making my map lately.... XD
Im almost finished with it, the only problem is with the hero selection system.
I made this trigger:
Somehow I dont see any problems with it. But when I hit test map I returns to the warcraft main screen. When I disable the trigger, everything fine... I feel like such a noob.. XD
Thanks in advance...
Im almost finished with it, the only problem is with the hero selection system.
I made this trigger:
JASS:
scope HeroPick initializer onInit
globals
boolean array PStatus
force G = CreateForce()
group HG = CreateGroup()
rect array R
integer array HeroType
unit array HeroSelected
camerasetup array Cam
endglobals
private function InitCam takes nothing returns nothing
local integer i = 0
set Cam[ 1 ] = gg_cam_SelectCam1
set Cam[ 2 ] = gg_cam_SelectCam2
set Cam[ 3 ] = gg_cam_SelectCam3
set Cam[ 4 ] = gg_cam_SelectCam4
set Cam[ 5 ] = gg_cam_SelectCam5
set Cam[ 6 ] = gg_cam_SelectCam6
set Cam[ 7 ] = gg_cam_SelectCam7
set Cam[ 8 ] = gg_cam_SelectCam8
loop
call CameraSetupApplyForPlayer( true, Cam[ i + 1 ], Player( i ), 0.00 )
set i = i + 1
exitwhen i > 8
endloop
endfunction
private function HG_Actions takes nothing returns nothing
local unit u = GetEnumUnit()
call UnitRemoveAbility( u, 039;Amov039; )
call UnitRemoveAbility( u, 039;Aatk039; )
call UnitAddAbility( u, 039;A00Y039; )
call UnitAddAbility( u, 039;A00Z039; )
call UnitModifySkillPoints( u, 0 )
call SetUnitInvulnerable( u, true )
set u = null
endfunction
private function InitHero takes nothing returns nothing
local integer i = 0
set R[ 1 ] = gg_rct_SelectHero1
set R[ 2 ] = gg_rct_SelectHero2
set R[ 3 ] = gg_rct_SelectHero3
set R[ 4 ] = gg_rct_SelectHero4
set R[ 5 ] = gg_rct_SelectHero5
set R[ 6 ] = gg_rct_SelectHero6
set R[ 7 ] = gg_rct_SelectHero7
set R[ 8 ] = gg_rct_SelectHero8
set HeroType[ 1 ] = 039;H00A039;
set HeroType[ 2 ] = 039;H004039;
set HeroType[ 3 ] = 039;H001039;
loop
if PStatus[ i + 1 ] == false and GetPlayerController( Player( i ) ) == MAP_CONTROL_USER then
call ClearSelectionForPlayer( Player( i ) )
set HeroSelected[ i + 1 ] = CreateUnit( Player( i ), HeroType[ 1 ], GetRectCenterX( R[ i + 1 ] ), GetRectCenterY( R[ i + 1 ] ), 270.00 )
call GroupAddUnit( HG, HeroSelected[ i + 1 ] )
call SelectUnitForPlayerSingle( HeroSelected[ i + 1 ], Player( i ) )
endif
set i = i + 1
exitwhen i > 8
endloop
call ForGroup( HG, function HG_Actions )
endfunction
private function onInit takes nothing returns nothing
local integer i = 0
loop
call ForceAddPlayer( G, Player( i ) )
if GetPlayerSlotState( Player( i ) ) == PLAYER_SLOT_STATE_PLAYING then
set PStatus[ i + 1 ] = true
set PStatus[ i + 9 ] = true
endif
set i = i + 1
exitwhen i > 8
endloop
call InitHero()
call InitCam()
endfunction
endscope
Somehow I dont see any problems with it. But when I hit test map I returns to the warcraft main screen. When I disable the trigger, everything fine... I feel like such a noob.. XD
Thanks in advance...