Correct Movement With Keyboard

WackO_WilL

New Member
Reaction score
4
I know that there have been many threads about this, But I have been searching for about 5 hours now, And came up with a bunch of different triggers, Variables, that were rather Inaccurate. So here I will post what I have got so far.

Code:
Camera
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
            Loop - Actions
                Camera - Apply Camera 002 <gen> for Player 1 (Red) over 0.00 seconds
                Camera - Lock camera target for Player 1 (Red) to Rouge Male Nightelf 0012 <gen>, offset by (0.00, 20.00) using Default rotation
                Camera - Set Player 1 (Red)'s camera Rotation to (Facing of Rouge Male Nightelf 0012 <gen>) over 0.00 seconds


Code:
Forward
    Events
        Player - Player 1 (Red) Presses the Up Arrow key
    Conditions
    Actions
        Set Red_Hero_Point = (Position of Rouge Male Nightelf 0012 <gen>)
        Unit - Order Rouge Male Nightelf 0012 <gen> to Move To (Red_Hero_Point offset by 100.00 towards 0.00 degrees)

Code:
Left
    Events
        Player - Player 1 (Red) Presses the Left Arrow key
    Conditions
    Actions
        Set Red_Hero_Point = (Position of Rouge Male Nightelf 0012 <gen>)
        Unit - Order Rouge Male Nightelf 0012 <gen> to Move To (Red_Hero_Point offset by (0.00, -5.00))


Code:
Right
    Events
        Player - Player 1 (Red) Presses the Right Arrow key
    Conditions
    Actions
        Set Red_Hero_Point = (Position of Rouge Male Nightelf 0012 <gen>)
        Unit - Order Rouge Male Nightelf 0012 <gen> to Move To (Red_Hero_Point offset by (0.00, 5.00))

Code:
Turn around
    Events
        Player - Player 1 (Red) Presses the Down Arrow key
    Conditions
    Actions
        Set Red_Hero_Point = (Position of Rouge Male Nightelf 0012 <gen>)
        Unit - Order Rouge Male Nightelf 0012 <gen> to Move To (Red_Hero_Point offset by -10.00 towards 0.00 degrees)


Code:
Stop
    Events
        Player - Player 1 (Red) Releases the Left Arrow key
        Player - Player 1 (Red) Releases the Right Arrow key
        Player - Player 1 (Red) Releases the Down Arrow key
        Player - Player 1 (Red) Releases the Up Arrow key
    Conditions
    Actions
        Unit - Order Rouge Male Nightelf 0012 <gen> to Stop
        Custom script:   call RemoveLocation(udg_Red_Hero_Point)


I will tell you my results -
Forward Makes me head in the direction of east,
Left - Makes me turn right - Easy fix
Right - Works
Turn around, Makes me head west,
-------------------------------------------------------​
What is annoying -
Forward, Left, Right, turn around, Seem to work for their Desginated Degree, And distance, But It only works when you tap the key. If I hold down the key, Then it stops after it reaches the designation of the Trigger i put in, But I want it to keep going.

Left, Right, Turn too abruptly.
-------------------------------------------------------​
I want -
Left and right to slowly turn, Making it easy to move into the more Tighter places.

Forward to go in the direction of which the unit is facing.

Turn around to make the unit whip around for easy retreat.

Also it seems that there is a 5 second cooldown before I can tap agian, Any clue why?

All in all, It should be something like Jurassic park 3rd person veiw Mode.
-------------------------------------------------------​
It would be nice if some one could throw in a little extra work for finding out how to make a trigger that when a player Acuires a hero, it attachs camera to that hero it has chosen, There are 4 heros, If that will help.

If you are going to post a trigger with variables, please state the variables, What are their propertys. It saves time to figure it out, And wastes only a small amount of yours.

Not to bribe, But I will give rep to all of those who help contribute to make a Working, Functional Accurate Keyboard Movement Trigger. And may even Post it some where for future refrence to everyone so we don't have these threads poping up anymore.

