I have a situation in my module where the PC and the party enters a trigger and a conversation starts. The script is a bit convoluted since there are 8 companions and there could be anyone of them in the party at the time. Now, most of this works fine, however:
If you control one of the companions while entering the trigger, the first node (line of dialogue - a red node) fires twice for some odd reason. I have tried everything I can now to make that go away, but for some reason it seems almost impossible to do.
If you control the PC when entering the trigger everything works just fine.
This is quite a minor thing, I know, but it really annoys me. Can anyone of you script masters out there like @kevL_s , @travus , @Lance_Botelle , @Akhacha etc. help with this perhaps?
EDIT: Alright, I might have found a solution for this myself. I saw I had a similar script at another trigger that actually worked perfectly, and I had just added that you could only enter the trigger once. However, this needs to be able to be entered and running the conversation twice. I might be able to solve this…
Alright, I’ll try with if(!GetFactionEqual(oEnter,GetFirstPC()))) return; though I noticed there was one oneparentheses too many.
EDIT: Ok, tried it. Didn’t work. It still fires the first node two times. I go back to working on it my own way. I had almost solved it, but there is still a weird issue… I think I can handle it from now on, though.
This is called each time a party member enter the trigger, you are in conversation and it’s launched again for a new convo and cut your current convo.
You can make a filter so it launch only for the “main PC”
This hinders several party members to enter and launch the conversation. This was kind of the way I did it with my other working script. The one talked about here:
The problem is that this conversation needs to be fired several times if need be. Usually on triggers like this I use SetLocalInt(OBJECT_SELF,"done",TRUE); and if(GetLocalInt(OBJECT_SELF,"done"))return; but this wouldn’t quite work in this scenario since in that case the trigger would only fire once. So I set a local int on the PC instead. When I’m in the middle of the conversation and the outcome is that I want to be able to run the trigger again, I set a local int by ga_local_int like this SetLocalInt(oPC1,"treasuredoneonce",FALSE);
I hope managed to explain this well enough. In any case I’ve tested it a many times and now it seems bulletproof.
I encountered a similar problem recently and realised it was because I was jumping a PC into the same trigger that starts the conversation as the trigger is entered. Hence, the conversation starts twice.
As @Shallina says, you basically need to stop this happening. The safest way to do it is to mark the trigger itself as done on entry in the above script. Then mark available again in the first node of the conversation if you want it to be available again straight away.
The problem with PC only is that it can vary, whereas the trigger is a one off… Just make sure the trigger tag is unique so that you can refer to it in the conversation correctly when marking as ready again.
The advantage of using the trigger also means you can control it’s activation ready or not variable more easily. It means one less variable to track on the PC s too.
No, I already said that I launch it several times. I’ve tested it. Many times. It works. So, no loopholes, I’m afraid.
Remember I only do single player modules. The first pc is always there.
Sometimes it’s like people don’t read what I write… Or maybe I’m not terribly good at explaining things when it’s complicated stuff like this.
Not in my case. Single player module. You know I don’t do multiplayer stuff. If it was for multiplayer, I would have agreed, but it’s not.
This was more of a recommendation (to any reader) to avoid using variables on the PC if you can do so, just because it’s probably better protocol to do so if possible … Keeps the PC BIC file down (or is it the ROS ) and less likely a cause for corruption, perhaps?
So, just a recommended protocol and nothing against your solution.
(As you say, more for MP consideration in this case.)