Author Topic: Some questions  (Read 5201 times)

0 Members and 1 Guest are viewing this topic.

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
What exactly are you trying to do.  It would make it much easier if you gave a series of events you want to happen.  Like ship x which isn't there at the beginning of the mission needs it's subsystems destroyed for goal y to become true and I want a directive z.
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 karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
1) As I said before, for directives and objectives you have to pick a trigger which comes true only when the directive/objective comes true. Quite often you can't do that with a single SEXP and you have to use several AND/OR SEXPs to make it work.

2) For Directives there is a small gotcha you have to watch out for when using is-event-true-delay. You must use the Add Operator option to add the third argument. By default the directive code uses -is-event-true-delay to decide when it should show the directive as well as when it becomes true. This is probably NOT what you want. The third argument allows you to use it only for determining when the directive is completed/failed.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Spicious

  • Master Chief John-158
  • 210
It was to be on a per turret basis. It's simple enough to get turrets to prioritise certain ships, but there were two sensible seeming ways of ordering if subsystem targeting were to be included: choose the ship with highest priority that can be hit, then choose the subsystem of highest priority that can be hit on that ship or have a list of pairs of ships and subsystems and do a straight traversal through them picking the first pair that can be hit.

 
What exactly are you trying to do.  It would make it much easier if you gave a series of events you want to happen.  Like ship x which isn't there at the beginning of the mission needs it's subsystems destroyed for goal y to become true and I want a directive z.

Basically, 2 friendly cruisers warp in mid mission, and the objective is to escort them.  However, how I made the mission is that one automatically gets destroyed.

Thanks for the help Kara and Fubar, and Im sorry I keep coming back here and asking for help  :sigh: So far I have come up with:

when
-has-arrived-delay
--0
--Cruiser1
-and
--has-departed-delay
---0
---Cruiser1
-not
--is-destroyed-delay
---Cruiser1

Which causes the primary directive to fail when put in the mission objectives editor (which is what I want, as I mentioned Cruiser1 gets destroyed).  However, when put in events editor with directive text Protect Cruisers, the text does not show up on my HUD.  I really thought I had it this time too  :rolleyes:  Any suggestions on what I have so far?

Note: Substituting percent-ships-destroyed for is-destroyed-delay does not change anything.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Try this:

Event1
When
-->has-arrived-delay
---->1
---->crusier1
-->send-message
---->#command
---->high
---->message1 (make a message name this with whatever just for testing

Event2 (chained to event1 with the directive Protect Cruisers)
When
-->has-departed-delay
---->1
---->crusier1
-->do-nothing

Now in the Mission Objectives editor your goal should be

is-event-true-delay
-->1
-->Event2

Make sure there is some kind of delay (at least one second) from when the cruisers arrive and when the one is destroyed. 


See what that does. 


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 Stormkeeper

  • Interviewer Extraordinaire
  • 211
  • Boomz!
I have a question. What do the "chained" and "chain delay" options in the events editor do?
Ancient-Shivan War|Interview Board

Member of the Scooby Doo Fanclub. And we're not talking a cartoon dog here people!!

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Chained means that the event will not be evaluated until the event it is chained to becomes true.  Chained delay is the delay before it is evaluated. 

Just try to avoid mixing chained and repeating events. 
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 karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
A chain is basically the same as

when
-is-event-true-delay
-Chain Delay
-Event Directly Above this one

The advantage of using a chain is that you can instantly see two events are chained together.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Spicious

  • Master Chief John-158
  • 210
Give this build a try. I've made a little sample mission for it too. It's a bit clunky to use, but the sexp system doesn't seem very flexible.

 
See what that does. 

Thought that did it, but the goal wont fail at all, though it shows up fine.  If it helps at all, the ship self destructs, if its been changed that self destructing isnt "destroyed" in a sense.

Downloading that new build now too.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Well if that is a problem it's the first I've heard of it.  Try sabotage subsystem hull 101 instead of self-destruct and see what happens.
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

 
That was no good either, but I figured it out.  The magic formula ended up being:

when
-and
--has-time-elapsed
---82 (this is a few seconds after the cruiser goes boom)
-not
--is-destroyed-delay
---Cruiser1
do-nothing

This is chained to the arrival event of the cruiser.  Happy that it works though  :D

This leads me to another dilemma though...is there a way to get directives to disappear?  Theres a time being in the mission that I want the player to ignore the primary objective, and with the directive still active, there are too many of them on the HUD.  Invalidating-goal doesnt work, or as far as Ive tried.