If you need anymore information, I will be accurate to tell you everybit of anything related to the question. All you have to do is ask
!

Thank you in advance. I hope this attempt at finding a good, Clean arrow key movement will not be in vain!
 

Tinki3

Special Member
Reaction score
418
Have you tried looking at this map?

From what I can see, the whole system is leaky.

For instance:

Leaks are in red.

How to fix this one? Set another point variable that offsets "Red_Hero_Point" by 100, then order your unit to move to that offset point, set by the second variable.

Code:
Forward
    Events
        Player - Player 1 (Red) Presses the Up Arrow key
    Conditions
    Actions
        Set Red_Hero_Point = (Position of Rouge Male Nightelf 0012 <gen>)
        Unit - Order Rouge Male Nightelf 0012 <gen> to Move To (Red_Hero_Point [COLOR="red"]offset by 100.00[/COLOR] towards 0.00 degrees)

You should fix those offset leaks for all your triggers, otherwise your map could get unbearably laggy.

As for your problem - I don't really want to go through your whole system and look for something that might be making it malfunction.

I suggest looking at the demo map I gave you, and maybe modifying it.
 

WackO_WilL

New Member
Reaction score
4
No no no no, THis one is what my triggers are kinda like, He moves according to the direction of the key and a Camera that doesnt rotate around the unit, And ive already seen this Map, But I couldn't change the triggers into my favor.

What I need is, Something like world of warcraft, Here let me put in my Map incase some one would want to look at it.

I thought this Would remove leaks.

Code:
Stop
    Events
        Player - Player 1 (Red) Releases the Left Arrow key
        Player - Player 1 (Red) Releases the Right Arrow key
        Player - Player 1 (Red) Releases the Down Arrow key
        Player - Player 1 (Red) Releases the Up Arrow key
    Conditions
    Actions
        Unit - Order Rouge Male Nightelf 0012 <gen> to Stop
        Custom script:   call RemoveLocation(udg_Red_Hero_Point)
 

Attachments

  • Wills land tft~.w3x
    390.6 KB · Views: 83

Evote

New Member
Reaction score
4
to make a non leaking point with offset use your knowage of trigg and edit this
Unit Group - Pick every unit in All_Units and do (Actions)
Loop - Actions
Set point[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
Set X[(Player number of (Owner of (Picked unit)))] = (X of point[(Player number of (Owner of (Picked unit)))])
Set Y[(Player number of (Owner of (Picked unit)))] = (Y of point[(Player number of (Owner of (Picked unit)))])
Set THETA[(Player number of (Owner of (Picked unit)))] = (Facing of (Picked unit))
Set THETA[(Player number of (Owner of (Picked unit)))] = (THETA[(Player number of (Owner of (Picked unit)))] - 90.00)
Set THETA[(Player number of (Owner of (Picked unit)))] = (THETA[(Player number of (Owner of (Picked unit)))] x -1.00)
Set X[(Player number of (Owner of (Picked unit)))] = (X[(Player number of (Owner of (Picked unit)))] + (Frame_Rate[(Player number of (Owner of (Picked unit)))] x (Sin(THETA[(Player number of (Owner of (Picked unit)))]))))
Set Y[(Player number of (Owner of (Picked unit)))] = (Y[(Player number of (Owner of (Picked unit)))] + (Frame_Rate[(Player number of (Owner of (Picked unit)))] x (Cos(THETA[(Player number of (Owner of (Picked unit)))]))))
Set point[(Player number of (Owner of (Picked unit)))] = (Point(X[(Player number of (Owner of (Picked unit)))], Y[(Player number of (Owner of (Picked unit)))]))
 

chovynz

We are all noobs! in different states of Noobism!
Reaction score
130
Oh my freaking giddy aunt! Evote.... that is not a good trigger.

@WackO_WilL: I think... you'd do better to learn a little Jass. Then you could use coordinates that don't leak at all, and don't need removing. Give it a go. It's easy.
 
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

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top