Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Molybdenum on February 07, 2009, 09:42:32 am

Title: IFF bug
Post by: Molybdenum on February 07, 2009, 09:42:32 am
So in my mod. I try to set a group of ships that are friendly by default to hostile in the ship editor. When testing the mission they are marked as green and act as if friendly. This is my iff_def.tbl folder and all seems fine.

#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: ( 155, 155, 155 )                                       
$Attacks: ( "Friendly" "Hostile" "Traitor" )                           
+Sees Friendly As: ( 0, 255, 0 )                              
+Sees Hostile As: ( 255, 255, 0 )                                 
+Sees Neutral As: ( 255, 0, 0 )                                 
     
;------------------------                                    
; Unknown                                                
;------------------------                                    
$IFF Name: Unknown                                          
$Color: ( 255, 0, 255 )                                       
$Attacks: ( "Hostile" )                                    
+Sees Neutral As: ( 0, 255, 0 )                                 
+Sees Traitor As: ( 255, 0, 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 )                              
    
#End   

Is it possible that this is a FRED related bug?
Title: Re: IFF bug
Post by: karajorma on February 07, 2009, 10:52:31 am
What happens if you remove the IFF_Defs table?

Unless you've altered it in some way you don't need that table at all.
Title: Re: IFF bug
Post by: Molybdenum on February 07, 2009, 11:31:11 am
Removing it didn't change anything. I'm using fred2_open_3_6_10r-20081217_r5008-Wanderer
Title: Re: IFF bug
Post by: karajorma on February 07, 2009, 11:39:29 am
Can you post the mission then?
Title: Re: IFF bug
Post by: Molybdenum on February 09, 2009, 07:47:03 am
Sorry to keep you waiting. I don't think the mission file has anything to do with it. The same thing occurs with even the simplest of missions. I think the problem is in my modpack somewhere. I'm also afraid that having to find it will hider my progress.
Title: Re: IFF bug
Post by: Wanderer on February 09, 2009, 01:01:03 pm
So you want to add iff that is friendly towards the ships which have 'hostile' iff?

On a quick look at your table all other iffs had 'hostile' in their 'attacks' entry so they all should attack the ships with 'hostile' iff on sight.
Title: Re: IFF bug
Post by: Molybdenum on February 10, 2009, 08:24:45 am
The problem was, with or without the table ,the ship that where set to hostile show up green and could be targeted as friendly and attacking them would be treason. It's no longer a problem though. I'm just using the Traitor IFF with setting as if hostile so no I'm moving on somehow.
Title: Re: IFF bug
Post by: Aardwolf on February 10, 2009, 11:00:33 am
Were they part of a wing, or something?

Or maybe you accidentally put the player as hostile?
Title: Re: IFF bug
Post by: Molybdenum on February 10, 2009, 12:34:09 pm
Quote from: Aardwolf
Or maybe you accidentally put the player as hostile?

<Checks mission>

<*Slaps Forehead*>

"D'oh!"

Thanks, I can't belive I've been failing so hard. :ick:

Shivan ships where set to hostile as standard.
Title: Re: IFF bug
Post by: Mobius on February 15, 2009, 11:34:03 am
$Flags: ( "support allowed" )

So...that's what enables each faction to call in support ships? And what happens if a docking bay arrival/departure is set? Both hostile and friendly support ships will take off from/land to the same ship?
Title: Re: IFF bug
Post by: karajorma on February 15, 2009, 01:38:37 pm
Never tried it but as far as I know there isn't any reason you can't launch a hostile ship or supply ship from a friendly destroyer.
Title: Re: IFF bug
Post by: Mobius on February 16, 2009, 05:52:43 pm
Uhm...

Two separate "Hostile" entries, let's say "Hostile" and "Hostile#2", could be used when necessary to represent both effects. The first, default one would be used for missions in which friendly support ships take off from a destroyer/station/whatever while the second could be used in any normal situation(support ships jumping in) so that there will be no significant difference between the arrival anchor of friendly and hostile support ships.

I might give this a try. :nod:


EDIT: What's the correct name of the IFF Def.s table? I don't see the new entry in FRED.
Title: Re: IFF bug
Post by: Wanderer on February 17, 2009, 05:14:53 am
iff_defs.tbl

And do note that '_' is not the same as ' '.
Title: Re: IFF bug
Post by: Mobius on February 17, 2009, 03:50:25 pm
Yeah, that was a typo in my post.

I found the error: I added the ".tbl" part in the name, thus having "iff_defs.tbl" as name when the correct name is "iff_defs". The new entry works, now. :)