Movement System Help !

Ryuu

I am back with Chocolate (:
Reaction score
64
Code:
Movement System
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                For each (Integer B) from 1 to GLOBAL_NumberOfHeroes, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                GLOBAL_HeroType[(Integer B)] Equal to (Unit-type of GLOBAL_Hero[(Integer A)])
                            Then - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        MSystem_UpCheck[(Integer A)] Equal to True
                                        MSystem_DownCheck[(Integer A)] Equal to False
                                        MSystem_LeftCheck[(Integer A)] Equal to False
                                        MSystem_RightCheck[(Integer A)] Equal to False
                                    Then - Actions
                                        Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                                        Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 90.00 degrees)
                                        Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                                        Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                                        Custom script:   call RemoveLocation(udg_MSystem_UnitLoc)
                                        Custom script:   call RemoveLocation(udg_MSystem_DestinationLoc)
                                    Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        MSystem_UpCheck[(Integer A)] Equal to False
                                        MSystem_DownCheck[(Integer A)] Equal to True
                                        MSystem_LeftCheck[(Integer A)] Equal to False
                                        MSystem_RightCheck[(Integer A)] Equal to False
                                    Then - Actions
                                        Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                                        Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 270.00 degrees)
                                        Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                                        Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                                        Custom script:   call RemoveLocation(udg_MSystem_UnitLoc)
                                        Custom script:   call RemoveLocation(udg_MSystem_DestinationLoc)
                                    Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        MSystem_UpCheck[(Integer A)] Equal to False
                                        MSystem_DownCheck[(Integer A)] Equal to False
                                        MSystem_LeftCheck[(Integer A)] Equal to True
                                        MSystem_RightCheck[(Integer A)] Equal to False
                                    Then - Actions
                                        Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                                        Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 180.00 degrees)
                                        Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                                        Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                                        Custom script:   call RemoveLocation(udg_MSystem_UnitLoc)
                                        Custom script:   call RemoveLocation(udg_MSystem_DestinationLoc)
                                    Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        MSystem_UpCheck[(Integer A)] Equal to False
                                        MSystem_DownCheck[(Integer A)] Equal to False
                                        MSystem_LeftCheck[(Integer A)] Equal to False
                                        MSystem_RightCheck[(Integer A)] Equal to True
                                    Then - Actions
                                        Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                                        Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 360.00 degrees)
                                        Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                                        Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                                        Custom script:   call RemoveLocation(udg_MSystem_UnitLoc)
                                        Custom script:   call RemoveLocation(udg_MSystem_DestinationLoc)
                                    Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        MSystem_UpCheck[(Integer A)] Equal to True
                                        MSystem_DownCheck[(Integer A)] Equal to False
                                        MSystem_LeftCheck[(Integer A)] Equal to True
                                        MSystem_RightCheck[(Integer A)] Equal to False
                                    Then - Actions
                                        Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                                        Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 135.00 degrees)
                                        Unit - Make GLOBAL_Hero[(Player number of (Triggering player))] face 135.00 over 0.00 seconds
                                        Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                                        Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                                        Custom script:   call RemoveLocation(udg_MSystem_UnitLoc)
                                        Custom script:   call RemoveLocation(udg_MSystem_DestinationLoc)
                                    Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        MSystem_UpCheck[(Integer A)] Equal to True
                                        MSystem_DownCheck[(Integer A)] Equal to True
                                        MSystem_LeftCheck[(Integer A)] Equal to False
                                        MSystem_RightCheck[(Integer A)] Equal to True
                                    Then - Actions
                                        Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                                        Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 45.00 degrees)
                                        Unit - Make GLOBAL_Hero[(Player number of (Triggering player))] face 45.00 over 0.00 seconds
                                        Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                                        Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                                        Custom script:   call RemoveLocation(udg_MSystem_UnitLoc)
                                        Custom script:   call RemoveLocation(udg_MSystem_DestinationLoc)
                                    Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        MSystem_UpCheck[(Integer A)] Equal to False
                                        MSystem_DownCheck[(Integer A)] Equal to True
                                        MSystem_LeftCheck[(Integer A)] Equal to True
                                        MSystem_RightCheck[(Integer A)] Equal to False
                                    Then - Actions
                                        Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                                        Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 225.00 degrees)
                                        Unit - Make GLOBAL_Hero[(Player number of (Triggering player))] face 225.00 over 0.00 seconds
                                        Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                                        Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                                        Custom script:   call RemoveLocation(udg_MSystem_UnitLoc)
                                        Custom script:   call RemoveLocation(udg_MSystem_DestinationLoc)
                                    Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        MSystem_UpCheck[(Integer A)] Equal to False
                                        MSystem_DownCheck[(Integer A)] Equal to True
                                        MSystem_LeftCheck[(Integer A)] Equal to False
                                        MSystem_RightCheck[(Integer A)] Equal to True
                                    Then - Actions
                                        Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                                        Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 315.00 degrees)
                                        Unit - Make GLOBAL_Hero[(Player number of (Triggering player))] face 315.00 over 0.00 seconds
                                        Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                                        Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                                        Custom script:   call RemoveLocation(udg_MSystem_UnitLoc)
                                        Custom script:   call RemoveLocation(udg_MSystem_DestinationLoc)
                                    Else - Actions
                            Else - Actions

