• 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] Pathing Help

Status
Not open for further replies.
Level 6
Joined
Mar 20, 2008
Messages
208
Alright, basic idea:

Player is not located as playing, set the pathing to the units below it.

HelpReals = Calculated static region centers

JASS:
function msKillYellow takes nothing returns nothing
 call TriggerRegisterEnterRectSimple(gg_trg_Yellows_Base,  gg_rct_Path_Spot_5)
//suppose to add a unit entering the pathing spot 5 to Pinks Base trigger
//so it runs both actions

 set udg_HelpReals[17] = udg_HelpReals[3]
      //moves original pathing X coord to the new X coordinate
      //IE: Pinks Base X coordinate to PS5's X coordinate
 set udg_HelpReals[18] = udg_HelpReals[8]
     //Y coordinate
endfunction

Now, I can get the units to go to the right spot, the problem is I can't get them to move their second spot.

JASS:
function P5A takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(u)
 
    if (p == Player(10)) then
       call IssuePointOrder( u, "attack", udg_HelpReals[13], udg_HelpReals[14])
    elseif(p == Player(11)) then
       call IssuePointOrder( u, "attack", udg_HelpReals[19], udg_HelpReals[20])
    endif

    set p = null
    set u = null
endfunction

//===========================================================================
function InitTrig_Path_5 takes nothing returns nothing
    set gg_trg_Path_5 = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Path_5, gg_rct_Path_Spot_5 )
    call TriggerAddAction( gg_trg_Path_5, function P5A )
endfunction

JASS:
function YBA takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(u)
    
    call DisplayTextToPlayer(Player(0),0,0,"yellows base found") 

    if (p == Player(7)) then
       call IssuePointOrder( u, "attack", udg_HelpReals[15], udg_HelpReals[16])
    elseif(p == Player(11)) then
       call IssuePointOrder( u, "attack", udg_HelpReals[19], udg_HelpReals[20])
    endif

    set p = null
    set u = null
endfunction

//===========================================================================
function InitTrig_Yellows_Base takes nothing returns nothing
    set gg_trg_Yellows_Base = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Yellows_Base, gg_rct_Yellows_Base )
    call TriggerAddAction( gg_trg_Yellows_Base, function YBA )
endfunction

The logic that I am using is that if I register a unit entering Pathing Spot 5 under Yellow's Base Trigger, when a unit enters Pathing spot 5, both triggers should run.

Anyway, any insight or help would be appreciated.
 
Status
Not open for further replies.
Top