• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Rally Points and Unit Orders

Status
Not open for further replies.
Level 6
Joined
Jul 2, 2008
Messages
156
Okay, I've recently started learning JASS, and I'm getting the hang of it pretty quick.

However, one problem continues to persist when attempting to redo my triggers to JASS.

I keep getting an error "expected set", when I'm providing the function call with what should be the correct arguments.

JASS:
function Tower_Conversion_Action takes unit u, unit t, location p returns nothing
    call TriggerSleepAction( 2 )
    call SetUnitOwner( u, GetOwningPlayer(t), true )
    call TriggerSleepAction( 0.20 )
    call ReplaceUnitBJ( u, 'n000', bj_UNIT_STATE_METHOD_RELATIVE )
    u= GetLastReplacedUnitBJ()
    call IssuePointOrderLocBJ( u, "move", GetUnitRallyPoint(t) )
    call CreateTextTagUnitBJ( "|cffff0000Villager Zombified!|r", u, 0, 8.00, 100, 100, 100, 0 )
    call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 64, 90 )
    call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
    call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
    
endfunction

To clarify, u is the target of my spell, t is the casting unit.
The issue is getting u to move to t's rally point.

The problem is with the call IssuePointOrderLocBJ.
I've searched many JASS forums for alternatives, or anyone with a similar problem.
I've also searched many JASS forums for any JASS code regarding rally points, but have found none. (I would rather use IssuePointOrder, but cannot due to the rally point problems).

Appreciate any help! :sad:
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

If I mind correct, I heard that the "Bj" function are from Blizzard - and sometimes bull++++

Why you can't use just "IssuePointOrderLoc"("Unit", "Order", "Loc") ?

And by the way - you should use the Jass NewGen editor if you are learning Jass.

He marks lines with red - if there are a better solution (like this Bj functions)
 
Level 6
Joined
Jul 2, 2008
Messages
156
Isn't rally points the points created by buildings whre the units trained go to after finishing the training????? why would your casting unit have a rally point?

anyway, Thunder_eye is right.. you should put a set before the u

Play my game Shadow Wars, you'll understand.
Thanks so much with the set thing!
And I did improve my code to avoid BJs this time around (I heard using X, Y is more efficient anyways)

New code:

JASS:
function GetRallyX takes unit t returns real
    local real x= GetLocationX( GetUnitRallyPoint(t) )
    return x
endfunction

function GetRallyY takes unit t returns real
    local real y= GetLocationY( GetUnitRallyPoint(t) )
    return y
endfunction

function Tower_Conversion_Action takes unit u, unit t returns nothing
    call TriggerSleepAction( 2 )
    call SetUnitOwner( u, GetOwningPlayer(t), true )
    call TriggerSleepAction( 0.20 )
    call ReplaceUnitBJ( u, 'n000', bj_UNIT_STATE_METHOD_RELATIVE )
    set u= GetLastReplacedUnitBJ()
    call IssuePointOrder( u, "move", GetRallyX(t), GetRallyY(t) )
    call CreateTextTagUnitBJ( "|cffff0000Villager Zombified!|r", u, 0, 8.00, 100, 100, 100, 0 )
    call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 64, 90 )
    call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
    call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
endfunction
 
Last edited:
Status
Not open for further replies.
Top