The thing is, if you tested this, the hero moves correctly, but he moves riggedly (is there such a word?). I don't really know how to explain this type of movement.

The second thing: is there a way to cast a spell while moving using this system?

Thanks alot !
+rep.
 

Psiblade94122

In need of sleep
Reaction score
138
Trigger:
  • Movement System
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to GLOBAL_NumberOfHeroes, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GLOBAL_HeroType[(Integer B)] Equal to (Unit-type of GLOBAL_Hero[(Integer A)])
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MSystem_UpCheck[(Integer A)] Equal to True
                      • MSystem_DownCheck[(Integer A)] Equal to False
                      • MSystem_LeftCheck[(Integer A)] Equal to False
                      • MSystem_RightCheck[(Integer A)] Equal to False
                    • Then - Actions
                      • Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                      • Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 90.00 degrees)
                      • Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                      • Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                      • Custom script: call RemoveLocation(udg_MSystem_UnitLoc)
                      • Custom script: call RemoveLocation(udg_MSystem_DestinationLoc)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MSystem_UpCheck[(Integer A)] Equal to False
                      • MSystem_DownCheck[(Integer A)] Equal to True
                      • MSystem_LeftCheck[(Integer A)] Equal to False
                      • MSystem_RightCheck[(Integer A)] Equal to False
                    • Then - Actions
                      • Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                      • Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 270.00 degrees)
                      • Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                      • Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                      • Custom script: call RemoveLocation(udg_MSystem_UnitLoc)
                      • Custom script: call RemoveLocation(udg_MSystem_DestinationLoc)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MSystem_UpCheck[(Integer A)] Equal to False
                      • MSystem_DownCheck[(Integer A)] Equal to False
                      • MSystem_LeftCheck[(Integer A)] Equal to True
                      • MSystem_RightCheck[(Integer A)] Equal to False
                    • Then - Actions
                      • Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                      • Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 180.00 degrees)
                      • Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                      • Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                      • Custom script: call RemoveLocation(udg_MSystem_UnitLoc)
                      • Custom script: call RemoveLocation(udg_MSystem_DestinationLoc)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MSystem_UpCheck[(Integer A)] Equal to False
                      • MSystem_DownCheck[(Integer A)] Equal to False
                      • MSystem_LeftCheck[(Integer A)] Equal to False
                      • MSystem_RightCheck[(Integer A)] Equal to True
                    • Then - Actions
                      • Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                      • Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 360.00 degrees)
                      • Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                      • Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                      • Custom script: call RemoveLocation(udg_MSystem_UnitLoc)
                      • Custom script: call RemoveLocation(udg_MSystem_DestinationLoc)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MSystem_UpCheck[(Integer A)] Equal to True
                      • MSystem_DownCheck[(Integer A)] Equal to False
                      • MSystem_LeftCheck[(Integer A)] Equal to True
                      • MSystem_RightCheck[(Integer A)] Equal to False
                    • Then - Actions
                      • Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                      • Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 135.00 degrees)
                      • Unit - Make GLOBAL_Hero[(Player number of (Triggering player))] face 135.00 over 0.00 seconds
                      • Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                      • Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                      • Custom script: call RemoveLocation(udg_MSystem_UnitLoc)
                      • Custom script: call RemoveLocation(udg_MSystem_DestinationLoc)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MSystem_UpCheck[(Integer A)] Equal to True
                      • MSystem_DownCheck[(Integer A)] Equal to True
                      • MSystem_LeftCheck[(Integer A)] Equal to False
                      • MSystem_RightCheck[(Integer A)] Equal to True
                    • Then - Actions
                      • Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                      • Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 45.00 degrees)
                      • Unit - Make GLOBAL_Hero[(Player number of (Triggering player))] face 45.00 over 0.00 seconds
                      • Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                      • Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                      • Custom script: call RemoveLocation(udg_MSystem_UnitLoc)
                      • Custom script: call RemoveLocation(udg_MSystem_DestinationLoc)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MSystem_UpCheck[(Integer A)] Equal to False
                      • MSystem_DownCheck[(Integer A)] Equal to True
                      • MSystem_LeftCheck[(Integer A)] Equal to True
                      • MSystem_RightCheck[(Integer A)] Equal to False
                    • Then - Actions
                      • Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                      • Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 225.00 degrees)
                      • Unit - Make GLOBAL_Hero[(Player number of (Triggering player))] face 225.00 over 0.00 seconds
                      • Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                      • Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                      • Custom script: call RemoveLocation(udg_MSystem_UnitLoc)
                      • Custom script: call RemoveLocation(udg_MSystem_DestinationLoc)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MSystem_UpCheck[(Integer A)] Equal to False
                      • MSystem_DownCheck[(Integer A)] Equal to True
                      • MSystem_LeftCheck[(Integer A)] Equal to False
                      • MSystem_RightCheck[(Integer A)] Equal to True
                    • Then - Actions
                      • Set MSystem_UnitLoc = (Position of GLOBAL_Hero[(Integer A)])
                      • Set MSystem_DestinationLoc = (MSystem_UnitLoc offset by MSystem_HeroSpeed[(Integer B)] towards 315.00 degrees)
                      • Unit - Make GLOBAL_Hero[(Player number of (Triggering player))] face 315.00 over 0.00 seconds
                      • Animation - Play GLOBAL_Hero[(Integer A)]'s GLOBAL_HerosMoveAnim[(Integer B)] animation
                      • Unit - Order GLOBAL_Hero[(Integer A)] to Move To MSystem_DestinationLoc
                      • Custom script: call RemoveLocation(udg_MSystem_UnitLoc)
                      • Custom script: call RemoveLocation(udg_MSystem_DestinationLoc)
                    • Else - Actions
                • Else - Actions


