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.
 
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.
 
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?
 
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)
 
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.
 
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.
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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