-
Content Count
193 -
Joined
-
Last visited
-
Medals
Everything posted by RS30002
-
mgi scripts AI VEHICLE RESPAWN script, an alternative for BI module
RS30002 replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
hey @pierremgi what would be the syntax for all empty vehicles respawning at start location? 0 = [ [ ],"start",10,true,true] spawn MGI_fnc_VehicleRespawn; ??? can't get this one to work, and it's really the one i need. Yes, i know, for such a minute purpose the BI module is great, but i'd really like loadouts on planes. ty for any insight -
mgi scripts AI VEHICLE RESPAWN script, an alternative for BI module
RS30002 replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
gonna play with it over the weekend. super busy rn. still didnt test and admittedly i might have jumped the gun with "reporting errors", just based on color coding of the code in the code preview window of the forums. ty for the response -
mgi scripts AI VEHICLE RESPAWN script, an alternative for BI module
RS30002 replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
yes but the bottom of the page looks written in several colors, like it should be and that usually means there's some invisible symbols, it breaks the color coding of the page, letting you know there's something wrong. idk, ill try in the game, see what happens, i didn't have time yet tbh, thats why i didnt respond so long lol. will report back! #edit: now that i think of it, if that portion of the page is doing just one thing, it maybe makes sense it's mostly all in red, idk -
How would i code a monitor on a ship, that's functioning as a staging area/base, to automatically display the map of whatever terrain the ship is placed in in the situation room? ie: if mission maker decides to do a mission on Altis, that map is displayed, if on Sahrani, Sahrani map on display etc etc ty for info
-
mgi scripts AI VEHICLE RESPAWN script, an alternative for BI module
RS30002 replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey, is there a chance to get a clean script file from the first page? The thing i can copy is really full of html artifacts and im not able to clean it. Generally i always use the modules version (your modules are one of the more useful things around tbh - enhanced turrets is a must!), but am trying to go light weight. ty for any help, bb whole upper portion of the script looks like this after copying -
helicopter transport Hermes Airlift Services Script
RS30002 replied to Gunter Severloh's topic in ARMA 3 - MISSION EDITING & SCRIPTING
no, it's not that :P the cannons fire at what they're supposed to, and the "commotion of the combat" somehow activates the helicopters when they're supposed to be ready until they get the call from the player (me) -
helicopter transport Hermes Airlift Services Script
RS30002 replied to Gunter Severloh's topic in ARMA 3 - MISSION EDITING & SCRIPTING
well, idk, upon some further testing i dont think it has to do with HAS script, i just noticed it on the vehicles running it first. This is from another map, where there's no radar and vehicles just keep engaging. In the pic below, the helicopters on the deck are tied to HAS, the boat in the welldeck isn't. All are meant to be used by the player, to either get to the island or call support. On the island there's a 4 flag conquest game with lots of AI soldiers going on and with as single respawning vehicle, tied to a flag capture. When that vehicle spawn happens, the ship's cannons engage and the helicopters and the boat all leave the ship and are busy by getting shot down and sometimes, one of them gets a waypoint to 0,0,0 and waits there. (can see in spectator mode) idk why, but originally i thought because of this waypoint, that it maybe has to do something with HAS. -
helicopter transport Hermes Airlift Services Script
RS30002 replied to Gunter Severloh's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I mean it works as advertised on it's own, in the demo mission. But even if i copy the two helicopters from the demo and copy the HAS folder and put everything asin the demo on that map, it's goes to crap. I think it has to do with addons/scripts....idk...was just asking around to see if there's any tips. Gonna shuffle around some assets on that map over the weekend, see what happens. -
helicopter transport Hermes Airlift Services Script
RS30002 replied to Gunter Severloh's topic in ARMA 3 - MISSION EDITING & SCRIPTING
hey, tnx for the response, vanilla, placed on helipad on the LHD. They seem to activate when combat starts and in this example, for some reason the ship's VLS starts shooting at a radar or helicopters ~10km away, which then activates the choppers. one of them gets activated even if i just take off from the ships and do a circle over it. Even if i remove the vls, they seem to get painted by radar as soon as i take off or something.... there is no room to place them on land -
helicopter transport Hermes Airlift Services Script
RS30002 replied to Gunter Severloh's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey, so i have a problem. CAS and transport helicopters just fly away after 20-ish seconds, into the direction of the enemy. Any ideas what could be the cause? They're parked on an LHD. (but it did work the last time i fooled around with arma) ty for any insight -
Hi, i remember i had a snippet for insertion into a trigger/marker and it was esentially a mathematical formula to make a list of objects(trees) and reduce by *2,*3 etc etc anyone have it maybe? ty in advance **************** nvm, i found it...the numbers next to the types are the % reductions diag_log "saroTweakFPS: started"; private _types_array = [ [ ["ROCK"], 50 ], [ ["TREE"], 65 ], [ ["BUSH"], 33 ], [ ["FENCE"], 0 ], [ ["WALL"], 0 ], [ ["HIDE"], 33 ] ]; private _world_half = worldSize / 2; private _world_diag_half = worldSize * 0.70711; private ["_type", "_var", "_dummy"]; _dummy = { _type = _x # 0; _var = _x # 1; _dummy = [_type, _var, _world_half, _world_diag_half ] spawn { private _type = _this select 0; private _var = _this select 1; private _world_half = _this select 2; private _world_diag_half = _this select 3; private _start_time = diag_tickTime; if(_var > 0) then { private _object_count = round (100 / _var); private _objects = nearestTerrainObjects [[_world_half, _world_half], _type, _world_diag_half , false, true]; { if((_forEachIndex + 1) % _object_count isEqualTo 0) then {_x hideObject true;}; } forEach _objects; }; diag_log format [ "saroTweakFPS: Processing %1s took %2 seconds", (_type # 0), ( diag_tickTime - _start_time ) ]; }; } count _types_array;
-
UAV doesn't connect to terminal after spawning
RS30002 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi...am trying to make a mission leveraging the "newly found" spawn composition "skills". Namely, lone bro, traveling around Stratis incognito, making himself accommodations and deploying loitering drones/munitions to harass the military bases that are all occupied on the island. Tent is interactive, you can put stuff in, skip time/heal, it has a toggleable light ๐ Already have the spawn + task scripts for the bases. (still have to figure out the despawning after player leaves but aight) A lot is going good but am having some problems....namely the tests deploying the drone have not been 100%. After spawning the drone, i can see it in the drone select screen drop down menu for only a second. After that it disappears. Anyy suggestions are greatly appreciated! ๐ป uav_1 = createVehicle ["B_UAV_01_F", screen_1 modelToWorld [0,100,200], [], 0, "FLY"]; createVehicleCrew uav_1; uav_1 lockCameraTo [screen_1, [0]]; uav_1 flyInHeight 200; _wp = group uav_1 addWaypoint [position screen_1, 0]; _wp setWaypointType "LOITER"; _wp setWaypointLoiterType "CIRCLE_L"; _wp setWaypointLoiterRadius 50; cam1 = "camera" camCreate [0,0,0]; cam1 cameraEffect ["Internal", "BACK", "uavrtt_1"]; cam1 attachTo [uav_1, [0,0,0], "PiP0_pos"]; cam1 camSetFov 0.2; "uavrtt_1" setPiPEffect [0]; addMissionEventHandler ["Draw3D", { _dir = (uav_1 selectionPosition "PiP0_pos") vectorFromTo (uav_1 selectionPosition "PiP0_dir"); cam1 setVectorDirAndUp [ _dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] ]; }]; [screen_1,[0,"#(argb,512,512,1)r2t(uavrtt_1,1.0)"]] remoteExec ['setObjectTextureGlobal',0,screen_1]; sleep 2; screen_1 addAction [ "Open UAV Terminal", { params ["_target", "_caller", "_actionId", "_arguments"]; _caller linkItem "B_UavTerminal"; waitUntil{ "B_UavTerminal" in assignedItems _caller}; _caller action ["UAVTerminalOpen", _caller]; waitUntil {!isNull findDisplay 160}; if !(isNil "uav_PVC_EH") then{ removeMissionEventHandler ["PlayerViewChanged", uav_PVC_EH]; }; uav_PVC_EH = addMissionEventHandler ["PlayerViewChanged", { params ["_oldUnit", "_newUnit", "_vehicleIn", "_oldCameraOn", "_newCameraOn", "_uav"]; [] spawn{ findDisplay 160 displayAddEventHandler ["KeyDown", " params ['_ctrl', '_dikCode', '_shift', '_ctrlKey', '_alt']; if (_dikCode in (actionKeys 'hideMap') || _dikCode in (actionKeys 'ingamePause')) then{ player connectTerminalToUAV objNull; player unlinkItem 'B_UavTerminal'; removeMissionEventHandler ['PlayerViewChanged', uav_PVC_EH]; }; "]; }; }]; findDisplay 160 displayAddEventHandler ["KeyDown", " params ['_ctrl', '_dikCode', '_shift', '_ctrlKey', '_alt']; if (_dikCode in (actionKeys 'hideMap') || _dikCode in (actionKeys 'ingamePause')) then{ player connectTerminalToUAV objNull; player unlinkItem 'B_UavTerminal'; if !(isNil 'uav_PVC_EH') then{ removeMissionEventHandler ['PlayerViewChanged', uav_PVC_EH]; }; }; "]; }, nil, 1.5, true, true, "", "true", 2, false, "", "" ]; -
so, after a few days of this gnawing at me and me being totally OCD about it (i rly should be trading lmaoo) i finally came up with something that's 99% of what i wanted. ๐ค I went through everything lmaooo, all the road, location combos imaginable lol, some of it had great potential, but would end up at 0,0 ~ every 10 or so attempts (had the script on 0-0-1 and just spammed it) The real breakthrough happened when i realized some of the snippets and functions return objects and not location arrays like i was thinking lol.๐ This one below is almost perfect, some unexplainable magic happens with "_nextRoad = ( roadsConnectedTo _road ) select 0;" making it almost always ending up on a location that has enough room for the structure to not be tilted....idk how to explain it but before using that it ended up on a side of a narrow ridge, tilted way more often. idk It's actually 100%, no 0,0 returns IF i dont specify the blacklist marker. It starts crying sometimes after the addition of the blacklist that it can't find _nextroad....zzzzz....idk maybe ill just have to suffer with having a roadblock at the airfield lmaoooo. #EDIT: with specified whitelist it seems to work better...100% now! Onwards and upwards!!! ๐ช ๐ "|whtlst|[3978.31,4205.47]|Minefield|ELLIPSE|[2120,3870]|194|Border|ColorRed|1|Airfield" call BIS_fnc_stringToMarker; _randomPosMapNoWater = [["whtlst"], ["water"]] call BIS_fnc_randomPos; bcn = createVehicle ["Sign_Sphere10cm_F", _randomPosMapNoWater, [], 0, "CAN_COLLIDE"]; sleep 0.1; _nearestRoad = [getPosATL bcn, 2000] call BIS_fnc_nearestRoad; bcn2 = createVehicle ["Sign_Sphere10cm_F", getpos _nearestRoad, [], 0, "CAN_COLLIDE"]; sleep 0.1; _road = roadAt ASLToAGL getPosASL bcn2; _nextRoad = ( roadsConnectedTo _road ) select 0; _dir = _road getDir _nextRoad; ["roadBlock", getPosATL bcn2, [3,0,-0.2], _dir, true, false, false] call LARs_fnc_spawnComp; sleep 0.1; _playertp = bcn2 getRelPos [15, 90]; sleep 0.1; player setPos _playertp; sleep 0.1; deletevehicle bcn; deletevehicle bcn2; deletemarker "whtlst";
-
Hi, i want to find a random road position to spawn a checkpoint on. At first i was trying with findsafepos but could never successfully plug it in with the follow up code that has to find a road near that safepos...i always ended up at 0,0,0 Then i found this randomRoadPos =[nil, ["water"],{ isOnRoad _this }] call BIS_fnc_randomPos; which looks perfect on paper and even after giving it a few tries, but somehow it doesn't work all the time....sometimes it returns 0,0,0 Many thanks in advance for any insights! ๐
-
Hi, im too stupid for this lmaoooo...can i get a hand pls! i cant get _isFlat out of the loop as a location definition for the spawn point. Been trying with this and variations of this, which is probably now completely fucked up because i kept reshuffling blocks hoping the errors would go away lmaoo "|arfldmrkr|[2203.12,5663.06,0]|Minefield|ELLIPSE|[1100,800]|145|Border|ColorRed|1|Airfield" call BIS_fnc_stringToMarker; sleep 0.1; _all_roads = ( nearestTerrainObjects [[4092.9,4596.33,0], ["Road"], 3500] ) select { not (_x inArea "arfldmrkr") }; _all_roads append ( [4092.9,4596.33,0] nearRoads 3500 ) select { not (_x inArea "arfldmrkr") }; _all_roads = _all_roads arrayIntersect _all_roads; sleep 0.1; _random_road = selectRandom _all_roads; _width = (getRoadInfo _random_road) select 1; _start = (getRoadInfo _random_road) select 6; _end = (getRoadInfo _random_road) select 7; _dir = _start getDir _end; private _isFlat = false; private _startTime = diag_tickTime; private _runTime = 5; while { !_isFlat && diag_tickTime - _startTime < _runTime } do { _random_road = selectRandom _all_roads; _isFlat = !(position _random_road isFlatEmpty [100, -1, 0.1, 50, 0, false, player] isEqualTo []); }; bcn = createVehicle ["Sign_Sphere10cm_F", _isFlat, [], 0, "CAN_COLLIDE"]; // placeholder for offset sleep 0.1; ["roadBlock", getPosATL bcn, [4,0,-0.2], _dir, true, false, false] call LARs_fnc_spawnComp; sleep 0.1; _playertp = bcn getRelPos [15, 90]; sleep 0.1; player setPos _playertp; sleep 0.1; deletevehicle bcn; deletemarker "arfldmrkr"; rpt file ๐ the relevant bits i think 19:53:53 Bad conversion: array 19:53:53 Error in expression <e, player] isEqualTo []); }; bcn = createVehicle ["Sign_Sphere10cm_F", _isF> 19:53:53 Error position: <createVehicle ["Sign_Sphere10cm_F", _isF> 19:53:53 Error 0 elements provided, 3 expected 19:53:53 File C:\Users\rokst\Documents\Arma 3\missions\test%20composition%20spawn.stratis\Checkpoint5.sqf..., line 29 19:53:53 "COMP - Name: roadBlock, Pos:[0,0,0], Offset: [4,0,-0.2], Rot: 153.435, Align: true" 19:53:53 "ITEMS" Many thanks in advance for any insight. I'd let it go or maybe go for a less universal solution but i think this combo of dynamically finding nice places that works on any map with no prior setup + Larrow's composition spawn scripts can work really nice together in many other situations.
-
Ya, maybe you're right and that is something that i would be able to do, but i wanted to try something new and to maybe end up with a technologically better solution than having to place markers, naming them, deleting etc etc...it would also be much simpler to transfer it to other maps. idk, didnt have time to try the new suggestions, will try tomorrow with a fresh mind.
-
It's not cooperating! ๐ด
-
idk....feels like the same thing when i tried the findsafepos. Couldn't combine it with road code. Same here.....have this now _roads_1 = nearestTerrainObjects [[4092.9,4596.33,0], ["Road"], 3500]; _roads_2 = [4092.9,4596.33,0] nearRoads 3500; "|arfldmrkr|[2203.12,5663.06,0]|Minefield|ELLIPSE|[1100,800]|145|Border|ColorRed|1|Airfield" call BIS_fnc_stringToMarker; sleep 0.1; _all_roads = _roads_1 + _roads_2; _all_roads = _all_roads arrayIntersect _all_roads; _bad_roads = _all_roads inAreaArray "arfldmrkr"; _all_roads = _all_roads - _bad_roads; _random_road = selectRandom _all_roads; _width = (getRoadInfo _random_road) select 1; _start = (getRoadInfo _random_road) select 6; _end = (getRoadInfo _random_road) select 7; _dir = _start getDir _end; bcn = createVehicle ["Sign_Sphere10cm_F", _random_road, [], 0, "CAN_COLLIDE"]; // placeholder for offset sleep 0.1; _chkpntpos = !(position bcn isFlatEmpty [100, -1, 0.05, 100, 0, false, player] isEqualTo []); _finalspwnpos = _random_road arrayIntersect _chkpntpos; bcn2 = createVehicle ["Sign_Sphere10cm_F", _finalspwnpos, [], 0, "CAN_COLLIDE"]; // placeholder for offset sleep 0.1; ["roadBlock", getPosATL bcn2, [4,0,-0.2], _dir, true, false, false] call LARs_fnc_spawnComp; _playertp = bcn getRelPos [15, 90]; sleep 0.1; player setPos _playertp; sleep 0.1; deletevehicle bcn; deletemarker "arfldmrkr"; and it says this line _finalspwnpos = _random_road arrayIntersect _chkpntpos; aren't two arrays and it throws an error. says typed object, expected array or something like that. I think it's because _chkpntpos isnt an array at that point, but an already selected singlepoint, but idk for sure..
-
So, in the meantime ive found composition spawn scripts and have been checking it out. Pretty much a superior, almost off the shelf solution compared to the hassle of spawn testing stuff with getrelpos. Bargate works, mg always oriented the right way etc etc Just the flat terrain to sort out now! ๐
-
aight have it like this now _roads_1 = nearestTerrainObjects [[4092.9,4596.33,0], ["Road"], 3500]; _roads_2 = [4092.9,4596.33,0] nearRoads 3500; "|arfldmrkr|[2203.12,5663.06,0]|Minefield|ELLIPSE|[1100,800]|145|Border|ColorRed|1|Airfield" call BIS_fnc_stringToMarker; sleep 0.1; _all_roads = _roads_1 + _roads_2; _all_roads = _all_roads arrayIntersect _all_roads; _bad_roads = _all_roads inAreaArray "arfldmrkr"; _all_roads = _all_roads - _bad_roads; _random_road = selectRandom _all_roads; _width = (getRoadInfo _random_road) select 1; _start = (getRoadInfo _random_road) select 6; _end = (getRoadInfo _random_road) select 7; _dir = _start getDir _end; bcn = createVehicle ["Sign_Sphere10cm_F", _random_road, [], 0, "CAN_COLLIDE"]; // placeholder for offset sleep 0.1; // _chkpntpos = bcn getRelPos [15, 90]; chkpnt = createVehicle ["Land_HBarrier_01_big_tower_green_F", _chkpntpos, [], 0, "CAN_COLLIDE"]; sleep 0.1; chkpnt setDir _dir; sleep 0.1; chkpntmg1 = createVehicle ["I_HMG_02_high_F", [0,0,0], [], 0, "CAN_COLLIDE"]; sleep 0.1; chkpntmg1 attachTo [chkpnt, [0, -2, 1.55]]; sleep 0.1; chkpntmg1 setdir (getDir chkpnt); sleep 0.1; _playertp = chkpnt getRelPos [15, 90]; sleep 0.1; player setPos _playertp; sleep 0.1; deletevehicle bcn; deletemarker "arfldmrkr"; Tbh, it's satisfactory, but if someone asked me to nitpick, id say i really liked the findsafepos gradient parameter. It allowed to filter relatively flat terrain which prevented much of this happening: Also, the offset is kinda suspicious...12 meters should be more than enough to not have any bunker parts on the road but sometimes a third of it is on it. The machine gun also never gets oriented exactly the right way, idk why lol...its 45-90 degrees off the direction of the bunker.
-
aight, got it working real nice now ๐ many thanks to all ๐ป _roads_1 = nearestTerrainObjects [[4092.9,4596.33,0], ["Road"], 3500]; _roads_2 = [4092.9,4596.33,0] nearRoads 3500; _all_roads = _roads_1 + _roads_2; _all_roads = _all_roads arrayIntersect _all_roads; _random_road = selectRandom _all_roads; _width = (getRoadInfo _random_road) select 1; _start = (getRoadInfo _random_road) select 6; _end = (getRoadInfo _random_road) select 7; //_dir = getDir _random_road; _dir = _start getDir _end; bcn = createVehicle ["Sign_Sphere10cm_F", _random_road, [], 0, "CAN_COLLIDE"]; // placeholder for offset sleep 0.1; // _chkpntpos = bcn getRelPos [12, 90]; chkpnt = createVehicle ["Land_HBarrier_01_big_tower_green_F", _chkpntpos, [], 0, "CAN_COLLIDE"]; sleep 0.1; chkpnt setDir _dir; sleep 0.1; _playertp = chkpnt getRelPos [15, 90]; sleep 0.1; player setPos _playertp; sleep 0.1; deletevehicle bcn; its perfect, the direction, the offset ๐ค.....ready to be upgraded with animated bargates, mg nest etc etc #edit after further testing......is there a way to blacklist the roads near and on the airport? I want a remote checkpoint not TSA lol
-
so, helped myself get to here with your initial post _roads_1 = nearestTerrainObjects [[4092.9,4596.33,0], ["Road"], 3500]; _roads_2 = [4092.9,4596.33,0] nearRoads 3500; _all_roads = _roads_1 + _roads_2; _all_roads = _all_roads arrayIntersect _all_roads; _random_road = selectRandom _all_roads; _dir = getDir _random_road; chkpnt = createVehicle ["Land_HBarrier_01_big_tower_green_F", _random_road, [], 0, "CAN_COLLIDE"]; sleep 0.1; chkpnt setDir _dir; sleep 0.1; _playertp = chkpnt getRelPos [5, 90]; sleep 0.1; player setPos _playertp; not sure my way of getting direction is working, i imagined it being perpendicular to the road all the time, but it isnt.... i see youve posted some follow up now in regards to dir so imma check this out ๐
-
Hi, why is the sleep in between these two blocks not really working? Like it lands for a few seconds, turning engine off, the i can hear it rev up again and it flies off, it's on the ground max 5 secs. I tried a bunch of things, taking it's fuel away, disable path....but it never registers the delay fully... _chpdest1 = [5027.59,5904.36,0]; _chppltwp1 = tarugrp1 addWaypoint [[5027.59,5904.36,0], 0]; _chppltwp1 setWaypointType "MOVE"; _chppltwp1 setWaypointSpeed "NORMAL"; sleep 0.05; taru1 flyinheight 200; pad1 = createVehicle ["Land_HelipadEmpty_F", _chpdest1, [], 0, "CAN_COLLIDE"]; waitUntil {taru1 distance pad1 < 250 }; taru1 land "LAND"; if (isTouchingGround taru1) then {deletevehicle pad1;}; sleep 30; _chpdest2 = [4366.28,3816.18,0]; _chppltwp2 = tarugrp1 addWaypoint [[4366.28,3816.18,0], 0]; _chppltwp2 setWaypointType "MOVE"; _chppltwp2 setWaypointSpeed "NORMAL"; sleep 0.05; taru1 flyinheight 200; pad2 = createVehicle ["Land_HelipadEmpty_F", _chpdest2, [], 0, "CAN_COLLIDE"]; waitUntil {taru1 distance pad2 < 250 }; taru1 land "LAND"; if (isTouchingGround taru1) then {deletevehicle pad2;}; Thanks in advance for any insights.
-
nvm i figured it, just increase sleep.... it starts to count immediately after reaching the line where it says it has to wait with counting until something happens? idk...
-
Hi need this getdammage (vehicle player) > 0.6; in a form that recognizes if player is a driver of a plane/helicopter and damage is 60%. Vehicle can't be named. There's a lot of "if () then {}" examples on the net but i cant seem to put together a syntax that only goes into a trigger condition that is supposed to give a task to go repair your vehicle. Right now it gives the repair task if vehicle or player is damaged/hurt. Thanks in advance for any insights! ๐