Author Topic: Ship-maneuver not working  (Read 2407 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobra

  • 212
  • Snake on a Cain
    • Skype
    • Steam
    • Twitter
Ship-maneuver not working
I'm working on a SEXP that makes the player's go into a flat spin. The SEXP itself seems sound, but when it comes into play nothing happens. The player is under ai control, plays dead so it doesn't attack anything, and the maneuver event fires but the actual rotation doesn't occur.

Code: [Select]
$Formula: ( when
   ( and
      ( < ( hits-left "Zeta 1" ) 10 )
      ( is-event-true-delay
         "Durga Teleports, Pew Pew"
         0
      )
   )
   ( ship-invulnerable "Zeta 1" )
   ( protect-ship "Zeta 1" )
   ( add-goal
      "Rama"
      ( ai-ignore "Zeta 1" 89 )
   )
   ( add-goal
      "Durga"
      ( ai-ignore "Zeta 1" 89 )
   )
   ( add-goal
      "Arjuna"
      ( ai-ignore "Zeta 1" 89 )
   )
   ( add-goal
      "Krishna"
      ( ai-ignore "Zeta 1" 89 )
   )
   ( add-goal
      "Asura"
      ( ai-ignore "Zeta 1" 89 )
   )
   ( add-goal
      "Varuna"
      ( ai-ignore "Zeta 1" 89 )
   )
   ( add-goal
      "Shiva"
      ( ai-ignore "Zeta 1" 89 )
   )
   ( player-use-ai )
   ( add-goal
      "Zeta 1"
      ( ai-play-dead 89 )
   )
   ( sabotage-subsystem
      "Zeta 1"
      "<all engines>"
      95
   )
)
+Name: Player damaged
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( when
   ( is-event-true-delay
      "Player damaged"
      0
   )
   ( ship-maneuver
      "Zeta 1"
      1000
      0
      0
      100
      ( true )
      0
      0
      100
      ( true )
   )
   ( set-camera-shudder 9000 500 )
   ( training-msg "Spin Debug" )
)
+Name: FLAT SPIN EJECT GOOSE
+Repeat Count: 9999
+Trigger Count: 9999
+Interval: 1
+Team: 0
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Ship-maneuver not working
Won't play dead cause the ship to reject the spin?

Try removing that?

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Ship-maneuver not working
Not sure about play-dead but not having engines sure will.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Ship-maneuver not working
Won't play dead cause the ship to reject the spin?

Try removing that?
It shouldn't reject it.  But it will defiantly not act upon it.

But like FUBAR noted, not having engines will cause the AI to not move at all.

If you want the ship to move without engines (I assume for the visual effect) then I would suggest using the set-object-facing and set-object-position.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline Axem

  • 211
Re: Ship-maneuver not working
Iss Mneur: That wouldn't work for what he's trying to do. You can't bank the fighter with those sexps. What's really odd is that I've gotten this effect to work before! Why its not working now it a total mystery...

The issue with ship-maneuver and AI orders is that the AI will attempt to move with the maneuver, not using play-dead may let the AI react to dynamic orders. The AI may be canceling out the spin through his own "counter maneuver."

Maybe if you set no dynamic goals and then clear orders for Alpha 1 before anything else? An order to Alpha Wing or all fighters is an order that the "player" will carry out if he goes under ai control, and that order will be above 89 priority. So you could try increasing that too.

I'm just shooting in the dark here.

 

Offline Cobra

  • 212
  • Snake on a Cain
    • Skype
    • Steam
    • Twitter
Re: Ship-maneuver not working
Code: [Select]
$Formula: ( when
   ( true )
   ( add-goal
      "Alpha 1"
      ( ai-waypoints-once
         "Waypoint path 1"
         89
      )
   )
)
+Name: Auto start
+Repeat Count: 1
+Interval: 1

$Formula: ( when
   ( is-event-true-delay "Auto start" 1 )
   ( player-not-use-ai )
   ( clear-goals "Alpha 1" )
)
+Name: AI Off
+Repeat Count: 1
+Interval: 1

$Formula: ( when
   ( <
      ( distance
         "Alpha 1"
         "Waypoint path 1:1"
      )
      500
   )
   ( player-use-ai )
)
+Name: Spin Setup
+Repeat Count: 1
+Interval: 1

$Formula: ( when
   ( is-event-true-delay "Spin Setup" 0 )
   ( player-use-ai )
   ( add-goal
      "Alpha 1"
      ( ai-play-dead 100 )
   )
)
+Name: Alpha 1 AI
+Repeat Count: 999
+Trigger Count: 999
+Interval: 1
+Team: 1

$Formula: ( when
   ( is-event-true-delay "Alpha 1 AI" 1 )
   ( ship-maneuver
      "Alpha 1"
      1000
      100
      0
      0
      ( true )
      0
      0
      100
      ( true )
   )
   ( training-msg "EJECT" )
)
+Name: Spinning
+Repeat Count: 999
+Trigger Count: 999
+Interval: 1
+Team: 0

This is what I did in a test mission. It turns, but it turns reeeeeeeeeeaaaaaaaaaaaaaaaaaaallllllllllllllyyyyyyyyyyyyyyy slooooooooooooooowwwwwwwwwwwwwwllllllllllllllyyyyyyyyyy.

[EDIT]On further study at x64 time compression it seems that it just orbits the waypoint.
« Last Edit: July 18, 2010, 10:28:38 pm by Cobra »
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta