Need Movement Detection Help More info inside.

IceWarrior98

New Member
Reaction score
12
I am in need of some help with detecting movement. This is the code thusfar.

Code:
Drain Fuel
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Current order of transport[1]) Equal to (Order(move))
            Then - Actions
                Player - Add 1 to Player 1 (Red) Current gold
            Else - Actions

This is just to test the detection, but it doesn't seem to know that the ship is moving when it clearly is. Basically, when this is working I want it to remove 1 "charge" from the "engine" so when it reachs zero it will deplete and my stop engine trigger will fire. But I can't seem to figure this out. Can anyone please explain? And yes transport[1] is declared.
 

DrinkSlurm

Eat Bachelor Chow!
Reaction score
50
Is this trigger initially on, or are you making sure to turn it on at the right time?

Could it be that the current order of the unit is "attack" or "smart" instead? You can test it out by displaying some text showing what the current order of the unit is.
 

IceWarrior98

New Member
Reaction score
12
Yes it is initially on. It checks every 1 second if the unit is moving.

What is "smart"? Is that when you simply right click somewhere? If so, what if you click on an enemy to attack, even if the unit is not moving would it still think it is?
 
Reaction score
107
you should just compare the points.
when you first turn it on, you need a seperate trigger to set the current position of the unit, then have something like:

Code:
event
   every 1 second
conditions
actions
   set newpoint = position of transport[1] (or whatever)
   if
     distance between newpoint and oldpoint greater then 0
   then
      (do whatever)
   else
      (do whatever)
   set oldpoint = position of transprt[1] (or whatever)
 

cleeezzz

The Undead Ranger.
Reaction score
268
theres 2 types of smart,

Event - Unit is issued an order targeting a unit
and Unit is issued an order targeting point.

both activated by right click.

i would use, set Temp_Point = Position of Blimp
1 second later Set temp_Point 2 = Position of blimp,
if temp_point not equal to temp point 2 do stuff.
 

IceWarrior98

New Member
Reaction score
12
actually, thanks to DrunkSlurm using "smart" and "move" with my trigger do exactly what I want. I just had to add a new if/then/else statement for smart.

Code:
Drain Fuel
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Current order of transport[1]) Equal to (Order(smart))
            Then - Actions
                Player - Add 1 to Player 1 (Red) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Current order of transport[1]) Equal to (Order(move))
            Then - Actions
                Player - Add 1 to Player 1 (Red) Current gold
            Else - Actions

Thanks for the help to those who suggested other means and DrinkSlurm.
 

IceWarrior98

New Member
Reaction score
12
On second thought, that caused some problems. New trigger is using the other suggestion which seems to work more accurately. Sorry DrinkSlurm.

Code:
Drain Fuel
    Events
        Map initialization
    Conditions
    Actions
        Set temp_point1 = (Position of Ship[1])
        Wait 1.00 game-time seconds
        Set temp_point2 = (Position of Ship[1])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Distance between temp_point1 and temp_point2) Not equal to 0.00
            Then - Actions
                Player - Add 1 to Player 1 (Red) Current gold
            Else - Actions
        Trigger - Run (This trigger) (checking conditions)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top