samatra
Member-
Content Count
652 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by samatra
-
Find Safe Position for Composition
samatra replied to Kolmain's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Engine commands: https://community.bistudio.com/wiki/findEmptyPosition https://community.bistudio.com/wiki/selectBestPlaces https://community.bistudio.com/wiki/isFlatEmpty I've used them before but they're not THAT reliable, you'll need to do plenty of testing to make sure that they get you result that you want In other case you can do your own calculations with some of these commands: https://community.bistudio.com/wiki/lineIntersects https://community.bistudio.com/wiki/lineIntersectsObjs https://community.bistudio.com/wiki/lineIntersectsWith https://community.bistudio.com/wiki/terrainIntersectASL -
You're right, on a second look it should be fine. I didn't test or use it, I went through script and missed how you handled Respawn events.
-
From looks of it, actions will not reappear when player will respawn and will remain on dead body.
-
HELP radom loot ammo box
samatra replied to desert_foxhole's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Crate will be cleared each time new player joins the game because your init field will be executed for them again. Disabling simulation is bad idea for crates, you wouldn't be able to properly use items in it, only drop them on ground first and then pickup later. Proper approach: if(isServer) then {clearItemCargoGlobal this; clearWeaponCargoGlobal this; clearMagazineCargoGlobal this;}; this allowDamage false; this addAction ["Activate", "MysteryBox.sqf"]; Reason why your script doesn't work: 1) You select random weapon with BIS_fnc_selectRandom before you define _weapons array 2) You define array of arrays, _wep = _crat select 0; will point to array ["weapon"], not string "weapon" so you either need to get rid of another layer of arrays or change it to _wep = _crat select 0 select 0; and same for magazines. -
Automatic / consecutive numbering in big code blocks (e.g. in description.ext)
samatra replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It doesn't matter how it looks on output, you don't see or use that in game, this is simply a way to check how your file looks after preprocessor to understand what it does. Just make sure that file and its macros are readable and easily editable for you in source (pre-preprocessor) form. Yes, simply have list of INIT_MACRO with whatever indexes you want, you can extend macro to support custom stringtable entry or other parameters. -
Automatic / consecutive numbering in big code blocks (e.g. in description.ext)
samatra replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Alright, macros and preprocessor stuff is rather difficuly to use especially when you have strings there, I'll help you by solving your problem, make sure to learn how it works :) #define STRINGIFY(STRING) #STRING #define CONCAT(LEFT, RIGHT) LEFT##RIGHT #define INTRO_MACRO(INDEX, FILE) \ class STR_intro##INDEX \ { \ name = STRINGIFY(CONCAT(STR_intro,INDEX)); \ sound[] = {FILE, db+0, 1.0}; \ titles[] = {0, $CONCAT(STR_intro,INDEX)}; \ }; INTRO_MACRO(1, "mysound.wss") INTRO_MACRO(2, "blah.wss") INTRO_MACRO(123, "whatever.wss") To make sure that it works execute this like: copyToClipboard preprocessFile "description.ext"; and paste it somewhere to see how your file looks after preprocessor did its magic. ^ Updated to include filename -
Automatic / consecutive numbering in big code blocks (e.g. in description.ext)
samatra replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Start using preprocessor marcos: https://community.bistudio.com/wiki/PreProcessor_Commands -
Copying right from the Wasteland: Start: RscNoise_color = [1,1,1,0.5]; 4 cutText ["", "BLACK", 1]; 5 cutRsc ["RscNoise", "PLAIN", 0.00001]; Stop: 4 cutFadeOut 1; 5 cutFadeOut 1; Change 4 and 5 whatever layers you want.
-
How to detect getting hit by BIS' flare gun?
samatra replied to MrSanchez's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Since flare doesn't trigger HandleDamage your only chance would be HitPart event handler: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HitPart, keep in mind that HitPart has to be added once to all entities\units that can be potentially ignited by flare gun and have to be added where flare pistol shooter is local, not where entity\unit victim is local. -
Unfortunately there is no easy way to give you the code that works as it is connected to lots of other stuff, you'll need to do your own implementation, it is just 3 controls - controls group, structured text inside of it and highlight text that is used as solid rectangle for the flash.
-
Its a Structured Text control inside Controls Group. When new line gets added, colored rectangle appears above it to display a flash. When message times out entire Structured text gets moved down one line and controls group cuts it off.
-
It all depends on mission designer and their vision, if it fits and aids the idea and gameplay mechanics then I don't care if it is real time or accelerated time.
-
house vectorUp in MP
samatra replied to fn_Quiksilver's topic in ARMA 3 - MISSION EDITING & SCRIPTING
setPos weirdly (with delay) aligns objects by the surface normal, use setPosATL\ASL\World instead and always set direction and upwards vectors the last -
Allow 3rd Person View just for Vehicles / helicopters
samatra replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
onEachFrame { if(cameraOn == vehicle player) then { if(vehicle player == player) then { if(driver vehicle player == player) then { if(cameraView == "EXTERNAL") then { player switchCamera "INTERNAL"; }; }; }; }; }; -
Allow 3rd Person View just for Vehicles / helicopters
samatra replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You didn't copy the full code, one }; is missing. Btw I had a typo in condition making it no 3rd person in vehicles instead of when on foot, opposite of what you need. Fixed it in original post and posting here again, make sure to copy full code piece! onEachFrame { if(cameraOn == vehicle player) then { if(vehicle player == player) then { if(cameraView == "EXTERNAL") then { player switchCamera "INTERNAL"; }; }; }; }; Also since onEachFrame is not stackable make sure other scripts don't override it and no 3rd person stops working. -
Need Help With Bons AI Recruitment Mod!
samatra replied to CallMeCoffin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Means you have scripts placed into wrong directory obviously, make sure you have bon_recruit_units directory and open_dialog.sqf script file in it. -
Allow 3rd Person View just for Vehicles / helicopters
samatra replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
init.sqf in my case. -
How to Open Strategic Map in a Control
samatra replied to doubleblind's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Never dealt with it but I'd suggest to unpack functions_f.pbo and look at the implementation, maybe even clone the function and adjust to your needs. -
Allow 3rd Person View just for Vehicles / helicopters
samatra replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
onEachFrame { if(cameraOn == vehicle player) then { if(vehicle player == player) then { if(cameraView == "EXTERNAL") then { player switchCamera "INTERNAL"; }; }; }; }; -
Dedicated Server spawned weaponholders take > 1,5 mins to sync (network issue?)
samatra replied to MrSanchez's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Do you create your weapon holder right at the server start? (CfgFunctions preinit\postinit, vehicles init line execution time) -
"(side _x == west)" problems
samatra replied to T. Miller's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Do it through public variable. playableUnits has list of alive player-controller units so if you're going to create markers while player is dead, it wouldn't work. Server code, call on server whenever you need to create markers for everyone: createMarkersPlease = true; publicVariable "createMarkersPlease"; // If player is hosting the game, they should also get the markers if(!isDedicated) then {call createMarkersPleaseFunc}; Client code: "createMarkersPlease" addPublicVariableEventHandler { call createMarkersPleaseFunc; }; createMarkersPleaseFunc = { if(playerSide == blufor) then { //... createMarkerLocal ... }; }; -
Extract array postion of highest value in array
samatra replied to drunken officer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ah, I was expecting it to be an array of units, forEach (units tango31) indeed then. -
Extract array postion of highest value in array
samatra replied to drunken officer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
private ["_index", "_highest"]; _index = -1; _highest = -1; { if(_x getVariable ["DOF_RANK", -1] > _highest) then { _highest = _x getVariable ["DOF_RANK", -1]; _index = _forEachIndex; }; } forEach units tango31; _highest would be your highest rank, _index would be index of unit with this rank in the array -
agents is extremely fast scripting command, also thread runs in scheduled environment, performance impact should be is minimal. Keep in mind that animals that constantly do path finding do hurt performance so theoretically in the end there actually should be performance gain after deletion.
-
I can suggest a simple scripting solution To constantly delete all animals (including fish): true spawn { waitUntil { {deleteVehicle agent _x;} forEach agents; sleep 0.01; false; }; }; To delete just rabbits and snakes: true spawn { waitUntil { { if(agent _x isKindOf "Rabbit_F" || agent _x isKindOf "Snake_random_F") then { deleteVehicle agent _x; }; } forEach agents; sleep 0.01; false; }; }; Run one of these scripts once on each client.