• 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.

Using "up,down,left,right" as movement.

Status
Not open for further replies.
Level 10
Joined
Jul 29, 2004
Messages
633
I dont know if you know this, but i fig out how 2 use the "up,down,left,right" as in a 3D game.

always have the cam locked to the unit, but dont lock it so when it turns the camera turns that way.

Then a Keyboard action like "up" then, issue ordering a unit targeting a point, that point is offset by like 100 on the y.

Jumping can be done by replacing the unit with a flying 4 sum time with n animation that makes its flying height go up, if you dont want it to reach certain places just use flying blockers. ez huh?

I guess you can do it in a more advanced way, but this way is good 4 GTA maps or fun games.
 
Level 7
Joined
Jul 30, 2004
Messages
451
except generally in multiplayer games arrow movement is extremely laggy because it basically takes forever to recognize that the keys have been pressed on the clients (the host has fine response time), so if u need quick reaction times in a map forget about using it

Metabee said:
Then a Keyboard action like "up" then, issue ordering a unit targeting a point, that point is offset by like 100 on the y.

btw you mean an offset by X amount of a polar offset of the unit towards the direction its facing
 
Level 7
Joined
Jul 30, 2004
Messages
451
Sprawler1023 said:
The forward and backward movements are relatively easy to do (kind of), but what gets me is the turning. How do I make a functional, smooth turning function? (Like the one in Legacies: Tides of the Serpent)

Code:
event - 
    player X presses left key 
actions - 
    set bLeft[player number of triggering player] = true

event - 
    player X releases left key 
actions - 
    set bLeft[player number of triggering player] = false 

//same with right

event -
    player X presses up key
actions -
    set bUp[player number of triggering player] = true

event -
    player X releases up key
actions -
    set bUp[player number of triggering player] = false

event - 
    periodical every 0.05 seconds 
actions - 
    for A = 1 to MaxPlayers
        set fFace[A] = facing direction of unit[A]
        if bLeft[A] == true then
            set fFace[A] = fFace[A] + 4.00
        if bRight[A] == true then 
            set fFace[A] = fFace[A] - 4.00
        make unit[A] face fFace[A] degrees over 0.00 seconds
        if bUp[A] == true then
            set pointMoveTo[A] = position of unit[A] offset by 128 towards (fFace[A]) degrees
            order unit[A] to move to (pointMoveTo[A])
            call RemoveLocation( pointMoveTo[A] )
    end loop

thats the basics, and its also only one of several ways to do it
 
Status
Not open for further replies.
Top