Author Topic: Traitor detection  (Read 6142 times)

0 Members and 1 Guest are viewing this topic.

Hello! I have a question: Is there a SEXP that would test if player betrays (fires on friendly units to the moment they turn hostile)? I was trying to use 'is-iff -->Hostile, Alpha 2' (Alpha 2 is immortal for dialog purposes) but it seems to have no effect... Any suggestions? :)

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Hello! I have a question: Is there a SEXP that would test if player betrays (fires on friendly units to the moment they turn hostile)? I was trying to use 'is-iff -->Hostile, Alpha 2' (Alpha 2 is immortal for dialog purposes) but it seems to have no effect... Any suggestions? :)

Use 'is-iff traitor', that should work better. And you need to use the player ship as the argument.

 
Thank you very much :) I haven't noticed the 'Traitor' option. Another question: Is there a way to alter traitor debriefing via FRED or is this only possible by editing tbl?

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
As far as I know you need to edit the tbl.
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
You could try an event that switches the player back from traitor to hostile.  That may give you a normal debrief.  You could also set the mission to no traitor and do your own version. 
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 karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Hello! I have a question: Is there a SEXP that would test if player betrays (fires on friendly units to the moment they turn hostile)? I was trying to use 'is-iff -->Hostile, Alpha 2' (Alpha 2 is immortal for dialog purposes) but it seems to have no effect... Any suggestions? :)

There's a reason why that's not working. Alpha 2 is still friendly. What happened is that Alpha 1's IFF was changed to Traitor! :p As Battuta states, if you had actually tested Alpha 1's IFF that would have worked. :D


You could try an event that switches the player back from traitor to hostile.  That may give you a normal debrief.  You could also set the mission to no traitor and do your own version. 

Either of those would work but personally I prefer to do the second one as it allows you to turn off the debrief but keep running the mission. Changing the player to hostile would screw up the IFF tests so you'd have to wait until the last seconds of the mission to do it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Thanks for all suggestions :) I'll try the trick with changing player IFF to hostile. I just want the mission to force end (with my own debriefing if possible) when player opens fire on own units, so messing up IFF check for the rest of the mission  is not an issue in this case (at least I think so...) :)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Even if that wasn't an issue I'd still have done it the other way. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
But doesn't the 'no traitor' option mean that player can shoot at friendly units unpunished?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Yep. Which is why you only turn it on using the SEXP after the player has actually turned traitor. The game automatically handles everything that way (for instance turning off rearming, command messages etc) but due to the No Traitor flag being set by the SEXP the game won't play the default "You are a traitor" Debriefing leaving you free to make up one of your own. :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Nice one! Thanks. I'll try that :)

 

Offline ssmit132

  • 210
  • Also known as "Typhlomence"
    • Steam
    • Twitter
Incidentally, how does the game determine when to change the player's IFF to Traitor (in normal circumstances)?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Basically the game does a huge long calculation to work out what the threshold is for damage you can do to a friendly vessel and if you break it you get assumed to be a traitor.

To be honest, it doesn't do a very good job of it as there are ways to get away with all kinds of crap. I've even blown up friendly fighters and gotten away with it in the past. Having a test to see if you did 100% of the damage to a friendly ship might be an idea. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
If you don't have the ship targeted it doesn't seem to count.  Difficulty does seem to factor in.  Other then that it's kind of a toss up. 
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 karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
If you don't have the ship targeted it doesn't seem to count.  Difficulty does seem to factor in.  Other then that it's kind of a toss up. 

Code: [Select]
        //    Hit ship, but not targeting it, so it's not so heinous, maybe an accident.
        if (Ai_info[shipp_hitter->ai_index].target_objnum != OBJ_INDEX(objp_hit)) {
            damage /= 5.0f;
        }

Yes it definitely takes both of those into account.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline ssmit132

  • 210
  • Also known as "Typhlomence"
    • Steam
    • Twitter
Having a test to see if you did 100% of the damage to a friendly ship might be an idea. :p
Then hopefully they don't get near any exploding Infyrnos. :P

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Steam
    • Something
Code: [Select]
       //    Hit ship, but not targeting it, so it's not so heinous, maybe an accident.
        if (Ai_info[shipp_hitter->ai_index].target_objnum != OBJ_INDEX(objp_hit)) {
            damage /= 5.0f;
        }
An "accident."  Yes.  Of course.  :nervous:

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Yea nothing like firing a pair of nukes with a friendly in between.  Big oops and you still don't go traitor. 
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 Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
If you don't have the ship targeted it doesn't seem to count.  Difficulty does seem to factor in.  Other then that it's kind of a toss up. 

Code: [Select]
        //    Hit ship, but not targeting it, so it's not so heinous, maybe an accident.
        if (Ai_info[shipp_hitter->ai_index].target_objnum != OBJ_INDEX(objp_hit)) {
            damage /= 5.0f;
        }

Yes it definitely takes both of those into account.

Interesting, it's what I've always suspected. And it makes a lot of sense, too. :)
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 
Hello! It's me again. Sorry for bumping old thread but the issue is not yet resolved :\

The solution proposed by karajorma (setting alow-treason false after player turned to traitor) is not working. Game still gives default traitor debriefing. The second solution (changing player IFF to 'hostile' moments before force-ending mission)  seems to work fine BUT it gives an unexpected side effect - every time (traitor or not) the player is killed, the IFF checking event seems to activate and mission ends giving my custom traitor debriefing. Any ideas how this could be solved? :)

EDIT: Small change to clear things up.
« Last Edit: November 18, 2010, 01:33:28 pm by psyhotik »