Jump to content

demonized

Member
  • Content Count

    2658
  • Joined

  • Last visited

  • Medals

Everything posted by demonized

  1. AIsoldierFlare v1.3 updated to v1.3 - 25.mar.2011 changelog v1.3 I wanted AI to shoot FLARES when they got engaged or spotted enemy in the dark. So they could put pressure on players using NVG´s against opponents that do not have that technological perk. Now there are all colors flares available through options. Script works with Arma2, OA, or CO, BAF and PMC, as well as compatible with any addon if using curtom weapons option. Script works in MP and on dedicated server as well. Note: v.1.3 is not confirmed on dedi server yet but should be ok. Script will give AI actual light over a area relative to he flare so they can see in the night when flare is up, a certain distance. Default game flares is eyecandy for players only when not using this script, AI is blind as a bat if not using this script or similar. Script can be used by AI from any side, West, East, Guer and Civilian. Script only works when AI is on foot, it pauses when AI in vehicle and resumes when AI is on foot again. Script does not care if its day or night so dont add this to your day missions, unless you want to see flares used in daylight. in v1.3 there is a sun angle option by CarlGustaffa to check day or night, so you can possibly have multiple days missions going without no problem. Script will equip AI with a weapon based on its faction, russians get russian weapons etc. Launcher weapons is preserved if not specified otherwise. Basic Usage:Copy the content from init.sqf to your init.sqf, there is optional EH for players for both MP and SP missions as well. but this is the only line that is important for the script. add this line to your init.sqf or in a trigger or something, as long as its activated before any Ai flare script its ok. AIsoldierFlare_units = []; add minimum this line with your selection in any soldier/civilian units initline, there are several options you can use if you choose so, but this works. wep = [this] execVM "scripts\lightsoldflare.sqf"; If any enemy is detected by AI unit or AI´s group in its patrol or current movement: AI will shoot a flare from its grenade launcher weapon up in the air near or towards enemy detected. This will not magically create a flare in the air, AI will: if he is still alive, manually shoot the flare into the air. Also script works on its own, so you can have 100 AI´s using this same script at the same time in same or different groups, script will not interfeer with it self, or make trouble for any other scripts or waypoints. I tested scripts version 1.2 with upsmon script active as well, and it worked nicely in MP on dedicated server, version 1.3 works nicely with the latest upsmon 5.0.8 R2. With 1 unit and with 100 units no problems, also in full mission with 50 AI groups using upsmon and no impacts, script works in the background. It will not conflict with other movement, only make AI unit pause current move for a second to fire flare and then move on as scripted in upsmon(or other scripts) or waypoints. Readme: Credits: Carl Gustaffa for initial help on v.1 and the crucial light part of script. Das Attorny for help in understanding cfg files, crucial to new weapon selection. BI community, and others for everything posted, and everything answered. Demo mission should work for Arma2, OA, CO since i used baf and pmc units on pmc map: http://www.4shared.com/file/kgdK6ySg/Demo_AIShootFlares_v1_3Proving.html Feel free to modify, skin, strip, bash and trample script at will, if you use it in your own releases it would be nice with a credit line. Also any feedback is welcome, bugs, requests, optimization tips etc. Enjoy
  2. DMZ Delete v 1.1 release v 1.1 - 16 July 2011 REQUIRES Arma2 OA * Its a script wich cleans up any dead man, destroyed vehicle and empty groups (to save the 144 group limit for long missions). * It works for men, land, air, sea vehicles and empty groups. * it includes options to add other objects(ANY) or use custom timer/distance on any object. * It uses no eventhandlers. * options included: abondened vehicles, vehicles that cannot move due to damage, distance so players cannot see the "delete", timers. * You can exclude 1 or several specific units, or even unit classnames or superclasses like all helicopters or combine with all above. * It updates runtime so you can add and remove excluded units/vehicles on the go. v 1.1 also have a included part that can update same way. Maybe someone find it useful. Change log v 1.1 MP functionality: Instructions: DMZ_delete.sqf direct download: Dirty Demo 4Shared: hosted by ArmaHolic, cheers to Foxhound.
  3. Respawn function for Single Player v 1.3. For AI and Player. v1.3 updated 9th july 2011 Requires Arma 2 OA or CO (A2 + OA). This grew from a few lines in a eventhandler to a big project, feel free to wish/request other options/features into this thread. Credits: Notes: Future Upgrades: Changelog v 1.3: place marker called SPR_respawn wherever you want to respawn at. 1: place this in player unit OR AI unit init line: there are also extra options to apply if desired, info in top of script with examples. _null = ["SPR_start",this] execVM "SP_respawn.sqf"; 2: save the script as SP_respawn.sqf 3: adjust the options in top of script to your liking. _timer = 10; // timer until respawn, default is 10 seconds. _delete = 0; // timer until delete of old dead unit, 0 = never. // + more options. 4: place script in your mission folder, done. SP_respawn.sqf
  4. Dont think that works in MP, but i hope i am wrong. If that does not work, try a simple loop in unit init. _null = this spawn { if (!local _this) exitWith {}; while {true} do { waitUntil {sleep 0.5; alive player AND player != leader (group player)}; (group player) selectLeader player; }; }; will run until mission end, and when player is alive and not a teamleader, he will be teamleader.
  5. a trigger with anybody present END type trigger Condition: !alive HVTname OR !(HVTname in thisList) on act: hint "HVTname is either dead or not in the area anymore - mission end";
  6. modifying code from DreadedEntity, using assignedCargo to get only passengers of boat. //code assumes all the boats are named using the editor { { _boat = _x; //dead units can't get out so there's no point in wasting processing time ordering them to if (alive _x AND _x in (assignedCargo _boat)) then { unassignVehicle _x; doGetOut _x; }; } foreach crew _x; } forEach [boat1, boat2, boat3, boat4];
  7. must be related to the wasteland revive system, check in there to find what gives suicide and do your code around that. best ask in wasteland thread.
  8. using isKindOf command witk the cfgVehicles list and you can get loosely or very specifically what killed the unit together with a "killed" eventhandler; note that this is not the cfgVehicles list for arma3, but will give you an idea what to search for when using subgroups, Landvehicle is car is hmwwtow, air is helicopter etc... example: this addEventHandler ["Killed", { _killer = _this select 1; _vehicle = vehicle _killer; if (_vehicle isKindOf "Man") then { hint "its a man"; }; if (_vehicle isKindOf "Tank") then { hint "its a tank"; }; if (_vehicle isKindOf "Plane") then { hint "its a plane"; }; if (_vehicle isKindOf "Helicopter") then { hint "its a helicopter"; }; if (_Vehicle isKindOf "HMMWVTOW") then { hint "its a hmww with tow missiles"; }; }];
  9. try this: place in the init of one of the groupmembers, myGroupName = group this; use the count command with alive in the trigger statement. _emptytrigger setTriggerStatements["{alive _x} count units myGroupName == 0", "hint 'group killed'", "hint 'done'"];
  10. demonized

    heal self

    youre absolutely right, my bad, was at work writing with phone, and obviously not focused :) try this place a global variable in init.sqf: zone1 = true; place a trigger with anyone present, repeatedly. in condition place: zone1 and this on activation: {_x setDammage (getDammage _x + 0.1)} foreach units thisList; zone1 = false; on deactivation: zone1 = true;
  11. demonized

    heal self

    Easy way: repeatedly trigger. Anyone present. { _x setDammage 0.1; } foreach (units thisList); Where you can change amount of damage and the time on trigger. Will damage alle units inside trigger x amount / seconds. ---------- Post added at 11:20 AM ---------- Previous post was at 11:15 AM ---------- Can also use a if statement to determin if unit is in a vehicle or not inside the foreach statement. if (vehicle _x == _x) then {_x setDammage 0.1};
  12. demonized

    trigger condition !alive

    maybe add in setTriggerActivation
  13. from another thread the solution was to weapon setDammage 1;
  14. demonized

    heal self

    wrong classname for toolkit.. "ToolKit"
  15. demonized

    Ammo supply questions

    https://community.bistudio.com/wiki/addMagazineCargoGlobal upon seeing it will be globally broadcasted, i would think you might need to enclose it to only server. if (isServer) then {this addMagazineCargoGlobal["100_Rnd_762_Mag_Belt_TR",30]}; its all depending on type of "respawn" and if you process init or just run the code in the respawn script. Only run the code once, no matter how you do things.
  16. demonized

    Ammo supply questions

    you call the script with //nul = [this] execVM "AAF_Ammo.sqf"; wich would make the crate _this select 0 in the script itself, but you are using _this wich will actually make _this [this] in the script, wich obviously is wrong
  17. demonized

    heal self

    just make use of the condition parameter in addAction: this addAction ["Heal self", "(_this select 1) setDammage 0", nil, 6, true, true, "", [color="#FF0000"]"(getDammage _target) != 0 AND _this == _target AND 'Medikit' in (items _this)"[/color]];
  18. I havent looked at that script in years, i will take a look when i get the chance to.
  19. or put in init of one of the AI groupName = group this; and in the trigger or whenever you want them to leave the heli use the leaveVehicle command groupName leaveVehicle (vehicle (leader groupName));
  20. i feel this code is too much, but maybe it will get you going on creating a more efficient code... its a server side code only created once at mission start, iterates allUnits and adds eventHandlers to them no matter locality player, AI, players AI etc.. and gives them the old "killed" eventhandler wich in turn updates a number, wich is hinted on server with BIS_fnc_MP. Note: a mistake at first, but it seems this local eventhandler broadcasted the number anyway to server even though it should only react locally, maybe too tired... tested quickly in editor, MP hosted and also dedi using TADST dedi tool. if (!isServer OR !isNil "CountDead_fnc") exitWith {}; CountDead_fnc = { _this addEventHandler ["killed", { _side = side (group (_this select 0)); switch _side do { case west: {DeadWestCount = DeadWestCount + 1}; case east: {DeadEastCount = DeadEastCount + 1}; case resistance: {DeadGuerCount = DeadGuerCount + 1}; case civilian: {DeadCivCount = DeadCivCount + 1}; }; }]; }; DeadWestCount = 0; DeadEastCount = 0; DeadGuerCount = 0; DeadCivCount = 0; _null = [] spawn { _added = []; while {true} do { { if !(_x in _added) then { _added = _added + [_x]; [_x, "CountDead_fnc", _x] call BIS_fnc_MP; }; } foreach allUnits; [format ["West units killed %1 \n East units killed %2 \n Resistance units killed %3 \n Civilian units killed %4",DeadWestCount,DeadEastCount,DeadGuerCount,DeadCivCount],"hintSilent"] call BIS_fnc_MP; sleep 1; }; }; you can use the DeadWestCount = 0; DeadEastCount = 0; DeadGuerCount = 0; DeadCivCount = 0; to check for a limit of your choosing. like in a end trigger condition DeadWestCount > 200 etc.... and so on and soforth :D
  21. try using call instead of spawn, what you do now is start a script removing all, then when "started"(NOTE!! it may not yet be completed) start several different scripts equipping. do it in order, call will complete one, then go to next line. _RSF call fnc_removeall; // clothing [_RSF,1] call fnc_giveHeadGear; [_RSF,3] call fnc_giveFaceW; etc.... the only thing you need to change in your functions is add a true without the ; also why have 180 functions, when you can create one removeFunction and one addStuff function, and rather have seperate equipment lists based on type or whatever you seperate units by. it would streamline your work much more and make it a lot easier for you. Example buildup: 1 removeallstuff fnc. 1 addallstuff fnc 1 script called from init.sqf as you have. then in that script find out what type player is and seperate types by switch, and pass a array with info to the add fnc. [[weapon,mags], hat, west, [inventory items], etc.....] then in the add fnc weapon would be [_this sellect 0; wich would return a array where select 0 is the weapon and select 1 is the ammo count. you can add and change and seperate as much you want.... Just a thought.
  22. not sure what was wrong but its working for me now, i changed it a bit so you dont need the onplayerrespawn.sqf, also it should be safe against multiple loops because of players joining, maybe that was the issue.... let me know if it works for you. place this in init.sqf: place the script named UnlimitedAmmo.sqf in your mission folder, good to go, at least in SP and hosted MP, not checked MP dedi, but think it will be ok there to. dont use this part of your code, only what i described above will give all player and AI spawned or respawned or preplaced throughout the entire mission unlimited ammo. // DO NOT USE // [player, 2] spawn grantUnlimitedAmmo; //controls player ammo { if (!(isPlayer _x)) then { [_x, 2] spawn grantUnlimitedAmmo; //controls AI ammo }; } foreach allUnits; //Unlimited Ammo***************************************************** // DO NOT USE //
  23. make your hunting squads in the editor, place this in init of each hunter squad: _null = this spawn { Hunt_players_fnc = { _player = ""; { if (isPlayer _x AND alive _x) then {_player = _x}; } foreach (playableUnits + switchAbleUnits); _wp = _this addWaypoint [getPos _player, (50 + (floor(random 200)))]; _wp setWaypointStatements ["true", "_null = (group this) spawn Hunt_players_fnc;"]; _wp setWaypointType "SAD"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; }; _null = (group _this) spawn Hunt_players_fnc; }; code creates a SAD wp in a random position 250 - 50m around one of the players, they will go search and destroy and when completed create again same way.
  24. Add your item like this on the unit. soldierUnitName linkItem "Land_File2_F"; try using this information from this thread to detect when player takes the document and then do what you want. http://forums.bistudio.com/showthread.php?189561-Trig-condition
×