-
Content Count
4313 -
Joined
-
Last visited
-
Medals
Everything posted by Grumpy Old Man
-
How to use setVehicleVarName?
Grumpy Old Man replied to zagor64bz's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can do it all inside the respawn modules edit window. In the modules init field you can define the function, like this: GOM_boatRespawn = {systemchat str _this}; The modules init field will run on every machine, even on JIP so this is a convenient way to initialize the function that should run on respawn. Then in the expression field simply put: call GOM_boatRespawn This will execute GOM_boatRespawn when the vehicle is destroyed, and print the passed parameters into the systemchat as defined by the function. No need to name the boat or anything for the matter. That's really all there is to it. Cheers -
Need help with whitelist scripts...
Grumpy Old Man replied to EinQuantumXo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
As mentioned by @davidoss and @HazJ, the GetInMan EH is your best bet. The most important thing here is, that when entering a vehicle while holding the forward key, the GetInMan EH will fire before the player gets control over the vehicle, so the engine won't turn on and the vehicle won't start moving. Same goes for the vehicle GetIn EH. Quick example: player addEventhandler ["GetInMan",{moveout player}]; Cheers -
comparing equal, but disordered arrays
Grumpy Old Man replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not getting your error, returns true just fine, make sure you're correctly writing either array1 or _array1 and don't forget the semicolons, heh. The arrayIntersect solution posted by @Schatten seems to be the best solution. Cheers -
Change flag from Liberty
Grumpy Old Man replied to Purzel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ah well, can't have enough texture-changing commands, I guess. Cheers -
Change flag from Liberty
Grumpy Old Man replied to Purzel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Just tested my snippet above, doesn't work ingame, during mission runtime, as requested by @purzel. Maybe there's a workaround, no idea for now. Cheers -
SAM system reloading - strange behavior
Grumpy Old Man replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
BI naming convention strikes again, setWeaponReloadingTime doesn't do what the name implies at a first glance, same for playerViewChanged EH (which still confuses the heck out of me how BI came up with that name considering the functionality of the EH, go figure). setWeaponReloadingTime only affects reloading single rounds, not magazines. Check the comments on the page for further info. Cheers -
Change flag from Liberty
Grumpy Old Man replied to Purzel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not tested for quite some time, at least didn't work back when the destroyer came out, maybe it got fixed meanwhile: _destroyer = MyLiberty; _flag = "a3\data_f\flags\flag_csat_co.paa"; _flag = [_destroyer, "ShipFlag_US_F"] call bis_fnc_destroyer01GetShipPart;//retrieves the part holding the flag _flag setObjectTextureGlobal [0,"a3\data_f\flags\flag_csat_co.paa"];//didn't work back when I tested it last time Cheers -
Using "sleep" - How to account for low FPS?
Grumpy Old Man replied to Leopard20's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Engine based script commands will always be faster than calling a function. Chees -
Using "sleep" - How to account for low FPS?
Grumpy Old Man replied to Leopard20's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Don't use the BIS function, use addEventHandler/addMissionEventHandler instead. Cheers -
Using "sleep" - How to account for low FPS?
Grumpy Old Man replied to Leopard20's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not sure what you mean by adding an EH with the same ID as a previous one, since you have no control over which ID an EH receives. Best practice would be to have one single type of eventhandler that does everything, stuff that needs to be done on every frame can be put inside one single eachFrame EH, it's preferred and should execute faster: //bad: { addMissionEventHandler ["EachFrame",{ //do something }]; } forEach allUnits; //preferred: addMissionEventHandler ["EachFrame",{ { //do something } forEach allUnits; }]; Cheers -
Using "sleep" - How to account for low FPS?
Grumpy Old Man replied to Leopard20's topic in ARMA 3 - MISSION EDITING & SCRIPTING
addAction condition is evaluated once each frame, easy test: player addAction ["",{},[],0,false,false,"","diag_log diag_frameno;true"]; //prints the following inside the .rpt: 21:19:17 6061 21:19:17 6062 21:19:17 6063 21:19:17 6064 21:19:17 6065 21:19:17 6066 21:19:17 6067 21:19:17 6068 21:19:17 6069 21:19:17 6070 21:19:17 6071 21:19:17 6072 21:19:17 6073 21:19:17 6074 21:19:17 6075 21:19:17 6076 21:19:17 6077 21:19:17 6078 21:19:17 6079 21:19:17 6080 21:19:17 6081 21:19:17 6082 21:19:17 6083 21:19:17 6084 21:19:17 6085 21:19:17 6086 21:19:17 6087 21:19:17 6088 21:19:17 6089 21:19:17 6090 21:19:17 6091 21:19:18 6092 Cheers -
This won't really help, since I doubt folks want to download the exact same mods you've used just to help debugging. Try loading only the mod needed for the AI gun, and see if the problem persists. Cheers
-
Force AI to equip item from their backpack?
Grumpy Old Man replied to Lineman's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Another solution would be this: _AI action ["TakeWeapon",backpackContainer _AI,"hgun_P07_F"]; If the AI has a P07 in the backpack he will first play some default "take" action and then equip the pistol, if currently no other gun has been equipped. Cheers -
Where can I find a copy of the Beast Bandana IRL?
Grumpy Old Man replied to SpitfirePls's topic in ARMA 3 - GENERAL
So you did want to buy an exact copy of BIs bandana design? Don't assume things about an entire community just from one topic and a few answers, As @HazJ stated, most stuff is more tongue-in-cheek than meant in an insulting/offensive manner, those things are usually handled via PM (have yet to run into anyone deserving this). Did you actually manage to get a bandana printed? How did it turn out? Other than that it could be worthwile trying to contact one of the devs to see if they're willing to send you a higher resolution file of those teeth. Cheers -
Door that opens only with a key
Grumpy Old Man replied to Larpushka's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That depends on how you implement to give individual players access to the locks of buildings. The snippet I linked to already has a variable for each player that's holding buildings they can lock/unlock. You can easily add your own way to handle addition/removal of keys, be it through addAction on a notebook, upon killing a certain unit, etc. Seeing how you want to do this via an item in players inventory this might not be possible in a reliable way, since there are no item IDs, you'd need to track which items are being picked up/dropped by a player, if a player has multiple items there's currently no way to track which one has been in the inventory, and which has recently been picked up. Would be easier to do with simulated items and setVariable/getVariable. Cheers -
Door that opens only with a key
Grumpy Old Man replied to Larpushka's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Made something that could get you started, check this out: Cheers -
Try this: _array = [["launch_NLAW_F","arifle_MX_F","arifle_MX_SW_F","Laserdesignator"],[1,2,1,1]]; _array params ["_keys","_values"]; _merged = _keys apply {[_x,(_values select (_keys find _x))]}; //prints: [["launch_NLAW_F",1],["arifle_MX_F",2],["arifle_MX_SW_F",1],["Laserdesignator",1]] Cheers
-
General Discussion (dev branch)
Grumpy Old Man replied to DnA's topic in ARMA 3 - DEVELOPMENT BRANCH
Just a few sidenotes: Reveal on its own doesn't do much. With a default knowsAbout value of 1 most units won't open fire, since the value is too low, needs to be >1.5 as far as I know, also depends on the units weapons/heading, daytime/overcast and target stance/movement/other factors. If you reveal the player in your example for 1.5 this still won't be enough for the hunter to open fire, but once you start moving he's lighting you up. A reveal of 4 should make the AI open fire in most cases (still depending on heading, line of sight, etc.) There's probably a reason why it's that way, maybe to prevent AI from opening fire as soon as they spot you. Cheers -
Never could get the kbtell system working with .lip files, seems to be broken for the better part of A3s life cycle. The setRandomLip command is erratic at best, sometimes the lips are moving lightning fast, other times it seems to act normal, with no clue what's influencing the lip movement speed. Cheers
-
Using Radio Protocol from script (without usage of description.ext)
Grumpy Old Man posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey folks, wondering how the Radio Protocol is working, especially how commands like "2, move 75 meters, back", "5, join group" come together dynamically and what script commands are being used for this by the engine. I digged around in the cfgVehicles and some stuff like configfile >> "CfgVehicles" >> "ModuleGenericRadio_F" >> "Arguments" >> "Sentence" >> "values" >> "SentGenBaseSideEnemyGUER" used by "ModuleGenericRadio_F" works just fine like that: player directsay "SentGenBaseSideEnemyGUER"; Now if I want to add a few sentences and enhance my mission with it the description.ext is getting clogged up with loads of radio sentences, especially if you want the same speakers for unit+message. After finding the radioprotocol in the cfg there's plenty of stuff to play around with, only thing is I got no clue how to. configfile >> "RadioProtocolENGB" >> "Words" Here you can find pretty much every word used by AI soldiers, the only thing I'm missing is the knowledge of how to use that stuff within scripts. Totally cryptic for me how the engine turns: speech[] = {"XMIT","VehForward"}; into the player saying "Forward", using the correct combatmode, speaker and radiochannel. Any clues? This would be a great achievement for me -
Helicopter and Waypoints
Grumpy Old Man replied to FoxtrotF's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Don't stick to WPs exclusively. Stuff like that is way easier to pull off using script commands, once you wrap your head around it. Cheers -
Eventhandler for throwables
Grumpy Old Man replied to beako's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This will give the player one RGO grenade when he's throwing the last one: player addEventHandler ["Fired",{ params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; _toCheck = "HandGrenade"; _last = magazines _unit findIf {_x isEqualTo _toCheck} < 0; if (_last) then {_unit addMagazineGlobal _toCheck}; }]; Cheers -
Spawning magazine on dead unit
Grumpy Old Man replied to FookinThicc's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not sure about the looking cooler part, you can simply use # instead of select and it has higher priority than math operators, hence you can skip goofing around with brackets: [0,1,2] select 1 + [0,1,2] select 1;// error in expression ([0,1,2] select 1) + ([0,1,2] select 1);// 2 [0,1,2]#1+[0,1,2]#1;// 2 Cheers -
Using addAction in a while loop
Grumpy Old Man replied to Nobody111's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can add the truck type as a condition for the addAction to show, since using a loop would be way too clumsy for this: player addAction ["Blow up car",{ cursorObject setDamage 1; },[],0,true,true,"","typeOf cursorObject isEqualTo 'C_Offroad_01_F'"]; This is also the recommended way instead of adding actions to multiple objects, have the action run on the player and make the condition parameter match your criteria. Cheers -
Spawning magazine on dead unit
Grumpy Old Man replied to FookinThicc's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes, "this" doesn't exist in init.sqf, you need to adjust it to fit your application, taking your first post as an example it could look like this: { _x addEventHandler ["Killed",{ params ["_unit"]; _mag = primaryWeaponMagazine _unit # 0; removeAllWeapons _unit; _unit addMagazineGlobal _mag; }]; } forEach allUnits; Cheers