Jump to content
Sign in to follow this  
kyfohatl

The Error In This Script?

Recommended Posts

This basic camera script is executed when the player enteres a trigger area:

changeCameraPos1 = false
titleCut ["Congrgulations, you have arrived at the Russian Holdout", "Plain"]
;Ok, I can't write SQS, so I prefered to write the rest of the script in SQF
0 = [] execVM "Scripts\Story\RussianBaseArrival.sqf"

_camera = "camera" camCreate [0,0,0]
_camera cameraEffect ["internal", "back"]


#Loop1
_camera camSetTarget s1
_camera camSetrelPos [-1,-2,3]
_camera camPrepareFOV 0.600
_camera camCommitPrepared 0
@camCommitted _camera
?(changeCameraPos1): goto "Position2"
goto "Loop1"

#Position2
_camera camPrepareTarget s1
_camera camPreparePos [11272.39,5472.14,3.72]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 2
@camCommitted _camera

exit;

And RussianBaseArrival.sqf:

// "hq" is just some unit I use for HQ dialogue and to switch the player
// to momentarily so that my camera script works
selectPlayer hq;
// s1 is the player
_grpPlayer = group s1;
// player has no other waypoints, hence the use of "0"
_wp1 = _grpPlayer addWaypoint [getPos RuOfficer, 0, 0];
[_grpPlayer, 0] setWaypointType "MOVE";
[_grpPlayer, 0] setWaypointBehaviour "SAFE";
[_grpPlayer, 0] setWaypointSpeed "LIMITED";
waitUntil {(s1 distance RuOfficer) < 50};
changeCameraPos1 = true;
waitUntil {(s1 distance RuOfficer) < 3};
RuOfficer doWatch s1;
s1 doWatch RuOfficer;
titleCut ["Will be done later", "Plain Down"];

This works when instead of all of the "waypoint stuff" is replaced by a move command. But I want the player character and his group to walk, not run, and I don't know if that is possilbe with the "move" command. So I'm using waypoints instead. However, when I use the waypoint script, the player unit just walks out of the trigger area once the scripts is started and just stays there. Any ideas why player unit is not moving to Russian Officer's position ("RuOfficer")?

Oh, if you wanted to know: I'm just using this script to create a scene in which the player has a conversation with his officer. The camera initially follows him (as he walks across the base to the officer's position), then changes to a set position to "observe the conversation".

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  

×