you can replace the system with slides instead of issueing a movement order (although that would take out pathing AI, but itll be alot smoother (although more cpu intensive))

btw use [WC3.][/WC3.] (remove the .) when your posting copied text from wc3
 

millz-

New Member
Reaction score
25
>The second thing: is there a way to cast a spell while moving using this system?
You probably will need to use dummy to "cast" the spell if you want move-n-cast system, I think.
 

werasd

New Member
Reaction score
14
Hey man. Can you attach the wc3 file for this?
But, i think the problem is that the game orders the unit to move to very near places (it's like if you get a unit in any map and keep clicking the mouse's right button in near places. The unit will walk "riggedly" as you said).
I'm not sure... so you could attach the map for me to check better.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
> you can replace the system with slides instead of issueing a movement order

Yeah, the slide was originally what I intended. But after seeing that I couldn't cast anything while "sliding", I changed it to issue movement order, and it still didn't work.​

> You probably will need to use dummy to "cast" the spell if you want move-n-cast system, I think.

You mean, while my unit is moving, the player selects a dummy unit at a far corner of the map? And through that dummy unit, abilities are casted?​

> Hey man. Can you attach the wc3 file for this?

Sure. ;)
When you've downloaded it, please let me know, I would like to remove it to prevent any further downloads.
Here it is: Map
 

Psiblade94122

In need of sleep
Reaction score
138
actually... you can use
JASS:
call SetUnitX(Your unit, a Real)

JASS:
call SetUnitY(Your unit, a Real)

and you can assign orders to the unit (this will not inturrupt spells)
One more thing, you might want to set the movement speed of the unit to 1, because if the unit moves while slideing with set unit X and Y itll move faster then intended (because your moving the unit directly and because the unit itself is moving)

Another method would be to order to unit to stop if issued a move order, but if your spells have range then the unit will still move to use the spell, but oh well you can add those two as custom scripts instead of using move unit instantly and youll be able to cast spells though that
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Alright, but how do I manipulate around those two custom scripts so that I can move my unit according to my own custom speed?
 

