Jump to content
Sign in to follow this  
COL.C.T

Issues with establishingshot, tasks/waypoints

Recommended Posts

I'm currently working on my first mission in which I'm utilizing more of ARMA 3's editing tools and effects. However, I've come across a couple of snags that are a real thorn in my side. I've pieced together things from multiple forum posts but I might be overlooking something.

Anyhow, my first issue is related to the establishingshot script, the one where when the mission "starts" there is this uav effect that overlooks the location of your choice. I've gotten this to work and all, but after spending the latter part of this week trying to figure out how to get the mission to start when the establishingshot has concluded, I've turned up empty in answers.

This is the script that I'm using.

execVM "briefing.sqf";

0 = [player, "Galati, Altis",450,nil,120,1] spawn BIS_fnc_establishingShot;

WaitUntil{scriptDone _intro};

// rest of mission start

Every time I launch the mission, the mission seemingly starts during the intro, instead of when the establishingshot would end (whether over time (19 seconds) or if I hit enter/space).

Second issue is related to tasks and way points appearing on the hud. I find having both on the screen a bit of an eyesore. In my mission the squad leader is controlled by the AI, so a way point is necessary. However, is there a way that the way point can not show up on the player's screen, and leave only the task marker on it?

Share this post


Link to post
Share on other sites

The variable '_intro' is not defined in the code you posted. I think scriptDone will return true if its argument has no value.

I don't know if BIS_fnc_establishingShot always takes the same amount of time, but you could just 'sleep 19;' if that's how long it takes for you.

Alternatively, after looking at the code for BIS_fnc_establishingShot, there is a variable named 'BIS_fnc_establishingShot_playing' that is set to true when the function ends. You could try this:

waitUntil {
   !(BIS_fnc_establishingShot_playing)
};

Regarding waypoints on the hud, this is a difficulty option that players can change. You could try this:

http://community.bistudio.com/wiki/setWaypointVisible

Share this post


Link to post
Share on other sites

Thanks for the quick reply. Somewhat confused on how that code should be placed/used though. I opened up the init and placed it after the other code. Gave it a shot but still the same results as before.

0 = [player, "Galati, Altis",450,nil,120,1] spawn BIS_fnc_establishingShot;

waitUntil {

!(BIS_fnc_establishingShot_playing)

};

Also looked at that link for the waypoints you gave me. Was able to get the second example to work via a trigger activation, though it only worked for the first waypoint (also tried to sync the trigger to the following waypoint, but to no success).

Share this post


Link to post
Share on other sites

If BIS_fnc_establishingShot_playing returns TRUE after the briefing ends, then adding the "!" In front would mean, wait until its false, which it starts off as. Try removing the ! and ().

Share this post


Link to post
Share on other sites

No such luck yet. Maybe I need to add something in the mission itself, like a trigger?

Share this post


Link to post
Share on other sites

First, I did contradict myself about BIS_fnc_establishingShot_playing. It should be set to false when the scene stops playing (as the name would indicate). From lines 499-501 of the function:

// Start mission
BIS_missionStarted = true;
BIS_fnc_establishingShot_playing = false;

However, neither my nor Fight9's solution works because of a timing issue with BIS_fnc_establishingShot. BIS_fnc_establishingShot_playing is not immediately defined when the function runs. Because you use 'spawn' to execute BIS_fnc_establishingShot, the init.sqf continues and checks the value of BIS_fnc_establishingShot_playing when it was undefined. The waitUntil loop continues when the variable is undefined.

You cannot use 'call' to execute BIS_fnc_establishingShot because the function uses sleep commands. You must wait until the value of BIS_fnc_establishingShot_playing is defined before checking it. The loop would look like this:

waitUntil {
   (!(isNil "BIS_fnc_establishingShot_playing") && {!(BIS_fnc_establishingShot_playing)})
};

I have tested this quickly in the editor and it seems to work.

Share this post


Link to post
Share on other sites

So how would the entire code look like in the end?

Share this post


Link to post
Share on other sites

Just substitute the waitUntil loop, like this:

execVM "briefing.sqf";
0 = [player, "Galati, Altis",450,nil,120,1] spawn BIS_fnc_establishingShot;
waitUntil {
   (!(isNil "BIS_fnc_establishingShot_playing") && {!(BIS_fnc_establishingShot_playing)})
};
// rest of mission start

Share this post


Link to post
Share on other sites

That's odd, the mission still starts during the UAV intro :confused:

Share this post


Link to post
Share on other sites

First, I would try removing the 'execVM "briefing.sqf";' line, probably not it though. Also ensure that no mods are running and the game is up to date.

This is what I did to test this, and it is working:

Create a new mission on Stratis, place a player unit anywhere, save the mission using any name.

Go to the mission folder and create the init.sqf file.

Copy these commands into the init:

0 = [player, "Galati, Altis",450,nil,120,1] spawn BIS_fnc_establishingShot;
waitUntil {
   (!(isNil "BIS_fnc_establishingShot_playing") && {!(BIS_fnc_establishingShot_playing)})
};

sleep 3;
player sidechat "start";

Save the init and run the mission. The entire sequence should play, and three seconds after it ends, 'start' should appear at the bottom of the screen. This will also work if you interrupt the sequence with [space].

If you can reproduce that result then the waitUntil loop is working fine. However, any commands in the editor or in 'briefing.sqf' will continue to run during the scene. Anything that needs to wait for the scene to finish should be coded beneath the waitUntil loop. The loop does not stop the mission or pause time, it stops the init.sqf from executing until the condition is true.

Share this post


Link to post
Share on other sites

Excellent, thank you very much! However, is it possible to code the squad's first waypoint and the initial trigger (which contains music) to activate via the sqf file once the intro has ended?

Share this post


Link to post
Share on other sites

For the music code, you should just be able to copy it into the init. The only difference is that the init is executed slightly after all code in the editor.

You can synch a trigger to a waypoint, and unit will not move to the next waypoint until the trigger activates. However, you need to create an initial waypoint right next to the the group, then synch a trigger to that. In the trigger's condition field, put:

startMission

And in your init, after the waitUntil loop, put:

startMission = true;

The squad will move to the first waypoint you placed, wait for the variable to be true after the intro plays, then they will move to what is now the second waypoint. You can increase the first waypoint's completion radius so that they do not move at all.

Share this post


Link to post
Share on other sites

Just gave it all a shot, and works out fantastically. Got the music to work whenever the intro ends by keeping it in the trigger. Thank you very much for the help :cool:

EDIT: Also just got the invisible waypoints to work.

[group player, 1] setWaypointVisible false;

This was the code I used, but it wouldn't hide the other waypoints from the player. Just looked at it and remembered the that "1" represents the first waypoint. Adding the code again to the player init and changing it from a 1 to a 2 covered both waypoints -facepalm-

Edited by COL.C.T
Got waypoints to work too.

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  

×