Author Topic: Setting ship-created IFF  (Read 4193 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobra

  • 212
  • Snake on a Cain
    • Skype
    • Steam
    • Twitter
Setting ship-created IFF
So I'm working on a mission and I want to have a radar blip appear on the radar by using the ship-create SEXP, but I don't want it to have a friendly IFF and I want it to be hidden from sensors. How would I go about doing that?
« Last Edit: March 02, 2009, 09:39:35 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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Setting ship-created IFF
Ship-invisible is the most obvious.
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 Cobra

  • 212
  • Snake on a Cain
    • Skype
    • Steam
    • Twitter
Re: Setting ship-created IFF
But how do I set it if the ship was spawned from the ship-create SEXP?
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 FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Setting ship-created IFF
Change-IFF to hostile or whatever right after you create it. 
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 Enioch

  • 210
  • Alternative History Word Writer
Re: Setting ship-created IFF
But how do I set it if the ship was spawned from the ship-create SEXP?

I think that what he means is that the ship created by ship-create does not show up in the list of ships that the change-iff or the ship-invisible SEXPs can affect.  :rolleyes:

I'd like to hear the answer to that one. From what I know, there's no way to affect a ship created by ship-create. But I'm not a FREDder
'Violence is the last refuge of the incompetent'  -Salvor Hardin, "Foundation"

So don't take a hammer to your computer. ;-)

 
Re: Setting ship-created IFF
Have it just come in without warp instead of using the SEXP? There's a checkbox for that underneath the arrival cue box. You can make its IFF hostile by default as well then.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Setting ship-created IFF
I think that what he means is that the ship created by ship-create does not show up in the list of ships that the change-iff or the ship-invisible SEXPs can affect.  :rolleyes:

Yep, it won't. And there really isn't any method to make it show up. I suppose it might be possible to hack the entire SEXP system to make FRED detect the use of ship-create and add all the possible ships to the list but the second you do that someone's going to get the bright idea of creating ships using the names from a variable and it will all go to hell again. :)

Quote
I'd like to hear the answer to that one. From what I know, there's no way to affect a ship created by ship-create. But I'm not a FREDder

That on the other hand isn't true.

Use one of the argument SEXPs. Ships on the argument list aren't checked at start up and therefore don't fall into the same trap that trying to manually write the name of the ship into the SEXP causes. Once you do that you can use pretty much every single SEXP with something made using ship-create.
« Last Edit: March 05, 2009, 04:48:23 am by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Enioch

  • 210
  • Alternative History Word Writer
Re: Setting ship-created IFF
That on the other hand isn't true.

Beg Pardon?  :confused: So, bottom line: there is no way to affect a ship-create created ship?
'Violence is the last refuge of the incompetent'  -Salvor Hardin, "Foundation"

So don't take a hammer to your computer. ;-)

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Setting ship-created IFF
I think he means you can affect it, just you have to manually edit in the name rather than select one from the list.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Setting ship-created IFF
That on the other hand isn't true.

Beg Pardon?  :confused: So, bottom line: there is no way to affect a ship-create created ship?

I thought I'd deleted that line. :D It must have been hiding off the bottom of the page. I edited it to show the way round it was originally. :D

I think he means you can affect it, just you have to manually edit in the name rather than select one from the list.

Not quite. You have to use when-argument or every-time-argument.

If you use those you can specify the name of the spawned ship on the list and then use <argument> in the SEXPs.

Both FRED and FS2 error check SEXPs on mission load. If they come across a ship name that isn't in the mission it's flagged as an error. When they come across <argument> however they assume you know what you're doing.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Setting ship-created IFF
Oh, that's cool. Might be useful if I do more extensive FRED-ing at some point.

 

Offline Mpez

  • 27
Re: Setting ship-created IFF
I know this topic is ancient, but... could anyone post an example of using when-argument? I mean - what will the structure of the event using this sexp look like (I'm confused what to type in any-of = I probably don't understand how arguments work and an example would help)

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Setting ship-created IFF
Sec, got one

Code: [Select]
$Formula:
   ( when-argument
      ( in-sequence
         "Alastor#1"
         "Alastor#2"
         "Alastor#3"
         "Alastor#4"
         "Alastor#5"
         "Alastor#6"
         "Alastor#7"
         "Alastor#8"
         "Alastor#9"
         "Alastor#10"
         "Alastor#11"
         "Alastor#12"
         "Alastor#13"
         "Alastor#14"
         "Alastor#15"
         "Alastor#16"
         "Alastor#17"
         "Alastor#18"
         "Alastor#19"
         "Alastor#20"
         "Alastor#21"
         "Alastor#22"
         "Alastor#23"
         "Alastor#24"
         "Alastor#25"
         "Alastor#26"
         "Alastor#27"
         "Alastor#28"
         "Alastor#29"
         "Alastor#30"
         "Alastor#31"
         "Alastor#32"
         "Alastor#33"
         "Alastor#34"
         "Alastor#35"
         "Alastor#36"
         "Alastor#37"
         "Alastor#38"
         "Alastor#39"
         "Alastor#40"
         "Alastor#41"
         "Alastor#42"
         "Alastor#43"
         "Alastor#44"
         "Alastor#45"
         "Alastor#46"
         "Alastor#47"
         "Alastor#48"
         "Alastor#49"
         "Alastor#50"
         "Alastor#51"
         "Alastor#52"
         "Alastor#53"
         "Alastor#54"
         "Alastor#55"
         "Alastor#56"
         "Alastor#57"
         "Alastor#58"
         "Alastor#59"
         "Alastor#60"
      )
      ( true ) - note this event will always be true
      ( ship-create
         "<argument>"
         "GTSG Alastor"
         ( get-object-x "Gallant" "<none>" 0 )
         ( get-object-y "Gallant" "<none>" 0 )
         ( get-object-z
            "Gallant"
            "<none>"
            0
            0
            -200
         )
      )
      ( change-iff "Hostile" "<argument>" )
      ( turret-change-weapon
         "<argument>"
         "turret02a"
         "PDTerPulse"
         1
         0
      )
      ( turret-change-weapon
         "<argument>"
         "turret01a"
         "PDTerPulse"
         1
         0
      )
      ( change-ai-class
         "BALLS OF STEELE"
         "<argument>"
      )
      ( invalidate-argument "<argument>" )
      ( modify-variable
         @guncount[25]
         ( + @guncount[25] 1 )
      )
   )
)
+Name: gallant drops mines
+Repeat Count: -1
+Trigger Count: 60
+Interval: 15
+Team: 0

This event creates an Alastor turret with the first name on the argument list, then changes its IFF, changes its AI class and changes its weapons.

Next time it repeats, since the first <argument> has been invalidated, it will go to the next one on the list.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Setting ship-created IFF
As a more general helpful example, let's say you want an event to fire when any one of the ships Battuta, FUBAR or Kara get near the ship Mpez.

You would create a when-argument that said

When
any-of
(manually type these in)
         Battuta
         FUBAR
         Kara

<
distance (argument) (Mpez)
2000

(do something)

Now let's say you want it to fire once for EACH SHIP. You need to add 'invalidate-argument' at the end of the SEXP. This says 'once the argument has been used once, it can never be used again'. Then give the event a trigger count of 3. It will trigger once for Battuta, once for FUBAR and once for Kara.

What you're typing in as arguments in this case are data entries that would be valid operators in the 'distance' status SEXP. Does that make sense?

 

Offline Mpez

  • 27
Re: Setting ship-created IFF
It works :) Now I understand, thank you.