• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Player Startlocation [bug?]

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Well I talked to ma friend "ap0calypse" :goblin_yeah: 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:

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?? :goblin_boom:

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
 
Level 13
Joined
Sep 13, 2010
Messages
550
Have you ticked it?
attachment.php


Btw I think call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,200) should not be called locally.
 

Attachments

  • Tick.JPG
    Tick.JPG
    46.6 KB · Views: 183
Level 16
Joined
May 1, 2008
Messages
1,605
Well, ap0calypse you have read this??? Omg well I ticked it and now it does work ....

WHAT THE F**K, that something that simple can ruin it is really annoying, but this explains a lot of problems I had ... =O

Well and the other thing works well, no problem here =)

Greetings ~ Thanks for help ~ Peace
Dr. Boom
 
Status
Not open for further replies.
Top