Author Topic: Kamikaze and IFF trouble  (Read 2670 times)

0 Members and 1 Guest are viewing this topic.

Offline ReeNoiP

  • 27
  • I FRED
Kamikaze and IFF trouble
I am trying to have a couple of ships do a kamikaze run. They have to seem friendly to the player (and their targets to avoid death by beamfire) until they are scanned.

The problem is having them target the right ships. As far as I understand, the kamikaze order makes the ship kamikaze its target as the order is given.

Since they are friendly when the order is given, I can't select targets by ordering them to attack and then giving the order. I tried ordering them to dock->kamikaze instead, but it doesn't seem to work. A "set shipname target" sexp would be nice, but I can't find anything like that.

Am I missing something about how the kamikaze sexp works? Or is there some trick I can use the pull this off?
Uncharted Territory is released. But I still need voice actors

 

Offline Angelus

  • 210
  • The Angriest Angel
Re: Kamikaze and IFF trouble
Try the change-iff SEXP

 

Offline ReeNoiP

  • 27
  • I FRED
Re: Kamikaze and IFF trouble
Yeah, that takes care of the IFF change after the scan, but not the kamikaze problem.
Uncharted Territory is released. But I still need voice actors

 

Offline Angelus

  • 210
  • The Angriest Angel
Re: Kamikaze and IFF trouble
Then try this

when
      op is-cargo-known-delay
              <a value that fits your needs>
               list of ships
 
      op change-iff
               <hostile>
               list of ships
  
      op kamikaze
              <damage>
              list of ships
« Last Edit: February 06, 2010, 04:43:01 pm by Angelus »

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Kamikaze and IFF trouble
When scanned
change-iff
add goal attack ship
kamikaze


The attack goal just needs to be after the change iff in the event.
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 ReeNoiP

  • 27
  • I FRED
Re: Kamikaze and IFF trouble
Problem is they should still do the kamikaze even if they aren't scanned/turned hostile.

I guess I could work around it by having them turn hostile after they get close and explain it in-mission. Come to think of it, that would probably make more sense anyway  :nervous:.
Uncharted Territory is released. But I still need voice actors

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Kamikaze and IFF trouble
This is an ideal situation for iff_defs.tbl.  Make a new IFF entry that's identical to Hostile, except that it isn't seen as hostile by Friendly and Friendly doesn't attack it.

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: Kamikaze and IFF trouble
This is an ideal situation for iff_defs.tbl.  Make a new IFF entry that's identical to Hostile, except that it isn't seen as hostile by Friendly and Friendly doesn't attack it.
That was what I was going to say.

 

Offline ReeNoiP

  • 27
  • I FRED
Re: Kamikaze and IFF trouble
I have been trying to use this iff_defs table:

Code: [Select]
#IFFs
   
;; Every iff_defs.tbl must contain a Traitor entry.  Traitors attack
;; one another (required by the dogfighting code) but it is up to you
;; to decide who attacks the traitor or whom else the traitor attacks.
$Traitor IFF: Traitor
   
;------------------------
; Friendly
;------------------------
$IFF Name: Friendly
$Color: ( 0, 255, 0 )
$Attacks: ( "Hostile" "Neutral" "Traitor" )
$Flags: ( "support allowed" )
$Default Ship Flags: ( "cargo-known" )
   
;------------------------
; Hostile
;------------------------
$IFF Name: Hostile
$Color: ( 255, 0, 0 )
$Attacks: ( "Friendly" "Neutral" "Traitor" )
+Sees Friendly As: ( 255, 0, 0 )
+Sees Hostile As: ( 0, 255, 0 )

;------------------------
; Neutral
;------------------------
$IFF Name: Neutral
$Color: ( 255, 0, 0 )
$Attacks: ( "Friendly" "Traitor" )
+Sees Friendly As: ( 255, 0, 0 )
+Sees Hostile As: ( 0, 255, 0 )
+Sees Neutral As: ( 0, 255, 0 )
 
;------------------------
; Unknown
;------------------------
$IFF Name: Unknown
$Color: ( 255, 0, 255 )
$Attacks: ( "Hostile" )
+Sees Neutral As: ( 0, 255, 0 )
+Sees Traitor As: ( 0, 255, 0 )
$Flags: ( "exempt from all teams at war" )

;------------------------
; Traitor
;------------------------
$IFF Name: Traitor
$Color: ( 255, 0, 0 )
$Attacks: ( "Friendly" "Hostile" "Neutral" "Traitor" )
+Sees Friendly As: ( 255, 0, 0 )

;------------------------
; Sneaky
;------------------------
$IFF Name: Sneaky
$Color: ( 0, 255, 0 )
$Attacks: ( "Friendly" "Neutral" "Traitor" )
+Sees Friendly As: ( 255, 0, 0 )
+Sees Hostile As: ( 0, 255, 0 )
 
#End

Setting the transports iff to "Sneaky". Problem is, it still appears as hostile (red, attacked by friendly) when they arrive. Also the Kamikaze is activated using this sexp:
Code: [Select]
$Formula: ( when
   ( <
      ( distance
         "GTT Fawkes"
         "GTC Vigilant"
      )
      1000
   )
   ( kamikaze 0 "GTT Fawkes" )
   ( add-goal
      "GTEP Dartmouth"
      ( ai-undock 89 )
   )
)
+Name: Fawkes kamikaze
+Repeat Count: 1
+Interval: 1
+Team: 0

But the transport just attacks (flies around the cruiser), so the kamikaze must not be activated.
Uncharted Territory is released. But I still need voice actors

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Kamikaze and IFF trouble
Okay, Mantis it and attach the mission and the table.

  

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Kamikaze and IFF trouble
Try changing the Kamikaze event to when has arrived delay and the distance check.  Kamikaze ships attacking are probably seen as hostile no matter what. 
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