Incorrect Action Application

This forum is currently in read-only mode.
From the Asset Store
Alot of High Quality Items sound effects for your game!
  • This does not seem to be working correctly:

    + System: For each Ship
    + Ship: Pick by GetToken(Ship.Value('Equipment:EngineCount'), 2, "|") Equal to ""
    [/code:usrqvyif]
    Sub-Event:
    [code:usrqvyif]+ Ship: Value 'AI:Purpose' Equal to "Dock"
    [/code:usrqvyif]
    Sub-Sub-Event:
    [code:usrqvyif]+ Ship: Value 'Movement:State' Equal to "Go"
    [/code:usrqvyif]
    Sub-Sub-Sub-Event:
    [code:usrqvyif]+ System: Ship.Value('Movement:ReverseCalc') Greater than Ship.Value('Movement:Distance')
    -> Ship: Set 'Movement:TurnTo' to Ship[Movement].Angle-180
    [/code:usrqvyif]
    
    What this code [b]should[/b] do is pick all the ship that have no engines in the second token [b]and[/b] have the purpose for docking [b]and[/b] have the movement state of "Go" [b]and[/b] if the time it takes to reverse their direction is greater than the distance they are from their target, [b]then[/b] reverse their direction.
    
    It seems to ignore that last condition. And this is driving me [b][i][u]NUTS[/u][/i][/b].
    
    Anyhoo... 
    
    What am I doing stupidilly?
    
    Thanks
  • + System: Ship.Value('Movement:ReverseCalc') Greater than Ship.Value('Movement:Distance')
    -> Ship: Set 'Movement:TurnTo' to Ship[Movement].Angle-180[/code:2vcorxsq]
    
    Might try using "Compare a private variable"
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, I just found out this morning what was up!

    Ship: Pick by GetToken(Ship.Value('Equipment:EngineCount'), 2, "|") Equal to ""[/code:3aupakc4]
    
    Was messing it up. I made the second token say "0" instead of nothing (and updated the picking event to match) and it works now!
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)