Author Topic: [SOLVED] Need help with a directive  (Read 2975 times)

0 Members and 1 Guest are viewing this topic.

Offline Redstreblo

  • Darth Lobster
  • 26
  • Current Project: Vasudan Imperium (\/) (;,;) (\/)
[SOLVED] Need help with a directive
Ok, so this is sort of a unique problem I think. I have a ship that may or may not become hostile (iff change under certain circumstances) and if it becomes hostile I want a directive to show up (destroy *ship*). I have the directive written up and chained to an event that says it will be true when the iff becomes hostile. This way the directive *should* only appear in the list if these conditions are met. However through testing the mission at the end when (*ship*) departs it shows up in the list as a failed directive. It showed up as a failed directive when its iff was still "friendly". I do not want this to happen.

Basically when *ship* becomes hostile I want a directive to be added (like add goal for ai, only it's a directive). When it remains friendly I do not want the directive to pass or fail, it doesn't exist.

$Formula: ( when
   ( and
      ( is-iff "Hostile" "Omega" )
      ( has-undocked-delay
         "Rasputin"
         "Omega"
         1
         0
      )
   )
   ( do-nothing )
)
+Name: Destroy Omega Special
+Repeat Count: 1
+Interval: 1

$Formula: ( when
   ( is-destroyed-delay 0 "Omega" )
   ( do-nothing )
)
+Name: directive Destroy Omega
+Repeat Count: 1
+Interval: 1
+Chained: 0
+Objective:  XSTR("Destroy Omega", -1)
« Last Edit: June 23, 2010, 12:14:49 pm by Redstreblo »
I, Aries one, have proved myself superior to the legendary Terran pilot Alpha one! Let the Vasudan people take pride in this accomplishment, and take the Parliamentary Vasudan Empire to victory over the inferior Galactic Terran Alliance! Long live the Emperor!

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Need help with a directive
You have to start with the objective invalid (in the goals editor) then validate it with sexps.

[EDIT]Oh, wait, you mean a HUD directive? Hmm, OK. You need to chain the direcdtive to a do-nothing event. So, like, is-iff, hostile, *ship* -> do nothing. Then chain the directive trigger to that.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline ReeNoiP

  • 27
  • I FRED
Re: Need help with a directive

[EDIT]Oh, wait, you mean a HUD directive? Hmm, OK. You need to chain the direcdtive to a do-nothing event. So, like, is-iff, hostile, *ship* -> do nothing. Then chain the directive trigger to that.

From what I can understand, that's what he is doing now. Maybe if he checked with is-event-true for the event turning the ship hostile instead. It could have something to do with the is-iff sexp for a ship no longer in the area.

is-event-true
"turn hostile event"
do nothing
chain
"directive event"

Also the "undocked" part the event could be a little dangerous. I assume you are doing something similar to the walkthrough (transports capturing the ship). What if a transport is destroyed before it is undocked, but after the ship is taken over?
Uncharted Territory is released. But I still need voice actors

 

Offline Redstreblo

  • Darth Lobster
  • 26
  • Current Project: Vasudan Imperium (\/) (;,;) (\/)
Re: Need help with a directive
Also the "undocked" part the event could be a little dangerous. I assume you are doing something similar to the walkthrough (transports capturing the ship). What if a transport is destroyed before it is undocked, but after the ship is taken over?

Then mission failure, the goal is to have the Omega and Rasputin dock, transfer cargo, undock and depart. However the enemy fighters goals are to disable Omega and destroy Rasputin and there are several different outcomes. One of the outcomes involves this directive:

Option 1: Complete success
Option 2: Omega is destroyed before transfer of cargo: Failure
Option 3: Omega is destroyed after transfer of cargo: meh success
Option 4: Omega is disabled after transfer of cargo. The incoming enemy frieghter then docks with Omega and Omega iff changes to hostile. directive should show up "destroy omega" only in this situation: meh success
Option 5: Omega is disabled before transfer of cargo. The Rasputin still attempts to dock with it and the enemy frieghter warps in and heads towards the Omega to capture it. If the frieghter gets there first and captures the Omega before the transfer of cargo could take place: Failure
Option 6: Omega is disabled before transfer of cargo. The Rasputin still attempts to dock with it and the enemy frieghter warps in and heads towards the Omega to capture it. If the Rasputin undocks with Omega and departs with the cargo: success - the directive should also appear in this situation because the cargo had been transfered and the Omegas iff changes.

The overall mission goal is to make sure Rasputin departs the system with the cargo the Omega starts out wit. The Omega could die or be captured after the transfer of cargo and it wouldn't matter, it just wouldn't be the best debriefing. However due to the story line and fun I want this directive to be there.
I, Aries one, have proved myself superior to the legendary Terran pilot Alpha one! Let the Vasudan people take pride in this accomplishment, and take the Parliamentary Vasudan Empire to victory over the inferior Galactic Terran Alliance! Long live the Emperor!

 

Offline ReeNoiP

  • 27
  • I FRED
Re: Need help with a directive
Fair enough. Still, my best guess for a solution to the directive problem is chaining an is-event-true/do-nothing event. That's how I usually do it and it works. But I really can't say for sure what is wrong with the way you set it up now.
Uncharted Territory is released. But I still need voice actors

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: Need help with a directive
Ugh! This is surprisingly complicated. Just for curiosity's sake, how long would it take the AI to disable Omega without any outside interference, i.e. is it even possible for the AI to do it in the mission's window? (On all difficulty levels.)

Because, if in the time it takes to play the mission, there's no way for the enemy fighters to disable this little transport, even if that's their only goal, and there's nobody interfering with them... then the only way the Omega will be disabled is if the player does it himself. And you could just have an event to self-destruct it.

I don't know if any updated AI profiles have made the AI any better at disabling targets but this is a possibility.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 
Re: Need help with a directive
Guess it needs more testing. Let a message be sent when the first event triggers, and another when the second one triggers. Maybe even add more events, that sent messages if the events above trigger false (an event can have three states: true, false and incomplete).
You should be able to pinpoint the problem that way, although it may require a bit of testing.

 

Offline Redstreblo

  • Darth Lobster
  • 26
  • Current Project: Vasudan Imperium (\/) (;,;) (\/)
Re: Need help with a directive
And you could just have an event to self-destruct it.

self destruct event after self destruct event. This is not a good start. I would prefer to use self destruct events as a last option and only if it is necessary. I would not use self destruct to just fix a problem that I do not want to have to deal with because it is too dificult.
I, Aries one, have proved myself superior to the legendary Terran pilot Alpha one! Let the Vasudan people take pride in this accomplishment, and take the Parliamentary Vasudan Empire to victory over the inferior Galactic Terran Alliance! Long live the Emperor!

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Need help with a directive
Omega and Rasputin, eh?  Gee... I wonder what THIS mission could be about.  ;7
The Trivial Psychic Strikes Again!

  

Offline Redstreblo

  • Darth Lobster
  • 26
  • Current Project: Vasudan Imperium (\/) (;,;) (\/)
Re: Need help with a directive
OK, found a fix. All I had to do was to switch the directive so that it relied on the event that caused the iff change instead of "when iff is".

Thanks to Black Wolf for the solution to this problem  :yes:
I, Aries one, have proved myself superior to the legendary Terran pilot Alpha one! Let the Vasudan people take pride in this accomplishment, and take the Parliamentary Vasudan Empire to victory over the inferior Galactic Terran Alliance! Long live the Emperor!