HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Moving with the arrow keys help

01-14-2007, 03:04 PM#1
Dwarf Zealot
Need help with arrow key movement i can get him to move just not the way i want what am i doing wrong here are my triggers

i have four of these
Trigger:
up
Collapse Events
Player - Player 1 (Red) Presses the Up Arrow key
Conditions
Collapse Actions
Set up = 1

and i have eight of these triggers for each way i want my guy to move
Trigger:
Move up
Collapse Events
Time - Every 0.20 seconds of game time
Collapse Conditions
up Equal to 1
down Equal to 0
left Equal to 0
right Equal to 0
Collapse Actions
Unit - Order BRAHNWINTER to Move To ((Center of No region) offset by 200.00 towards 90.00 degrees)

WHAT AM I DOING WRONG I FOLLOWED THE TUTORIAL!
01-14-2007, 04:47 PM#2
Naakaloh
You'll want to move the unit to the a point offset from it's current position.
01-14-2007, 05:55 PM#3
Pyrogasm
Use booleans instead of integers... it's smarter and simpler.
01-14-2007, 06:14 PM#4
Naakaloh
I guess it would reserve only one bit instead of 32, but that doesn't make his unit move toward the center of the map... :P

Pyrogasm's right though, it would be wiser to use booleans; there's less chance that you'd make an error, though it would be quite difficult to make an error in this case.
01-14-2007, 08:04 PM#5
The)TideHunter(
Change your action to:

Trigger:
Actions
Set TempPoint = (Position of (BRAHNWINTER))
Set TempPoint2 = (TempPoint offset by 200.00 towards 90.00 degrees)
Unit - Order (BRAHNWINTER) to Move To TempPoint2
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint2)

Create 2 variables, TempPoint and TempPoint2, both points.
If you dont use the 2 Sets, and the 2 RemoveLocation's, you are leaking 2 points every 0.2 seconds, which will make your game lag like hell after a while, so use those.
01-15-2007, 05:23 AM#6
rulerofiron99
Make 3 triggers for move forward, and 3 triggers for turning each way.

The first should check whether someone is pressing the key, and set that boolean to true.

The second should check when someone stops pressing the key, and set that boolean to false.

The last one should Periodically order the unit to move, using Tidehunter's actions.


Then do the same for the left and right keys, except change the angle at which the unit is ordered to move.


Otherwise, if you can't understand a thing we're saying, I could dig up one of my old trigger systems....