Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Cobra on March 02, 2009, 07:39:05 pm
-
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?
-
Ship-invisible is the most obvious.
-
But how do I set it if the ship was spawned from the ship-create SEXP?
-
Change-IFF to hostile or whatever right after you create it.
-
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
-
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.
-
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. :)
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.
-
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 think he means you can affect it, just you have to manually edit in the name rather than select one from the list.
-
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.
-
Oh, that's cool. Might be useful if I do more extensive FRED-ing at some point.
-
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)
-
Sec, got one
$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.
-
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?
-
It works :) Now I understand, thank you.