avalya

New Member
Reaction score
37
I'd like to ask how the SetUnitX/Y works, actually, are the reals offsets or coordinates?
 

avalya

New Member
Reaction score
37
Hmm, so how do you know where you are supposed to move a unit? Can you check it's current X/Y position and move it according to an offset of those coordinates?
 

Executor

I see you
Reaction score
57
Trigger:
  • SomeTrigger
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set TempLoc = (Position of SomeUnitVar)
      • Set TempLoc2 = (TempLoc offset by SomeRealVar towards (Facing of SomeUnitVar) degrees)
      • Unit - Move SomeUnitVar instantly to TempLoc2
      • Custom script: call RemoveLocation( udg_TempLoc )
      • Custom script: call RemoveLocation( udg_TempLoc2 )


Becomes this in JASS:

JASS:
function Trig_SomeTrigger_Actions takes nothing returns nothing
    set udg_TempLoc = GetUnitLoc(udg_SomeUnitVar)
    set udg_TempLoc2 = PolarProjectionBJ(udg_TempLoc, udg_SomeRealVar, GetUnitFacing(udg_SomeUnitVar))
    call SetUnitPositionLoc( udg_SomeUnitVar, udg_TempLoc2 )
    call RemoveLocation( udg_TempLoc )
    call RemoveLocation( udg_TempLoc2 )
endfunction

//===========================================================================
function InitTrig_SomeTrigger takes nothing returns nothing
    set gg_trg_SomeTrigger = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_SomeTrigger, 0.03 )
    call TriggerAddAction( gg_trg_SomeTrigger, function Trig_SomeTrigger_Actions )
endfunction


I would do sth. like this (vJass example):

JASS:
scope SomeMovement initializer Init
    globals
        unit someUnit = null
        real someReal = 0.
    endglobals
        
    private function DoSomethingPeriodic takes nothing returns nothing
        local real a = GetUnitFacing(someUnit)* bj_DEGTORAD
        local real x = GetUnitX(someUnit) + someReal * Cos(a)
        local real y = GetUnitY(someUnit) + someReal * Sin(a)
        call SetUnitX(someUnit,x)
        call SetUnitY(someUnit,y)    
    endfunction

    private function Init takes nothing returns nothing
        local timer Timer = CreateTimer()
        call TimerStart(Timer,0.03,true, function DoSomethingPeriodic)
    endfunction
endscope
 

Psiblade94122

In need of sleep
Reaction score
138
uhhh personally i would take two real variables (X(real) and Y(real)) and set the X to the X value of the point that you want the unit to move to, likewise for the Y

That way you dont need to do all the math required because its done for you

In other words
Set a point to where you want the unit to go
Set X = X of point of where you want the unit to go
Set Y = Y of point of where you want the unit to go
call SetUnitX(Your unit, X)
call SetUnitY(Your unit, Y)
 

LearningCode

New Member
Reaction score
24
But you need to know where you are now in order to now where you want to go, correct?
Where you are now will be reference so that you can make the unit move at a constant speed.

In Executor's example, someReal will have to be the distance that you want the unit to move.
And I think it'll make your hero move forward ._.

Isn't it easier to detect a key-press and then make the unit move? O_O
 

Psiblade94122

In need of sleep
Reaction score
138
set point1 to position of your unit
set point2 to point1 offsetting by (any distance) twards (any angle)
Set X to X of point2
set Y to Y of point2
call SetUnitX(Your unit, X)
call SetUnitY(Your unit, Y)

Point1 is where your unit is now
The offset distance for point2 is your speed, so with a bit of math you can make this feel like normal movement (minus the pathing AI)
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Executor,

Trigger:
  • Custom script: local real a = GetUnitFacing(udg_GLOBAL_Hero[GetForLoopIndexA()])* bj_DEGTORAD


gave me an error -> Expected 'endif'
 

Executor

I see you
Reaction score
57
You can declare local variables only at the beginning of the function.

JASS:

function something takes nothing returns nothing
local real a = 5. // works
set a = 3. // works
local real b = 2. // doesn't work because you left the "declare local vars block".
endfunction


Yes, my example will move the unit all 0.03 seconds udg_realVar units in the direction it looks.

If its possible what Psiblade94122 said, do it, I'm no GUI coder anylonger^^
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top