Author
Topic: iff_defs.tbl and a very special combat scenario (Read 1584 times)

iff_defs.tbl and a very special combat scenario

I have a certain mission scenario which requires me to introduce new IFFs via iff_defs.tbl. While the introduction per se is not strictly ciritical to make the mission work - I could just use the standard IFFs along with the change-iff-colour, protect-ship/beam-protect-ship/turret-protect-ship etc etc to make an inferior version work - it is very improtant that it is just so for narrative reasons. The inferior version would also have way more sources for possible bugs than I like (coming from me that means something).

One big problem is that I currently have no device capable of running FS_Open (I can make FRED work but that's about it), so I cannot do my usual thing and just trial and error mercilessly until the engine gives me what I want (even if how I did it is technically using a bug).

The particulars of the scenario are as follows:

The mission requires several non-friendly and non-hostile transports to interact with a friendly ship of significant displacement which is not able to defend itself. The player is tasked with defending said ships alongside another non-friendly/non-hostile cruiser to defend both from attacking hostiles.

There are added story points to this I will not go into at this point but they make it neccessary for the both transports and cruiser to have different attitudes towards the use of their turrets and not be folded into the "friendly" IFF.

The new IFFs are defined in an IFF_defs.tbl as follows (except for the names, those are much more handy in actual .tbl):

Re: iff_defs.tbl and a very special combat scenario

I would suggest seeing if there's any way to "fake it" using what already exists.

Right now I am using turret-set-target-order and ship-turret-set-target-order but as I understand it that doesn't disable the targeting of ships, as I need it for IFF_2. (IFF_1 appearnetly will work as intended)

I would use turret-set-target-priorities too if I knew what it does. There is no documentation in the wiki on it.

It's for mission 11 of The Lost Generation - Ashcroft. Basically what I am trying to accomplish is to display different attitudes towards the ongoing conflict.

"IFF_1" is called "Unclear" in the original table, and is reserved the GTC Agrippa which is engaged in the rescue of crew members from the now-derelict NTD Vasa - aiding the player. It is kept on a seperate IFF to allow the player to freely attack it if they don't trust the motives on display (triggering a event chain that turns the Agrippa to IFF Neutral like all other GTVA) but to have it help in the defense of Vasa and the medical ships against other GTVA elements.

"IFF_2" is called "Medical" in the original table, and is reserved for three transports (1 Argo, 2 Elysiums) which facilitate the rescue of survivors from the destroyer. They are on seperate IFF to simulate that there is actually a "ius in bello"-regime these ships still observe which allows them to act in self-defense but not engage.(that IFF "Medical" can also be freely targted would be cool and sly reference that someone removed the BETAK-conform-programming from the NTF's IFF computers)

If that sounds complicated and messy - that's the intention too - it is not first mission that deals with divided loyalities in either faction.

(EDIT: actually it is quite a substatial theme to many missions of the second act - and I don't want to do the same problematic bid Blue Planet: War in Heaven does, i.e. maintaining visiually the division between "us vs them" - though the whole thing might come crashing down due to the depiction of Vasudans in the campaign at several occasions ... but that's a story for after the campaign has been released and it can be discussed with the community)

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. <MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".(the very next day)<MageKing17> this ****ing code did it to me again<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."<MageKing17> **** ME<MageKing17> THE REASON IS PEOPLE ARE STUPID<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"(...)<MageKing17> so<MageKing17> more than two hours<MageKing17> but once again we have reached the inevitable conclusion<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

Re: iff_defs.tbl and a very special combat scenario

So "IFF_2" is supposed to only attack bombs and strikecraft targeting it? You could create a "Targeting_IFF_2" IFF that's identical to the regular hostile (or whatever) IFF, except that "IFF_2" attacks it, with a little script that changes any strikecraft or bombs targeting "IFF_2" to that IFF,

Re: iff_defs.tbl and a very special combat scenario

So "IFF_2" is supposed to only attack bombs and strikecraft targeting it? You could create a "Targeting_IFF_2" IFF that's identical to the regular hostile (or whatever) IFF, except that "IFF_2" attacks it, with a little script that changes any strikecraft or bombs targeting "IFF_2" to that IFF,

Only Bombs, not Strikecraft.

The solution you prupose is close to the emergency work-around I've in consideration (making IFF_2 attack Neutral by default and blob turet-protect all bombers, taking into account that then the IFF_1 cruiser does less than it should for no appearent reason)

Also, I am not sure if you can even change the IFF missiles, even with scripts.

The other possibility looked into was using dublicates of the turret weapons with the "bomber+"-flag and variants of the bombers without the "bomber"-flag ... however that doesn't suppress the AI from firing the turrets at the technically-not-bombers and may change the target priorities of AI wingmen...

I haven't made a new objecttype for not-bombers yet and have to look at SCP-SEXPs which could save me the trouble with the dublicate entries if they do what I think they do

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. <MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".(the very next day)<MageKing17> this ****ing code did it to me again<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."<MageKing17> **** ME<MageKing17> THE REASON IS PEOPLE ARE STUPID<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"(...)<MageKing17> so<MageKing17> more than two hours<MageKing17> but once again we have reached the inevitable conclusion<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

$Formula: ( when ( has-time-elapsed 0 ) ( script-eval "IFF_Hack:Enable()" ) )+Name: activate script+Repeat Count: 1+Interval: 1... is all that is required? (I need to take the time off to get into the ins and outs once the campaign is done, right now there is no time to learn new techniques)

EDIT: I am getting an error when starting a mission (not the one that calls for the script) ... I will try to work it out but anyone got a smart idea?