- Joined
- May 1, 2008
- Messages
- 1,605
Moin moin =)
Well I talked to ma friend "ap0calypse"
already, but at the end we decide, I should open a public thread, because something goes wrong here and we don't get -_-
[Possible it's so easy that we are just blind XD]
Fist of all pick this 2 triggers:
So at the first trigger, the camera doesn't pan to the x and y, but the rest works fine!
And the seconds trigger?.. Well read this;:
When I'm player 1 (RED), the unit is created at the startloc of player GREEN! or YELLOW!
When I'm player 2 (BLUE), the unit is created at the startloc of player PURPLE!
When I'm player 4 (PURPLE), the unit is created at the startloc of player PURPLE ( ... )
When I'm player 7 (PINK), it's created on startloc of player LIGHTBLUE
So you see, something is wrong here, but hell yeah what is it??
Hope someone can help me with this one.
Edit: ap0calypse notice already that I don't need in the init "exitwhen i == 15", but even when I change this to the correct value, bug still remains!
Greetings and Peace
Dr. Boom
Well I talked to ma friend "ap0calypse"

[Possible it's so easy that we are just blind XD]
Fist of all pick this 2 triggers:
JASS:
function Initialization takes nothing returns nothing
local integer i = 0
loop
exitwhen i == 9
if GetLocalPlayer() == Player(i) then
call PanCameraToTimed(GetStartLocationX(GetPlayerStartLocation(Player(i))),GetStartLocationY(GetPlayerStartLocation(Player(i))),0.)
call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,200)
endif
set i = i + 1
endloop
set udg_Hero[1] = 'H000'
set udg_Hero[2] = 'H001'
endfunction
// Init
function InitTrig_Initialization takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t,1.,false)
call TriggerAddAction(t,function Initialization)
set t = null
endfunction
JASS:
function HeroSelect takes nothing returns nothing
local real x = GetStartLocationX(GetPlayerStartLocation(GetOwningPlayer(GetTriggerUnit())))
local real y = GetStartLocationY(GetPlayerStartLocation(GetOwningPlayer(GetTriggerUnit())))
local string e = "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl"
if GetSpellAbilityId() == 'A000' then //up
set udg_HeroN[GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1] = udg_HeroN[GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1] + 1
if udg_HeroN[GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1] > 2 then // max reset
set udg_HeroN[GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1] = 1
endif
call CreateUnit(GetOwningPlayer(GetTriggerUnit()),udg_Hero[udg_HeroN[GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1]],x,y,270.)
call DestroyEffect(AddSpecialEffect(e,x,y))
endif
endfunction
//===========================================================================
function InitTrig_HeroSelect takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i == 15
call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set i = i + 1
endloop
call TriggerAddAction(t,function HeroSelect)
set t = null
endfunction
So at the first trigger, the camera doesn't pan to the x and y, but the rest works fine!
And the seconds trigger?.. Well read this;:
When I'm player 1 (RED), the unit is created at the startloc of player GREEN! or YELLOW!
When I'm player 2 (BLUE), the unit is created at the startloc of player PURPLE!
When I'm player 4 (PURPLE), the unit is created at the startloc of player PURPLE ( ... )
When I'm player 7 (PINK), it's created on startloc of player LIGHTBLUE
So you see, something is wrong here, but hell yeah what is it??

Hope someone can help me with this one.
Edit: ap0calypse notice already that I don't need in the init "exitwhen i == 15", but even when I change this to the correct value, bug still remains!
Greetings and Peace
Dr. Boom