Jump to content
Sign in to follow this  
Alethius

Briefing code help

Recommended Posts

Hi all,

I've been doing alot of research, and learning as much as possible about mission editing as I can on my own over the last few weeks since I got this game. I am in no way an advanced mission builder, but I am a graphic designer and I am profiient with alot of complicated applications as well as some bit of understanding of codes like c++, action script, etc. so I catch on to stuff like this pretty quick.

Thus far I have been able to handle units, waypoints, etc but I just want to be able to flesh out a mission with having speific goals shown in the briefing screen. Here is an in detail description of what i've done and what I can't get to work....

My mission has two triggers for completion. One is to kill a specific man named BORIS. The other is to clear a trigger area of all enemy presence. My briefing screen will only show obj_2 as a task and does not seem to recognize obj_1 as a task at all.

I have BORIS coded in a trigger:

0,0

cond: not alive BORIS;

On act: "1" objStatus "Done"; tskobj_1 setTaskState "SUCCEEDED"; obj_1 = true; publicVariable "obj_1";

The area trigger is as follows:

500x500

Activation: OPFOR - NOT PRESENT

cond: this

On act: "2" objStatus "Done"; tskobj_2 setTaskState "SUCCEEDED"; obj_2 = true; publicVariable "obj_2";

Then I have an end mission trigger:

0x0

Type: END #1

cond: obj_1 && obj_2;

On act: ForceEnd;

Now here are my briefing files:

init.sqf:

execVM "briefing.sqf";

briefing.sqf:

player createDiaryRecord ["Diary", ["Black Forest Hunt", "Seek out Insurgent camps in the Black Forest area and eliminate them. The area of operation is marked on your map.

Intel says we have a good chance of catching Boris Ballbanger, a popular Insurgent leader, in the area over the next 12 hours or so.

Air recconisance has spotted several areas of interest within the field of operation that you should definitely secure, and has dropped an ammo resupply in the area should you need it. Just make sure you secure it quickly.

Expect patrols to be on high alert if Boris is in fact present. Get the job done and get out of there."]];

tskobj_2 = player createSimpleTask ["Clear area."];

tskobj_2 setSimpleTaskDescription ["Clear the specified area of operation of all Insurgent activity.", "Clear area", "Clear"]

tskobj_1 = player createSimpleTask ["Kill BORIS"];

tskobj_1 setSimpleTaskDescription ["Kill the insurgent leader Boris Ballbanger.", "Kill BORIS", "Boris"];

player setCurrentTask tskobj_1;

I cannot get the briefing to show obj_1 as a task that has to be completed but it will show obj_2, (clear the area). Is this because BORIS is an OPFOR unit and therefore cannot be assigned more than one trigger? He does exist within the check for OPFOR presence trigger area...

Again, Iv'e scoured the forums and I am very new to ARMA II so I feel somewhat vindicated in asking for help:) Afterall you guys are looking for new players I'm sure. I am not seeking complicated scripting help or anything, I just want to build simple missions with clear objectives. If someone could just provide a simple layout of where my code has gone wrong, thats pretty much all I need to open up more doorways.

Thx in advance.... Alethius

Edited by Alethius

Share this post


Link to post
Share on other sites

Not sure, but maybe you lack a ";"

tskobj_2 = player createSimpleTask ["Clear area."];

tskobj_2 setSimpleTaskDescription ["Clear the specified area of operation of all Insurgent activity.", "Clear area", "Clear"];

tskobj_1 = player createSimpleTask ["Kill BORIS"];

tskobj_1 setSimpleTaskDescription ["Kill the insurgent leader Boris Ballbanger.", "Kill BORIS", "Boris"];

player setCurrentTask tskobj_1;

Share this post


Link to post
Share on other sites

It's possible that the end trigger is firing before the "not alive" trigger has a chance to fire. Try putting a short delay on the end trigger. Failing that, make sure that you've actually named the unit in question "BORIS."

Also, it's worth noting that:

- objStatus is an obsolete command that does nothing. You shouldn't use it anywhere.

- The variables "obj_1" and "obj_2" don't appear to be used for anything. You don't need to publicVariable them.

Share this post


Link to post
Share on other sites

Tried both solutions to no avail. I even tried swapping Boris to obj_2 and clear area to obj_1. I still only get Clear area to show up as a task in the briefing.

Share this post


Link to post
Share on other sites

I took a look to my working briefings.

I would have no underscore:

tskobj2 = player createSimpleTask ["Clear area."];

tskobj2 setSimpleTaskDescription ["Clear the specified area of operation of all Insurgent activity.", "Clear area", "Clear"];

tskobj1 = player createSimpleTask ["Kill BORIS"];

tskobj1 setSimpleTaskDescription ["Kill the insurgent leader Boris Ballbanger.", "Kill BORIS", "Boris"];

---------- Post added at 09:47 AM ---------- Previous post was at 09:38 AM ----------

It seams having no consequence 'cause I made a fake mission with your script as a briefing, (only with the add of the ";"

It works perfecly, both the task are shown in the instruction menu so at the moment don't know what your issue can be.

I paste the working script:

player createDiaryRecord ["Diary", ["Black Forest Hunt", "Seek out Insurgent camps in the Black Forest area and eliminate them. The area of operation is marked on your map.

Intel says we have a good chance of catching Boris Ballbanger, a popular Insurgent leader, in the area over the next 12 hours or so.

Air recconisance has spotted several areas of interest within the field of operation that you should definitely secure, and has dropped an ammo resupply in the area should you need it. Just make sure you secure it quickly.

Expect patrols to be on high alert if Boris is in fact present. Get the job done and get out of there."]];

tskobj_2 = player createSimpleTask ["Clear area."];

tskobj_2 setSimpleTaskDescription ["Clear the specified area of operation of all Insurgent activity.", "Clear area", "Clear"];

tskobj_1 = player createSimpleTask ["Kill BORIS"];

tskobj_1 setSimpleTaskDescription ["Kill the insurgent leader Boris Ballbanger.", "Kill BORIS", "Boris"];

player setCurrentTask tskobj_1;

Share this post


Link to post
Share on other sites

Thank you so much for offering help but I believe I have solved my issue. It was of course due to new user error lol. The problem was not in either my briefing code or my triggers, it was that I misunderstood where my files needed to be placed. I was mislead by the "export mission" feature and thought that when I was simply building a mission my files should go in the "user saved" folder. I now understand that I need only 1 instance of my sqf files in the main mission folder regardless of where I export. Once I put my files in the correct loaction it works fine. Now I can move on to more complicated things to ask more stupid questions about hehe.

Thx again.

Share this post


Link to post
Share on other sites

You're welcome. All need to start from somwhere;)

Do you have the right tools to edit your files?

It may help " pbowiew" to create and open *.pbo files or Armaedit to guide with the syntax.

I have not the links, maybe a search or a friendly veteran :D

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×