Editors Depot - Mission Editing and Scripting > OFP - Editing/Scripting General

Mission Ending Problem

(1/2) > >>

snafu:
Hello all

It's good to see OFPEC still around, the wealth of knowledge in these boards is immeasurable! I can't believe it is just short of 10 years since I submitted my ArmA mission here. It was the first mission I ever released and it was the help I got from the guys here that gave me the knowledge to get it up to scratch. If it weren't for this place, I don't think I'd have ever successfully completed a mission in the editor. It was such a great time to be active in the community and these forums :D

Hopefully I can get help with this problem I have been having, as well as some assistance with mission fail criteria.

So, I've got a mission for good old OFP that is nearing release. I've been playing OFP as I have a Macbook Pro and the recent port has allowed me to play it again. I was away with work over the years moving around so I've been out of the game for some time now and my gaming rig is still in storage, although I am back home now.

Anyway, my mission has 5 objectives which are marked as completed when the player achieves them. Once they are completed, the player heads to the extraction point. At the extraction point, there is a trigger grouped to the player so it is activated when they enter its radius and all of the objectives have been completed.

In the trigger's condition field I have:


--- Code: ---obj3completed AND obj4completed
--- End code ---

In the activation field I have:


--- Code: ---[] exec "dia3.sqs"; "5" objStatus "DONE"; obj5completed=true
--- End code ---

dia3.sqs contains radio chatter where the player requests extraction from HQ.

The problem is that the trigger is not activating. I've used this system in a mission before that I released earlier in 2017 but I didn't run into any problems then and I'm not sure why it's not working this time.

Any assistance would be greatly appreciated!

h-:
*raises up from below the thick dust layer*

Are the variables obj3completed and obj4completed set to false in the misson init.sqs or somewhere?

snafu:
No, would doing so be good practice?

h-:
Yes, you should always init all global variables to some default value.

The game doesn't handle for example boolean (true/false) checks well with nil values.

snafu:
Excellent, thank you. The mission now finishes, but not at the time or place intended.

The fifth and final objective is for the player to reach the extraction point with their squad. Therefore, I have grouped the trigger to the player and set it to activate when the entire group is present.

The condition field:


--- Code: ---obj3completed and obj4completed
--- End code ---

Activation field:


--- Quote ---[] exec "dia3.sqs"; "5" objStatus "DONE"; obj5completed=true
--- End quote ---

The trigger fires as soon as objectives 3 and 4 are completed. Whereas it should complete when the objectives are completed and the player's group is at the extraction point. Consequently, the end trigger is activated with every objective being completed and the mission ends.

Navigation

[0] Message Index

[#] Next page

Go to full version