-
Content Count
4333 -
Joined
-
Last visited
-
Medals
Everything posted by Grumpy Old Man
-
Change mass when sling
Grumpy Old Man replied to DukeVenator's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not sure what you mean, filtering by classNames is already in there. Cheers -
Change mass when sling
Grumpy Old Man replied to DukeVenator's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Something like this: TAG_fnc_handleSlingMass = { params ["_chopper"]; _chopper addEventHandler ["RopeAttach",{ params ["_chopper", "_rope", "_slingLoad"]; _massArray = [["B_Quadbike_01_F",50],["B_T_Boat_Transport_01_F",100]];//quadbike will have 50 mass, boat will have 100 during slingloaded state _vehClasses = _massArray apply {_x#0}; _vehMasses = _massArray apply {_x#1}; _index = _vehClasses find typeOf _slingLoad; _slingLoaded = _slingLoad getVariable ["TAG_fnc_slingLoaded",false];//this is needed because EH fires for every attached rope, so you prevent overwriting the actual mass with the replacement mass if (_index > -1 AND !_slingLoaded) then { _slingLoad setVariable ["TAG_fnc_slingLoaded",true]; _slingLoad setVariable ["TAG_fnc_oldMass",getMass _slingLoad]; _slingLoad setMass _vehMasses#_index; }; }]; _chopper addEventHandler ["RopeBreak",{ params ["_chopper", "_rope", "_slingLoad"]; _oldMass = _slingLoad getVariable ["TAG_fnc_oldMass",200];//200 will be used as a default value _slingLoad setMass _oldMass; }]; true }; _handleMass = [chopper] call TAG_fnc_handleSlingMass; //to test on quadbike named test: onEachFrame {hintSilent format ["Current Mass:%1\nStored Mass: %2",getMass test,test getVariable ["TAG_fnc_oldMass",-1]]}; Cheers -
Making AI ignore specific players
Grumpy Old Man replied to RNM-SpaceGhost's topic in ARMA 3 - MISSION EDITING & SCRIPTING
For proper mission testing environment you can use TADST to set up a local dedicated server to prevent any future surprises. Once set up it's as easy as exporting your edited mission, start the dedi and launch another client to join it. Cheers -
Does white space affect performance?
Grumpy Old Man replied to prototype1479's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Makes sense to speed up websites like that, in arma .sqf files are downloaded with the mission file and usually remain in memory. Unless you broadcast the actual function via network, removing whitespaces in .sqf has no real benefits (unless someone else can come up with one). Cheers -
Does white space affect performance?
Grumpy Old Man replied to prototype1479's topic in ARMA 3 - MISSION EDITING & SCRIPTING
In your regular, run of the mill .sqf files? No. Doubt it's even measurable unless we're talking about 200mb+ files filled with space/tab whitespaces. Cheers -
Making AI ignore specific players
Grumpy Old Man replied to RNM-SpaceGhost's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Of course a simple command won't fix it, how you implement it is up to you. You can always run a loop on the server that checks if a certain player (filtered by UID or what seems to fit) is in the target list or at a certain distance, then use setCaptive and forgetTarget in that specific order. Cheers -
Keep custom armaments on vehicle after respawn
Grumpy Old Man replied to Needleman52's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The respawn module has an expression field that will be executed upon respawn, passed parameters are [newVehicle,oldVehicle], so could go like this: //respawn module expression field: params ["_newVehicle","_oldVehicle"]; _newVehicle addWeaponTurret ["gatling_30mm",[0]]; _newVehicle addMagazineTurret ["250Rnd_30mm_HE_shells",[0]]; _newVehicle addMagazineTurret ["250Rnd_30mm_HE_shells",[0]]; _newVehicle addMagazineTurret ["250Rnd_30mm_APDS_shells",[0]]; _newVehicle addMagazineTurret ["250Rnd_30mm_APDS_shells",[0]]; _newVehicle addMagazineTurret ["250Rnd_30mm_APDS_shells",[0]]; _newVehicle addMagazineTurret ["250Rnd_30mm_APDS_shells",[0]]; _newVehicle addWeaponTurret ["missiles_Jian",[0]]; _newVehicle addMagazineTurret ["4Rnd_LG_Jian",[0]]; _newVehicle addMagazineTurret ["4Rnd_LG_Jian",[0]]; _newVehicle addMagazineTurret ["4Rnd_LG_Jian",[0]]; _newVehicle addMagazineTurret ["4Rnd_LG_Jian",[0]]; _newVehicle addMagazineTurret ["4Rnd_LG_Jian",[0]]; Cheers -
Help: Random Spawn
Grumpy Old Man replied to JohnRayMitch's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Posted this in a thread earlier this week (last week? who knows): GOM_fnc_spawnPatrol = { params ["_pos","_units","_side","_size","_distance"]; _grp = createGroup [_side,true]; for "_i" from 0 to _size do { selectRandomWeighted _units createUnit [_pos, _grp]; }; //patrol random points at n distance while {{alive _x} count units _grp > 0} do { waitUntil {sleep (5 + random 20);unitReady leader _grp AND combatMode leader _grp != "COMBAT"}; _grp move (_pos getPos [random _distance,random 360]); } }; //90% chance to spawn soldier_f, 10% chance to spawn TL_F _units = [ "O_G_Soldier_F",0.9,"O_G_Soldier_TL_F",0.1 ]; _patrol = [getPos player,_units,east,10,50] spawn GOM_fnc_spawnPatrol; Easy to go from there. Cheers -
Vertical align RscStructuredText (using as title bar)
Grumpy Old Man replied to HazJ's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Back in the days we ended arguments under 4 eyes in the backyard of an abandoned factory. Not that easy over forum posts, well maybe I'll live the day to see teleporters become a thing... Doubt that someone other than the dev who implemented it can give a proper reasoning. Same goes for why most script commands are always overriden by default AI (i.e.: make vehicle always have its lights on, no matter the behavior etc...) Only thing I can think of is to somehow work out the screen coordinates of the control, get its center position and align the text from there, your usual workaround. Cheers- 26 replies
-
- 2
-
- rscstructuredtext
- title
-
(and 1 more)
Tagged with:
-
Making AI ignore specific players
Grumpy Old Man replied to RNM-SpaceGhost's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Did you try setCaptive? Cheers -
Script Loading
Grumpy Old Man replied to JohnRayMitch's topic in ARMA 3 - MISSION EDITING & SCRIPTING
CfgFunctions should do the trick, even allows to call functions during pre/postInit, for (vastly) increased performance. Cheers -
Depends on how many missions you want to rotate. If you only have 5 missions and want to play a random mission out of those 5 for 3 or 4 restarts you're absolutely right in seeing a pattern, since the brain is a pattern detection device. Try this: test = ["A","B","C","D","E"]; output = []; for "_i" from 1 to 10 do {output pushBack selectRandom test}; systemchat str output; hint str output; //will print ["E","D","E","A","C","D","E","B","D","C"] //consolidated in order of first occurence: [["E",3],["D",3],["A",1],["C",2],["B",1]] That's bound to happen with a small sample size. Increase the for loop to 100 and see the difference, a more normal distribution on occurrences, the order might still pick the same mission 2-3 times in a row. Better randomize an array of missions to choose from, play through all of them and randomize it again after the last one. Cheers
-
cant get score on server
Grumpy Old Man replied to Walkero0's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Doubt this even works because wlkscore is never initialized. Seems like an odd approach, why not use EntityKilled eventhandler and run it from initServer.sqf? Something like this: //initServer.sqf wlkscore = 0; addMissionEventHandler ["EntityKilled", { params ["_unit", "_killer", "_instigator", "_useEffects"]; if (isPlayer _unit AND side group _unit isEqualTo civilian) then { wlkscore = wlkscore + 30 }; if (!isPlayer _unit and side group _unit isEqualTo independent) then { wlkscore = wlkscore + 3 }; }]; Might be easier to handle everything from the server with a single EH. Cheers -
How to give specific AI significantly more HP
Grumpy Old Man replied to rekkless's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Count the amount of round brackets. A giveaway for any text editor supporting .sqf syntax highlighting. Cheers -
Help: Spawn AI Unit and Begin Patrolling
Grumpy Old Man replied to JohnRayMitch's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The error you're getting depends on what "this" is, first parameter you're passing to bis_fnc_taskPatrol. Here's a barebones version that I enjoy using for simple unit spawning and sending them on patrol: GOM_fnc_spawnPatrol = { params ["_pos","_units","_side","_size","_distance"]; _grp = createGroup [_side,true]; for "_i" from 0 to _size do { selectRandomWeighted _units createUnit [_pos, _grp]; }; while {{alive _x} count units _grp > 0} do { waitUntil {sleep (5 + random 20);unitReady leader _grp AND combatMode leader _grp != "COMBAT"}; _grp move (_pos getPos [random _distance,random 360]); } }; _units = [ "O_G_Soldier_F",0.9,"O_G_Soldier_TL_F",0.1 ]; _patrol = [getPos player,_units,east,10,50] spawn GOM_fnc_spawnPatrol; Using selectRandomWeighted you can dictate the chance which unit class will be picked, in the above case 90% chance to spawn a rifleman, 10% chance to spawn a TL. Can easily enhance this to add custom speedModes and combat modes upon spawning. Cheers -
cgf CfgRadio not found
Grumpy Old Man replied to GHRMC78's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Check the quotation marks. Cheers -
[Release] - Execute scripts/code via chat commands
Grumpy Old Man replied to conroy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
From what I know it's an event where programmers write stuff within a certain timeframe for a certain theme. Cheers -
[Release] GOM - Aircraft Loadout V1.35
Grumpy Old Man replied to Grumpy Old Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Looks like the hydra weapon still stays on the helicopter, pylons removed and 0 ammo, as you stated. On the wipeout the clear all pylons command removes all weapons and pylons correctly, GOM_fnc_clearAllPylons in line 679 of GOM_fnc_aircraftLoadoutInit.sqf is executed to clear all pylons (which works for all vanilla aircraft I tested so far). Feel free to adjust it so it removes any possible remainders (not really sure why the hydra weapon still stays on the chopper even with pylon and mags removed, maybe there's something I missed), the following lines from the aforementioned function should leave no weapon on the aircraft: _pylonWeapons = []; { _pylonWeapons append getArray (_x >> "weapons") } forEach ([_veh, configNull] call BIS_fnc_getTurrets); { [_veh,_x] remoteexec ["removeWeaponGlobal",0] } forEach ((weapons _veh) - _pylonWeapons); Cheers -
Replace few types of magazines with single one?
Grumpy Old Man replied to bl2ck dog's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You could use the take eventhandler and simply check if the item taken is a compatible mag and do your swap. player addEventHandler ["Take", { params ["_unit", "_container", "_item"]; _compatibleMags = ["someClassnames"]; if (_item in _compatibleMags) then { _unit removeMagazine "rhs_30Rnd_545x39_7N10_AK"; _unit addMagazine ["rhs_30Rnd_545x39_AK",_ammoCount]; }; }]; Just an untested quick example, adjust as needed. This will check if the item is in the compatible mag array and switch it out. Cheers -
[Release] GOM - Aircraft Loadout V1.35
Grumpy Old Man replied to Grumpy Old Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Does this happen in an empty mission without mods? If so please post which aircraft and setting (best step by step) is causing this. Cheers -
Elaborate further on how the initial sides have been set up, was the unit initially civ (editor placed civilian)? Cheers
-
ingame Ingame time script
Grumpy Old Man replied to sprucewaine's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Wasn't really helpful during covert ops, I admit. Cheers -
Uhm maybe you're not following through on this one or I'm confused but have you tried using side player to check for a players side? As stated above by @mrcurry, read the whole thing, heh. Cheers
-
Don't try to make everything with one function, make multiple functions that do one thing only. I guess you can also add custom eventhandlers to handle what you need. Cheers
-
Why do you need to use playerSide? Cheers