Jump to content

PortalGunner

Member
  • Content Count

    70
  • Joined

  • Last visited

  • Medals

Everything posted by PortalGunner

  1. Working well! There isn't a way to detect when the AI is looking at the marker is there, rather than using sleep? CursorTarget/Object is player-only. Either way, thanks a lot for the help.
  2. It works as intended with these optimisations, thank you for them. Only improvement I can think of is to move the marker with the heli, because right now you have to keep its position still. Would it be better (performance and reliability) to attachTo a temporary invisible object in front of the heli, or to use a loop to update the marker position?
  3. Okay it's done guys! Thanks so much for the help! I had to change driver _veh == player out for another call // mission.malden\centerTurret.sqf _veh = _this select 0; _veh addAction ["Center Turret", "turretdir.sqf", nil, 3, false, false, "", "(allowCenterTurret) && (call checkForGunnerSeat) && (call checkInDriverSeat)"]; // mission.malden\init.sqf checkForGunnerSeat = compile preprocessFileLineNumbers "checkgunner.sqf"; checkInDriverSeat = compile preprocessFileLineNumbers "checkdriver.sqf"; allowCenterTurret = true; // mission.malden\checkdriver.sqf _is_player_driver = false; if (driver vehicle player == player) then { _is_player_driver = true; }; _is_player_driver; I think I might publicly release this script after some more testing because I couldn't find anything like it earlier. Updating OP to the working script.
  4. Another update - it now, inexplicably, (mostly) works, the day after. I changed allowCenterTurret to a global var after I found it working. // mission.malden\description.ext class Extended_InitPost_EventHandlers { class Helicopter { clientInit = "_this execVM 'centerTurret.sqf';"; }; }; // mission.malden\centerTurret.sqf _veh = _this select 0; _veh addAction ["Center Turret", "turretdir.sqf", nil, 3, false, false, "", "(allowCenterTurret) && (call checkForGunnerSeat)"]; The above works perfectly, but I still need to check if the player executing the addAction is the driver. Yet with me in the pilot's seat and: _veh addAction ["Center Turret", "turretdir.sqf", nil, 3, false, false, "", "(allowCenterTurret) && (call checkForGunnerSeat) && (driver _veh == player)"]; the action doesn't appear. Replacing _veh with vehicle player also doesn't work. Am I not seeing something?
  5. I am stumped. I can do: _veh addAction ["Center Turret", "turretdir.sqf"]; but get Invalid number in expression at the end of the line with: _veh addAction ["Center Turret", "turretdir.sqf", [] ]; which makes it impossible to do the full: _veh addAction ["Center Turret", "turretdir.sqf", [], 3, false, false, [], "(_allow_center_turret) && ((driver _veh) == player) && (call checkForGunnerSeat)"]; for some reason those inner square brackets break the whole thing! I can't even replace it with anything - I've tried 0, nil, "", other brackets.. Edit: this happens in both CBA's Extended Event Handler as well as putting it directly into the init.sqf.
  6. Okay I have turretdir.sqf working (though its strange because it lost the variables halfway through), and I've tried moving the addAction to an Extended Event Handler (the mission already required CBA which adds these). The only problem now seems to lie in the conditions of the addAction, because if I remove all the conditions it works, and fires turretdir.sqf.
  7. It looks good, and the editor debug isn't throwing a fit about that semicolon anymore. Unfortunately the two errors I posted earlier are still occurring. As such the user action isn't showing up in pilot's seat and turretdir.sqf doesn't run properly. PS. Is there any need for my entire While loop in my init.sqf or does addAction already take care of that?
  8. init.sqf: checkForGunnerSeat = compile preprocessFileLineNumbers "checkgunner.sqf"; _allow_center_turret = true; // Below is simplified _centerTurret = player addAction ["Center Turret", "turretdir.sqf", [], 7, true, true, "", "(A) && (B) && (C) && (call checkForGunnerSeat);"]; checkgunner.sqf: _gunner_pos_available = false; _vec = vehicle player; _turrets = fullCrew [_vec, "gunner", true]; if (count _turrets > 0) then { _gunner_pos_available = true; }; _gunner_pos_available; Like such? Also yes, I'm just trying to find any gunner seat, not just empty.
  9. So I assume this will work something like this (below) for my intentions? _vec = vehicle player; _turrets = fullCrew [_vec, "gunner", true]; // below is simplified _centerTurret = player addAction ["Center Turret", "turretdir.sqf", [], 7, true, true, "", "(A) && (B) && (C) && (count _turrets > 0);"; Edit: Hang on I just realised that's only gonna run once because it's in init.sqf I guess I could add the first 2 lines inside the While in init.sqf? Or am I overthinking and it isn't necessary? -~-
  10. Yes I didn't realise the log was recording multiple mission starts as I was skimming through. I've now edited the errors and the OP script correctly. Real sorry for that mess-up 😓 I'll check out FullCrew in a sec - if you can find that time that'd be awesome.
  11. I'm posting what I've found in the .rpt log here: Errors:
  12. The AI gunner spawned to aim the turret may turn the engine on (because they're stupid) if it's done on the ground - so I want to turn it off again - but if you're flying and you run the script, it will still turn your engine off. So that if argument is to make sure that the engine isn't switched off when you're still flying the heli - because that would end.. poorly. (!isNull gunner vehicle player) || (vehicle player emptyPositions 'gunner'>0) As for that ^ I'm trying to detect if the vehicle has a gunner seat at all, it's been hard to find a coherent explanation of how. I added the semicolon at the end of the condition only because it seemed to satisfy the editor debug. So the error could be in init.sqf still 😕 Thanks for the feedback so far.
  13. I appreciate that you've taken the time to respond anyway. I've messed around a bit with it and I think it might be looking for a ) bracket from something earlier in the script? I can't tell what though. Even if, in turretdir.sqf, I change if (vehicle player emptyPositions "gunner" > 0) then { to if ((vehicle player) emptyPositions "gunner" > 0) then { like I did with the other uses of it in init.sqf, it still doesn't fix it - and there's no other () bracket codes above the error in turretdir.sqf.
  14. I'm sorry if I should have been clearer - the # was just to demonstrate where editor debug thinks there's a problem, and I was stating the file name of the .sqf file the error occurred in. I did format that message but it seems it didn't take 😕
  15. I'm also getting a missing ) bracket error after _turretVehicle) if ((getPosATL _turretVehicle) select 2 < 2) then { in turretdir.sqf
  16. As I count the brackets it is A && B && C && (D || E) unless that's somehow not supported? >n<
  17. Thank you, that has gotten rid of one error. ~I've edited the post with proper quotations (and one random ; near the end of the line) I'm still getting an Invalid number in expression at the end of that line unfortunately.
  18. PortalGunner

    Script: draw and write to map

    If you mean drawing on the map with Ctrl+LMB, it's not close to this scripts intention and can't be setup in the editor unfortunately. If you mean draw functions in scripts, I have yet to fully understand that area of Arma's scripting.
  19. PortalGunner

    Script: draw and write to map

    I don't mean to bump a necro but is anyone able to update this to the latest Arma 3 version? It's currently unusable, and I am unable to find anything else like it. If someone does update it, +1 for adding support (somehow) to use it in the editor.
  20. PortalGunner

    ARMA 3 Addon Request Thread

    I realise that what I'm about to suggest would be a huge undertaking as a whole, and I don't expect anything encompassing all of it. However, if anyone has seen mods, or would be interested in creating a mod, that provides equipment similar to that of any of the operators of Rainbow Six Siege (http://rainbowsix.wikia.com/wiki/Category:Operators), I believe they would be a great addition. This could include things like EMP grenades, 'sticky cameras', CQC cluster grenades, small drones (using UGV controls) or rifle shields to protect from headshots. The equipment in Siege is quite varied, so I'm sure atleast a few might be possible (and ACE integration might work well). I'm aware of quite a few comparisons between A3 and Siege - it would be interesting, and fun, to see them combined.
×