Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: psyhotik on October 10, 2010, 01:58:42 pm
-
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? :)
-
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?
-
As far as I know you need to edit the tbl.
-
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.
-
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.
-
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...) :)
-
Even if that wasn't an issue I'd still have done it the other way. :p
-
But doesn't the 'no traitor' option mean that player can shoot at friendly units unpunished?
-
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. :)
-
Nice one! Thanks. I'll try that :)
-
Incidentally, how does the game determine when to change the player's IFF to Traitor (in normal circumstances)?
-
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
-
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.
-
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.
// 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.
-
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
-
// 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:
-
Yea nothing like firing a pair of nukes with a friendly in between. Big oops and you still don't go traitor.
-
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.
// 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. :)
-
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.
-
Use a different event for the debrief check?
-
Use a different event for the debrief check?
No, no, that's not the problem. The thing is that game seems to confuse the fact the player has been killed with the fact he turned traitor. To test it, make the following:
1. Create a mission with some friendly units (so you can become a traitor to test custom debrief) and some enemy units (so you can get killed and see what will happen)
2. Create the following events:
Traitor detection
-when
--if-iff
---traitor
---Alpha1
--do-nothing
chain to (with 1 delay or more):
Force end
-when
--true
--change-iff
---Hostile
---Alpha1
---end-mission
3.Create some traitor debrief with formula:
-is event-true-delay
--Traitor detection
--0
4. Play and:
a) fire on friendly units and become a traitor - the mission will end and you will get the debrief (which is good)
b) do not become a traitor and get yourself killed. Soon after you are killed, the mission will end (you won't get the quit/restart/quickstart choice) and you will get your traitor debriefing (which is not good)...
The number of different debriefings is not important. It seems that killing alpha1 triggers Traitor detection event true. Surprisingly when you end-mission in the same event as is-iff, the problem will not occur.
-
add a "and not is-destroyed-delay" for alpha wan?
-
Yup. This seems to work :) Thank you very much. It's good to have more experienced FREDers around ;)
-
You set allow-treason to true, not false.
-
You set allow-treason to true, not false.
I tried both settings. Both are giving default traitor debrief :\