Jump to content

Grumpy Old Man

Member
  • Content Count

    4333
  • Joined

  • Last visited

  • Medals

Everything posted by Grumpy Old Man

  1. Grumpy Old Man

    Change flag from Liberty

    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
  2. Engine based script commands will always be faster than calling a function. Chees
  3. Don't use the BIS function, use addEventHandler/addMissionEventHandler instead. Cheers
  4. 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
  5. 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
  6. Grumpy Old Man

    AI Artillery

    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
  7. 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
  8. Grumpy Old Man

    Where can I find a copy of the Beast Bandana IRL?

    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
  9. Grumpy Old Man

    Door that opens only with a key

    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
  10. Grumpy Old Man

    Door that opens only with a key

    Made something that could get you started, check this out: Cheers
  11. Grumpy Old Man

    Arrays apply

    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
  12. Grumpy Old Man

    General Discussion (dev 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
  13. Grumpy Old Man

    setRandomLip

    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
  14. 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
  15. Grumpy Old Man

    Helicopter and Waypoints

    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
  16. Grumpy Old Man

    Eventhandler for throwables

    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
  17. Grumpy Old Man

    Spawning magazine on dead unit

    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
  18. Grumpy Old Man

    Using addAction in a while loop

    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
  19. Grumpy Old Man

    Spawning magazine on dead unit

    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
  20. Grumpy Old Man

    Teleport to Vehicle anyone?

    Thanks. This should get you started: _teleportFrom = teleport1; _teleportInto = car1; _teleportFrom addAction ["Teleport to Car1",{ params ["_object","_caller","_ID","_teleportInto"]; _caller moveInAny _teleportInto; },_teleportInto]; 2 objects on map, one named teleport1, which will teleport the activating player into any vehicle slot of car1. Cheers
  21. Grumpy Old Man

    Spawning magazine on dead unit

    This will add one magazine for the units primary weapon into the units uniform upon death: this addEventHandler ["Killed",{ params ["_unit"]; _mag = primaryWeaponMagazine _unit # 0; removeAllWeapons _unit; _unit addMagazineGlobal _mag; }]; Assuming the unit already has a weapon with a loaded magazine this should work fine. Cheers
  22. Grumpy Old Man

    roadsConnectedTo bug?

    As @.kju stated, results can be erratic at best with certain intersections. From what I can recall @code34 also made some pathfinding functions, wonder if he ever ran into similar problems. The easy way out would be for BI to add some script commands that use the already existing AI pathfinding, but most of us already know how that's working out, heh. Cheers
  23. Grumpy Old Man

    Teleport to Vehicle anyone?

    No, doubt I'm known for anything fun related. Does the link not provide you with plenty of threads covering the topic/similar topics? Cheers
  24. Grumpy Old Man

    Teleport to Vehicle anyone?

    Did you try typing the thread title into google? Cheers
  25. As of now there's no way I know of to tell how a target was spotted. Same goes for which unit has spotted a target. You could make your own check conditions, like line of sight, knowsAbout value, etc., but I doubt this will either be performance friendly or in any sense accurate. Cheers
×