Jump to content

gruntage

Member
  • Content Count

    9
  • Joined

  • Last visited

  • Medals

Community Reputation

3 Neutral

About gruntage

  • Rank
    Private

Recent Profile Visitors

603 profile views
  1. That fixed it! Topic solved. Thanks,
  2. Hi all, I've been trying to rotate a camera around a fixed point with a given radius, but had no success. I've come across this script: Camrunning = true; // set to false to stop the camera _radius = 50; // circle radius _angle = 180; // starting angle _altitude = 10; // camera altitude _dir = 0; //Direction of camera movement 0: anti-clockwise, 1: clockwise _speed = 0.02; //lower is faster _coords = [cameratarget, _radius, _angle] call BIS_fnc_relPos; _coords set [2, _altitude]; _camera = "camera" camCreate _coords; _camera cameraEffect ["INTERNAL","BACK"]; _camera camPrepareFOV 0.700; _camera camPrepareTarget cameratarget; _camera camCommitPrepared 0; while {Camrunning} do { _coords = [cameratarget, _radius, _angle] call BIS_fnc_relPos; _coords set [2, _altitude]; _camera camPreparePos _coords; _camera camCommitPrepared _speed; waitUntil {camCommitted _camera || !(Camrunning)}; _camera camPreparePos _coords; _camera camCommitPrepared 0; _angle = if (_dir == 0) then {_angle - 1} else {_angle + 1}; }; The problem is that the 'waitUntil' command doesn't work like this anymore since this is an old script; I get an error message relating to the 'waitUntil' line when trying to use the script. Does anyone know how to write the 'waitUntil' line correctly so the script will work? Thanks,
  3. gruntage

    SetWaypointBehaviour Issue

    Thanks for the reply. I've done some more digging and I may have found a solution. I've run your code to find out when Hawk 2's behaviour is switching exactly and he's switching to stealth at some arbitrary time shortly after the mission begins. The switching does not coincide with anything else happening. There's no accidental completion of waypoints because Hawk 2's first waypoint is 600m away. Maybe this is just a bug within my game...Sounds ridiculous and I still can't believe it. But anyway, the solution is to simply force Hawk 2's behaviour and his first waypoint to careless about 30 seconds into the mission - i.e. right after the arbitrary switch. From that point on, everything seems to be working..for now 🙄. Thanks for the help.
  4. Hi Everyone, Got a weird issue with SetWaypointBehaviour and hopefully you guys can shed some light on what's happening here. So I have this function (shown below) that assigns some waypoints to a couple of AI guys. They're supposed to stay in careless behaviour until they reach their second waypoints, at which point they switch to stealth. I added the code to the first AI guy first (called Hawk 2) and it worked fine; he executed his waypoints perfectly. Then I added code to the second AI guy (called Hawk 3) and then the problems started. For some reason, Hawk 2 was switching to stealth too early...in fact, he was switching to stealth when Hawk 3 was assigned his waypoints. This doesn't make sense at all. Why would Hawk 2 be affected by code affecting Hawk 3? They're not in the same group, as you can see from the code below. In fact, it gets even crazier...Hawk 3 is in careless behaviour as intended, and he executes his waypoints perfectly; switching to stealth when instructed to by the script. Like, what is going on?! I've double checked to make sure that I haven't got 2s and 3s mixed up..but I guess it could be possible that I've missed something. I did some error trapping already by process of elimination and I've found that the problem code is: _hawk3wpB setWaypointbehaviour "stealth";. When I disable that line, Hawk 2 stays in careless behaviour, when I enable it, Hawk 2 goes to stealth. Is this a bug within Arma? Because this is the best mind f*** I've come across. TLDR: Code affecting Guy B is affecting Guy A..how and why? Very eager to find out what the deal is here, so many thanks in advance. hawk2group = group hawk2; hawk3group = group hawk3; {_x setunitpos "up";} foreach [hawk2,hawk3]; {_x setbehaviour "careless";} foreach [hawk2,hawk3]; //Hawk 2 waypoints _hawk2wpA = hawk2group addWaypoint [getmarkerpos "hawk2_a", 0]; _hawk2wpB = hawk2group addWaypoint [getmarkerpos "hawk2_b", 0]; _hawk2wpC = hawk2group addWaypoint [getmarkerpos "hawk2_c", 0]; _hawk2wpA setWaypointType "Move"; _hawk2wpA setWaypointbehaviour "careless"; _hawk2wpA setWaypointcombatmode "white"; _hawk2wpA setWaypointspeed "Full"; _hawk2wpB setWaypointStatements ["true", "hawk2 setunitpos 'middle'; hawk2 allowdamage false; hint 'Hawk 2 is closing in on his target';"]; _hawk2wpB setWaypointTimeout [20,20,20]; _hawk2wpB setWaypointbehaviour "stealth"; _hawk2wpC setWaypointStatements ["true", "_nil = [] execVM 'Functions\SH_Hawk2Plant.sqf';"]; sleep 2; //Hawk 3 Waypoints _hawk3wpA = hawk3group addWaypoint [getmarkerpos "hawk3_a", 0]; _hawk3wpB = hawk3group addWaypoint [getmarkerpos "hawk3_b", 0]; _hawk3wpC = hawk3group addWaypoint [getmarkerpos "hawk3_c", 0]; _hawk3wpA setWaypointType "Move"; _hawk3wpA setWaypointbehaviour "careless"; _hawk3wpA setWaypointcombatmode "white"; _hawk3wpA setWaypointspeed "Full"; //_hawk3wpB setWaypointStatements ["true", "hawk3 setunitpos 'middle'; hawk3 allowdamage false; hint 'Hawk 3 is closing in on his target';"]; //_hawk3wpB setWaypointTimeout [20,20,20]; _hawk3wpB setWaypointbehaviour "stealth"; //_hawk3wpC setWaypointStatements ["true", "_nil = [] execVM 'Functions\SH_Hawk3Plant.sqf';"];
  5. Thanks for the quick response @wogz187. It turns out that even when the player is in control of a vehicle, the unitplay script will still work. Very strange yet interesting, especially as I'm sure I've read that it doesn't work if the player is in control of the vehicle. This actually solves my problem of having a cockpit view as I can simply use the switchcamera "internal" command. But your script snippet may still be useful for attaching cameras to vehicles, or indeed if I need a cockpit view that's not necessarily from the pilot's POV - so thanks for the help!
  6. Hello all, I've been having some difficulties in making a decent cockpit camera from the pilot's POV. Right now any scripts I've used to try and attach a camera to the chopper have very choppy (😅) results. I haven't really tried the eachFrame eventhandler as I'm not sure of the syntax. In any case, I'm not sure what to make the camera look at exactly...as there is no predefined target. I should mention that the chopper is currently executing a unit play path - which means that the pilot is an AI, not the player. This means that you can't simply use a switchcamera "internal", remove the HUD, slap on some cinema borders and call it a day. Unless I use the co-pilot's POV...because I can make the co-pilot the player and do the things I just mentioned. But I'd rather use the pilot's POV, not the co-pilot - as it's more appropriate for the cutscene. Any ideas would be very much appreciated. Thanks Gruntage
  7. gruntage

    Titlecut Issues

    CutText seems to have fixed the issue - or at least I hope so! Thanks for the help 🙂
  8. gruntage

    Titlecut Issues

    The rest of the script is definitely working...everything else works, just the titlecuts seem to not be working at all. Thanks, Gruntage
  9. Hello all, I've been having some problems creating reliable fade-ins and outs during a cutscene for a mission. For some strange reason, if I execute the script below at the start of the mission, the 'titlecuts' work as they should. Yet, when the player reaches the point where the script is supposed to run, i.e. when he clears an enemy base, the titlecuts cease to function. Like, they literally do nothing...like the command doesn't exist. So I'm absolutely clueless as to why this is happening. I'm sure I've formatted the titlecut command correctly...after all, the script works fine if run at the start of the mission via a trigger. This is the script in question: //FOW_FortCinematic.sqf //Delay at start to allow for objective notification //also turn off any music if any 6 fademusic 0; sleep 10; //turn music up to full for new track 0 fademusic 1; //fade to black titlecut ["","BLACK OUT",4]; playmusic "LeadTrack06_F"; enableRadio false; sleep 4; //delete the striders in case they're blocking the road deletevehicle striderA; deletevehicle striderB; deadguy setposATL [18047.355,11779.067,0]; deadguy setdir 274.489; deadguy enableSimulation false; sleep 1; player enableSimulation false; //now move all units into positions {_x setpos (getmarkerpos "ecomp1")} foreach units ecomp; {_x setdir 20} foreach units ecomp; {_x setpos (getmarkerpos "dcomp1")} foreach units dcomp; {_x setdir 20} foreach units dcomp; {_x setpos (getmarkerpos "fcomp1")} foreach units fcomp; {_x setdir 20} foreach units fcomp; {_x setpos (getmarkerpos "acomp1")} foreach units acomp; {_x setdir 20} foreach units acomp; {_x setpos (getmarkerpos "scomp1")} foreach units scomp; {_x setdir 20} foreach units scomp; //Move tanks into position //First declare their variable as true tanksmove = true; y1 setpos (getmarkerpos "yank1"); y2 setpos (getmarkerpos "yank2"); y3 setpos (getmarkerpos "yank3"); y4 setpos (getmarkerpos "yank4"); //Create camera _camera = "camera" camcreate [18045.1,11780.5,1.30048]; _camera cameraeffect ["internal", "back"]; setacctime 1.0; camUseNVG false; showCinemaBorder true; sleep 1; //Show Text animation _currentTime = daytime; _formatTime = [_currentTime,"HH:MM:SS"] call BIS_fnc_timeToString; [[["AAF FORTIFICATION,", "<t align = 'left' shadow = '1' size = '0.8' font='PuristaBold'>%1</t>"],["SOUTH OF PYRGOS, ALTIS", "<t align = 'left' shadow = '1' size = '0.8'>%1</t><br/>"],[_formatTime, "<t align = 'left' shadow = '1' size = '1.1'>%1</t>", 15]],safezoneX+0.1,-0.25] spawn BIS_fnc_typeText; sleep 12; titlecut ["","BLACK IN",1]; _camera camPreparePos [18044.8,11780.5,1.40048]; [_camera, -8.52768, 4.79555e-006] call BIS_fnc_setPitchBank; _camera SetDir 132.645; _camera camPrepareFOV 0.800; _camera camCommitPrepared 0; sleep 11; titlecut ["","BLACK OUT",1]; sleep 1; _camera camPreparePos [17865.9,11732.2,19.8251]; _camera camPrepareTarget [18044.8,11780.5,1.40048]; _camera camPrepareFOV 0.750; _camera camCommitPrepared 0; sleep 1; titlecut ["","BLACK IN",1]; _camera camPreparePos [17865.9,11732.2,19.8251]; _camera camPrepareTarget (getmarkerpos "camTarget_mk"); _camera camPrepareFOV 0.750; _camera camCommitPrepared 10; sleep 7; titlecut ["","BLACK OUT",3]; sleep 3; _camera CameraEffect ["Terminate","Back"]; camdestroy _camera; deadguy setdammage 1; player enableSimulation true; //fade in from black enableRadio true; 3 fadesound 1; 3 fademusic 0.5; titlecut ["","BLACK IN",3]; sleep 7; savegame; true; I can't think of anything that takes place between the mission start and the start of the script that would cause the titlecut command to fail entirely. Has anyone here encountered a problem like this before? Does anyone have any ideas as to what might make the titlecut stop working? That at the very least would point me in possibly the right direction. Many thanks in advance.
×