CMEPTb said:hi ppl were making gothic 2 rpg map we have a close 3rd person camera mod and we need to know how to make the character move with arrow keys or at least wasd
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.50 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] + 8.00
if bRight[A] == true then
set fFace[A] = fFace[A] - 8.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
Raptor-- said: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.50 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] + 8.00 if bRight[A] == true then set fFace[A] = fFace[A] - 8.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