Assualter active skill problems - JASS

RocKNRolL

New Member
Reaction score
0
description: [Basic] Active the skill from a far distance casuing the unit to run *2 faster toward the targeted unit, when reached 200 meters the unit teleports 100 meter (let say..) back facing the enemy at the other side causing damage to the unit.

ok, so i've started with Firebolt (I don't know why :S) and made it complitly empty skill, and made everything with jass.

JASS:

function Trig_Assaulter_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit tu = GetSpellTargetUnit()
    local real dist = DistanceBetweenPoints(GetUnitLoc(tu), GetUnitLoc(u))
    local real uspeed = GetUnitDefaultMoveSpeed(u)
    local effect ef1 = AddSpecialEffectLocBJ( GetUnitLoc(u),"Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
    call IssueTargetOrder( u, "move", tu )
    call SetUnitMoveSpeed( u, uspeed*2.0)
    //call DisplayTextToForce( GetPlayersAll(), "Unit move speed equal to: " + R2S(uspeed*2.0) )

    loop 
       exitwhen dist <= 200.0
         //call DisplayTextToForce( GetPlayersAll(), "In loop." )
         set dist = DistanceBetweenPoints(GetUnitLoc(tu), GetUnitLoc(u))
         call TriggerSleepAction( 1 )
        // call DisplayTextToForce( GetPlayersAll(), "Dist equal - " + R2S(dist) )
    endloop

    call SetUnitMoveSpeed( u, uspeed)
    //call DisplayTextToForce( GetPlayersAll(), "out of loop." )
    call SetUnitPositionLoc( ??? )
    set ef1 = AddSpecialEffectTargetUnitBJ( "origin",tu, "Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodFootman.mdl" )
    call DestroyEffectBJ( ef1 )

endfunction


// = are checking points for me..
call SetUnitPositionLoc( ??? ) - i have no idea how to get the unit to the exact coordinates i want (100 meter back facing after the enemy).
Main problem: the function DistanceBetweenPoints(Loc A, Loc B) is not working right!
Test i did: The unit runs to the target after activating, it reaches to the enemy, and distance is like 500 or 400! how can that be? and if theres another way to do that using different function.

Thank you in advance.

Edit:
Ok i got the DistanceBetweenPoints(Loc A, Loc B) problem i had, i clearly thought 200 meters has to be alot in the game when 200 meters is almost next to the opponent.
So the only problem is: how can i tell the unit teleport 100 meter back facing after the enemy?!
 

Sevion

The DIY Ninja
Reaction score
413
Meters? I think you mean WC3 Distance Units. 200 in WC3 is like:

..........................
 

RocKNRolL

New Member
Reaction score
0
Never mind that.
My only question is how do i tell the unit to teleport some point after the enemy when her back facing the enemy.
 

Sevion

The DIY Ninja
Reaction score
413
Hmm, by that do you mean that the hero teleports PAST the target so the hero is facing AWAY from the target?

Just do make unit face target, move hero to point with polar offset by Distance Between Hero and Target + 200 towards facing of Hero.

Or you could do Move towards angle between hero and target then make hero face angle between hero and target + 180.
 

RocKNRolL

New Member
Reaction score
0
ok sounds good can you explain please about the polar offset idea? :S
i did not get it clearly..


Just do make unit face target, move hero to point with polar offset by Distance Between Hero and Target + 200 towards facing of Hero.


thank you :)
 

RocKNRolL

New Member
Reaction score
0
It's a function in GUI. Point with Polar Offset.

first of all... THANK YOU! XD (+rep)
but i have a problem with that function, when im calling the function sometimes it setting the offset not for the right place. example:

monster is in front of the hero after activating the skill, he gets to the point when he needs to "move instently" and he moves in the same WC3 Distance Units, not in the same direction as i want, like he moves 400 to the side insted of 400 forward.

Trigger:
  • Events
    • Conditions
    • Actions
      • Unit - Make (Triggering unit) face (Target unit of ability being cast) over 0.00 seconds //make sure he is facing the target
      • Unit - Move (Triggering unit) instantly to ((Position of (Target unit of ability being cast)) offset by 400.00 towards 0.00 degrees)


Can you find the problem?

Edit: NVM i found it :D
thanks for helping.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top