Jump to content

Cryptdik

Member
  • Content Count

    104
  • Joined

  • Last visited

  • Medals

Everything posted by Cryptdik

  1. Hey guys, I'm having some trouble with a certain script. I"m using an event handler to apply a SimpleShops script to units spawned by Zeus, and while this works great in single player/Online hosted games, it does not work in a server. I tried some stuff already but decided I had to ask around to figure this out. The way it's currently working, I have this code placed in the GAME MASTER module for Zeus (like I said, this is working except in a server setting): this addEventHandler ['CuratorObjectPlaced',{ { [_x] remoteExec ["HG_fnc_aiUnitSetup", 2]; [_x] execVM "randomItem.sqf"; } forEach crew (_this select 1); }]; I tried some things like changing addEventHandler to addMPEventHandler but it still doesn't work. I feel like the solution should be simple but I can't figure it out so far.
  2. Hey, so I'm trying to make it so SimpleShops's kill rewards works on AI and players alike. It says that you call it by placing this in a unit's init box: https://github.com/Ppgtjmad/SimpleShops/wiki/Kill-Rewards [this] call HG_fnc_aiUnitSetup; I'm trying to adapt this so that I can use it with Zeus and other unit spawning scripts so that it works specifically by just running the function on every unit on the map. I was thinking of doing this by making a repeatable trigger that encompasses the entire map that should call this function on the unit that enters it once, but I can't get it to work. What I tried is making a trigger with Anybody present conditions and OnActivation does: {[this] call HG_fnc_aiUnitSetup} forEach thislist; Nothing I've tried has worked yet. I just need it to run on every unit that spawns on the map or enters a large enough trigger, any tips are appreciated! EDIT: I got it working using the following, BUT I'm getting a strange performance issue where the script must be running constantly. I might need to edit it so it only runs on a unit one time, and only when it spawns/enters the trigger. {_x call HG_fnc_aiUnitSetup} forEach thislist;
  3. I'm not sure, I looked through some of the files that Simple Shops comes with and couldn't find it. Maybe using a script that repeats would be easier than using a trigger? Although that's a whole new bag of trouble for me to try to work out ;_;
  4. I still get the same error, this is the popup: '...)) then { _x call HG_fnc_aiUnitSetup|#|; _x setVariable ["aiSetupDone"...' Error Missing ; I got the trigger to repeat every 5 seconds and it's working with Zeus spawned units now if they're alive long enough for the trigger to repeat. However, it seems to be stacking on units so that the longer they're alive the more money they yield, so the last part is getting it only to run once on them correctly. Condition: this and var1 OnAct: {_x call HG_fnc_aiUnitSetup} forEach thislist; var1=false; hint "trigger"; On Deact: var1=tru Timer - 5 second countdown Repeatable [x] Also, I've noticed that it doesn't seem to affect vehicles from what I can tell, which would be cool but isn't a requirement, as long as players can earn money by killing enemy men I'll be satisfied. I just still can't figure out why it says it's missing a semi-colon in your solution.. Thanks a huge amount for the help btw!
  5. Hmm, I'm getting a missing ";" although I can't see for the life of me where it's missing a semi-colon.
  6. I'm trying to write a basic script to create a task, spawn certain units and then set the task state to completed when said units are killed. In this case, I have the script being called from an objective board object in the mission to spawn boats (starting with just one for now) in a random part in the ocean for the player to hunt down in an A-10. It's calling the script fine because the hint is visible, but I haven't figured out the actual task creation and unit spawning part. Here's what I've got: hint "task1"; _randomPosMapNoLand = [nil, ["ground"]] call BIS_fnc_randomPos; _task1 = ["Assault Boats", {[west, ["Task1"], ["Eliminate the assault boats", "Eliminate boats", _randomPosMapNoLand], _randomPosMapNoLand, 1, 1, true] call BIS_fnc_taskCreate;}] _boat1 = [getMarkerPos "_randomPosMapNoLand", 180, "O_T_Boat_Armed_01_hmg_F", east] call BIS_fnc_spawnVehicle; waitUntil{!(alive _boat1)}; ["Task1", "SUCCEEDED",true] spawn BIS_fnc_taskSetState; Any tips on getting this working are super appreciated!
  7. I need the simplest, most effective helicopter reinforcement script available. I'm trying to make a custom support option that simply: Spawns Helo + Pilot + Reinforcements -> UNLOAD Waypoint at player's position -> MOVE waypoint back to off-map spawning marker -> Delete Helo Very frustratingly, all of the ones I've found are far too complex to use for this, so I guess I have to make my own. Here's what I have so far: _group = [[0,0,0], WEST, ["OPTRE_UNSC_ODST_Soldier_Rifleman_AR", "OPTRE_UNSC_ODST_Soldier_Rifleman_BR", "OPTRE_UNSC_ODST_Soldier_DemolitionsExpert", "OPTRE_UNSC_ODST_Soldier_Automatic_Rifleman", "OPTRE_UNSC_ODST_Soldier_Paramedic", "OPTRE_UNSC_ODST_Soldier_Rifleman_AT", "OPTRE_UNSC_ODST_Soldier_Marksman"],[],[],[],[],[],180] call BIS_fnc_spawnGroup; units _group join (group player); _heli = "OPTRE_Pelican_unarmed" createVehicle getMarkerPos "Pspawn"; _pilot = "OPTRE_UNSC_Marine_Pilot" createVehicle getMarkerPos "PSpawn"; _pilot moveInDriver _heli; {_x moveInCargo _heli} foreach units group _group; (((THIS _GROUP DOESNT WORK HERE, WHAT DO I USE?))) wp1 = _pilot addWaypoint [getpos player,25]; wp1 setwaypointtype"UNLOAD"; wp2 = _pilot addWaypoint [getMarkerPos "PSpawn",25]; wp2 setwaypointtype"MOVE";
  8. Trying to use the BIS_fnc_holdActionAdd function in a unit's Init line so that you can approach them and recruit their group to your group, MP compatible. I've tried a number of variations based on the info here but have had no success: https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd [player, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {(group _target) join (group _caller)}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, _target]; The error I get is: |#|remoteExec ["BIS_fnc_holdActionAdd", 0, _target]; ERROR TYPE ANY Any help is appreciated, I'm not too fluent in scripting.
  9. I think I got it to work by doing this, one for each of the civs in the group. Is there a simpler way to do this yet? [civ1, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ1]; [civ2, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ2]; [civ3, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ3]; [civ4, "Recruit", "", "", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {[civ1, civ2, civ3, civ4] join _caller}, {}, [], 2, nil, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, civ4];
  10. So I'd like to somewhat replicate Dynamic Recon Ops or Combat Patrol missions where you have a set of waypoints on the map to choose from for your mission. I have little idea how to pull this off. Are there pre-made scripts I can use or else some guidelines to script it myself?
  11. In the case that I'm using mods (in this case IFA3) how can I make it so that your ZEUS will only allow units from that mod? So that if I'm using IFA3 to make a ww2 mission you can only make ww2 units.
  12. So I'm wondering how to replicate the APEX campaign's respawn where you select Assault or Support or whatever. I get how to use BIS_fnc_addRespawnInventory to add loadouts but how do I create new categories instead of just "Rifleman" or whatever the basic class is, and then how do I add multiple loadouts to one class? https://community.bistudio.com/wiki/BIS_fnc_addRespawnInventory
  13. Cryptdik

    Respawn Loadout question

    Awesome! Thanks a bunch. But when you say "export a loadout" does that mean it goes to the clipboard for copy/pasting? Or to a file somewhere?
  14. Hmm I've looked through that already, but didn't come up with those commands. Those will help a lot, but how would I disable all of the base ARMA stuff so that you can only spawn stuff from that mod? IFA3 in this case. Is there a way to perhaps disable everything for spawning and then use myCurator addCuratorAddons ["A3_Armor_F_AMV","A3_Armor_F_Panther"]; to make it so you can only use specific units/vehicles that I add to the curator addons, so if you're simply playing as one side I can dictate some infantry and vehicle units to be able to create?
  15. So I'm trying to set it up so that the corpses that get cleaned up consist of only the players (respawning units) and the enemy forces minus vehicles for a defense mission. I'd like to keep the corpses of any friendlies that are in the defensive area for the sake of immersion. If in my description.ext I have corpseManagerMode = 2 so it cleans up player units, how can I also make it clean up any units of a specific side (preferably without removing vehicles, again for immersion)? Would I be able to use a pre-made script? And if so, what would be a good one to accomplish this task? Or else is there a way to make the built in corpse manager work this way?
  16. Cryptdik

    Corpse Cleanup Help

    Sorry I'm a bit slow to pick up some of the syntax shtuff. So from my understanding would I be able to put addToRemainscollector thislist; outside the last }; of the script so that it plays afterwards? Or do I put it in the part that says "SET UP STUFF HERE"? I get the group vs units array part now, but I'm still unsure how to piece this together. Where do I put addToRemainscollector thislist; so that thislist refers to the created groups? EDIT: Wait I realized that you were referring to the trigger set up. I'm going to test it now with addToRemainsCollector thislist; instead of addToRemainsCollector this;
  17. Cryptdik

    Corpse Cleanup Help

    Or simpler, I have a trigger set up to detect BLUFOR units in the area and add them to the garbage collector, but I have a problem with this too. Repeatable BLUFOR PRESENT Cond:this && isNil "garbvar" OnAct: addToRemainsCollector this; garbvar = true; Deact: 0 = [] spawn {sleep 10; garbvar = nil} Problem is I know that addToRemainsCollector this; won't work because it's not referencing the group. How do I make it select the unit/group that activated it to add to the collector?
  18. Cryptdik

    Corpse Cleanup Help

    I've got one more issue with using this. I've been trying to figure out where to put the lines to add the created groups in a script I'm using to the collector. Here's the script that I use to spawn waves of infantry. My issue is that I've placed the addtoremainscollector under several spots throughout the script and cannot find a way to make it work. How can I make this script add the spawned units to the garbage collector? private ["_min_groups", "_max_groups", "_min_group_size", "_max_group_size", "_number_groups", "_man_type"]; private ["_this_speed","_speed","_this_formation","_formation","_formation_count","_this_group","_this_man_odds","_skill_odds","_skill_index"]; _group0 = Creategroup WEST; _group1 = Creategroup WEST; _group2 = Creategroup WEST; _group3 = Creategroup WEST; _group4 = Creategroup WEST; _group5 = Creategroup WEST; _group6 = Creategroup WEST; _group7 = Creategroup WEST; addToRemainsCollector units _group1; addToRemainsCollector units _group2; addToRemainsCollector units _group3; addToRemainsCollector units _group4; addToRemainsCollector units _group5; addToRemainsCollector units _group6; addToRemainsCollector units _group7; // ****************************************************************************************************************************************************************************** // SET UP STUFF IN HERE!!!! _min_groups = 3; // The mimimum number of groups that will be created _max_groups = 4; // The maximum number of groups that will be created. This number CANNOT exceed 8 _min_group_size = 5; // The minimum number of people a group can contain _max_group_size = 7; // The maximum number of people a group can contain. _start_distance = 200; // This is the minimum spawn distance for a group from the trigger point _max_distance = 400; // This is the maximum spawn distance for a group from the trigger point _max_enemy_distance = 100; // This is the maximum distance a group can be from the player as the group follows the player around // ****************************************************************************************************************************************************************************** // // This array contains the type of enemy soldiers that a group can contain. _man_type=["LIB_GER_Soldier2_base","LIB_GER_stggunner","LIB_GER_smgunner","LIB_GER_stggunner","LIB_GER_unterofficer"]; // The man odds give the chances of what type of soldiers the enemy group will contain. 100 is 100% // // For example, if _man_odds_group1=[100,70,60,10,5]; it means that the chances of O_Soldier_F being created are 100 - 70, which is 30%, for // O_officer_F, the chances are 70 - 60 which is 10% chance. And so on. Each group can have different odds. _man_odds_group0=[100,90,60,20,10]; _man_odds_group1=[100,70,60,10,5]; _man_odds_group2=[100,50,40,10,5]; _man_odds_group3=[100,95,40,30,25]; _man_odds_group4=[100,80,20,15,5]; _man_odds_group5=[100,50,40,10,5]; _man_odds_group6=[100,50,40,10,5]; _man_odds_group7=[100,50,40,10,5]; // ****************************************************************************************************************************************************************************** // // These numbers represent the time BEFORE each group will be spawned in. Times are in seconds. // // _group_spawn_delay_min=[0,0,0,0,0,0]; // _group_spawn_delay_max=[0,0,0,0,0,0]; // // The initial delay before any groups are spawned will be 30 seconds + random time of (40 - 30), so 30 seconds + random of 10 seconds. // The next group will spawn at 45 seconds + random time of (60 - 45), so 45 seconds + random of 15 seconds, and so on. _group_spawn_delay_min=[0,0,0,0,0,0,0,0,0]; _group_spawn_delay_max=[0,0,0,0,0,0,0,0,0]; _sleep_delay = 20; // This MUST be at least two times less than any of the _group_spawn_delay numbers // ****************************************************************************************************************************************************************************** // // The _speed_type array contains the various types of speed the group can operate at. _speed_type=["LIMITED","NORMAL","FULL"]; // The _speed_odds array uses the same chance principles as the man odds. // For example, _speed_odds = [100,60,30]; will give 100 - 60, which is 40% chance that the group will have LIMITED speed, and so on. _speed_odds = [100,60,30]; // The _formation_type array contains all the types of formations that each group can move to a waypoint with. _formation_type=["NO CHANGE","COLUMN","STAG COLUMN","WEDGE","ECH LEFT","ECH RIGHT","VEE","LINE","FILE","DIAMOND"]; // The _formation_odds array uses the same chance principles as the man odds. _formation_odds = [100,90,80,70,60,50,40,30,20,10]; // ****************************************************************************************************************************************************************************** _group_skill=[0.2, 0.3, 0.4 ,0.5, 0.6, 0.7, 0.8, 0.9]; _group_skill_level=["Novice","Rookie","Rookie","Recruit","Recruit","Veteran","Veteran","Expert"]; _skill_odds=[100, 95, 85, 70, 50, 30, 15, 5]; // Must contain the same number of entries as _group_skill // ****************************************************************************************************************************************************************************** _all_groups = [_group0, _group1, _group2, _group3, _group4, _group5, _group6, _group7]; _all_man_odds = [_man_odds_group0, _man_odds_group1, _man_odds_group2, _man_odds_group3, _man_odds_group4, _man_odds_group5]; _number_groups = floor(random (_max_groups - _min_groups)) + _min_groups; //hint format ["Groups %1", _number_groups]; _man_number = count _man_type; _formation_count = count _formation_type; private ["_i", "_j", "_k", "_odds", "_table_odds", "_this_man", "_skill_level"]; //hint format ["Position %1, %2",_spawn_position, _number_groups]; _skill_count = (count _group_skill) - 1; // ****************************************************************************************************************************************************************************** _group_counter = 0; _wait_time = 0; _delay_min = _group_spawn_delay_min select _group_counter; _delay_max = _group_spawn_delay_max select _group_counter; _delay_time = (random (_delay_max - _delay_min)) + _delay_min; _wait_time = _wait_time + _delay_time; _skill_index = 0; // hint format ["Initial Delay: %1", _delay_time]; while {alive player} do { if ( time > _wait_time) then { if ( _group_counter < _number_groups) then { _this_group = _all_groups select _group_counter; _this_man_odds = _all_man_odds select _group_counter; _group_size = floor(random (_max_group_size - _min_group_size)) + _min_group_size; _spawn_position = position player; _xpos = _spawn_position select 0; _ypos = _spawn_position select 1; _zpos = _spawn_position select 2; _distance = _start_distance + random (_max_distance - _start_distance); _angle = random 360; _xxpos = (_distance * cos _angle); _yypos = (_distance * sin _angle); _xpos = _xpos + _xxpos; _ypos = _ypos + _yypos; _spawn_position set [0, _xpos]; _spawn_position set [1, _ypos]; _spawn_position set [2, _zpos]; _odds = random (100); for "_i" from 0 to _skill_count do { _table_odds = _skill_odds select _i; if (_odds < _table_odds) then { _skill_index = _i; }; }; // hint format ["_skill_index %1, _skill_count %2", _skill_index, _skill_count]; _skill_level = _group_skill select _skill_index; _skill_level_name = _group_skill_level select _skill_index; for "_i" from 0 to (_group_size - 1) do { _odds = random (100); for "_j" from 0 to (_man_number - 1) do { _table_odds = _this_man_odds select _j; if (_odds < _table_odds) then { _this_man = _j; }; }; _man = _man_type select _this_man; _man createUnit [_spawn_position, _this_group,"this allowFleeing 0", _skill_level, "Private"]; }; // hint format ["ENEMY SPAWNED: Group size %1, Skill: %2", _group_size,_skill_level_name]; _formation = _formation_type select floor random count _formation_type; _wp1 = _this_group addWaypoint [position player, _max_enemy_distance]; _wp2 = _this_group addWaypoint [position player, _max_enemy_distance]; _wp3 = _this_group addWaypoint [position player, _max_enemy_distance]; _wp1 setWaypointBehaviour "AWARE"; _wp1 setwaypointtype "MOVE"; _wp1 setWaypointFormation _formation; _wp1 setWaypointSpeed "Normal"; _wp1 setwaypointstatements ["True", ""]; _wp2 setwaypointtype "MOVE"; _wp3 setWaypointType "Cycle"; _group_counter = _group_counter + 1; _delay_min = _group_spawn_delay_min select _group_counter; _delay_max = _group_spawn_delay_max select _group_counter; _delay_time = (random (_delay_max - _delay_min)) + _delay_min; _wait_time = _wait_time + _delay_time; // hint format ["Initial Delay: %1", _delay_time]; }; }; for "_i" from 0 to (_group_counter - 1) do { _this_group = _all_groups select _i; _odds = random (100); for "_j" from 0 to ((count _speed_odds) - 1) do { _table_odds = _speed_odds select _j; if (_odds < _table_odds) then { _this_speed = _j; }; }; _odds = random (100); for [ {_j=0}, { _j < _formation_count}, { _j =_j+1 } ] do { _table_odds = _formation_odds select _j; if (_odds < _table_odds) then { _this_formation = _j; }; }; _speed = _speed_type select _this_speed; _formation = _formation_type select _this_formation; // hint format ["Speed: %1, Formation: %2", _speed, _formation]; [_this_group, 1] setWaypointSpeed _speed; [_this_group, 1] setWaypointFormation _formation; [_this_group, 1] setWaypointPosition [ getPosATL player, random (_max_enemy_distance) ]; [_this_group, 2] setWaypointPosition [ getPosATL player, random (_max_enemy_distance) ]; }; sleep _sleep_delay; };
  19. Cryptdik

    Corpse Cleanup Help

    Mmkay I see, I think I've got it working. Thanks a bunch!!
  20. Cryptdik

    Corpse Cleanup Help

    So I'm still having trouble making this work. Trying to make it so I can simply add a spawned group to the collector. I've been looking at this: https://community.bistudio.com/wiki/addToRemainsCollector But how can I substitute the unit array with a group name? Something like addToRemainsCollector group "groupname" (I didn't test this) or something like that, so this way it will just add the groups I want to be cleaned without affecting anyone else? Also, In my description.ext I have corpseManagerMode = 2; Could that be affecting this?
  21. Cryptdik

    Corpse Cleanup Help

    Is there a way to make this so that it works on all units of a specific side? Since I'm using a random spawning script it would be much easier to make it simply remove the enemies that continuously spawn.
  22. Here's a good command that doesn't require too much knowledge to use https://community.bistudio.com/wiki/createUnit So basically if you make a trigger that is BLUFOR PRESENT and put this in the activation area: "SoldierWB" createUnit [getMarkerPos "marker_1", group zombies1]; Basically, if you go to click the unit to place in the editor it will highlight a string name for them. What I do is just open notepad and you can hover your mouse over the unit you want to place and then hit Alt Tab to get to the notepad, so it will actually keep the game screen up in the background. What you have to do is replace "SolderWB" with the name that comes up which will usually be something with _ in it. You must also create the marker in the editor that serves as the point to spawn them at, I suggest using the Empty marker that doesn't show up on your map (you can search it in the editor) So basically that trigger will create one unit at that marker in a specific team, and you can do something like this to create a full group of zombies: "zombieclassname1" createUnit [getMarkerPos "marker_1", group zombies1]; "zombieclassname1" createUnit [getMarkerPos "marker_1", group zombies1]; "zombieclassname2" createUnit [getMarkerPos "marker_1", group zombies1]; "zombieclassname2" createUnit [getMarkerPos "marker_1", group zombies1]; This would use make two different zombies if you put two different classnames in there. You can copy/paste that line as many times as you want, so if you want 10 zombies to spawn you'd have ten of those lines instead of four. Doing this will simply make it so not all the units are there on the start of the map, and they will only spawn when you enter the trigger that these lines are in, so if you place one that encompasses a town or something then it will spawn them in it when you have a marker placed in that town and you activate the trigger by entering the area. So in essence, you can set up whatever objectives you want and use this to simply populate the area with zombies upon your arrival to that area. Hope this helps!! Edit: Oh, and if you want more than one group of zombies, such as you have multiple spawns in one map, just rename the "group zombies1" to say "zombies2" for or "zombies3" for whatever group they should be in.
  23. Trying to use a script to spawn AI attackers but the downloaded version is giving me an error. Dynamic AI Spawn System by Lt.Killer(SAS) and Cpt.Killer(SAS) http://www.armaholic.com/page.php?id=28107 I'm getting this error when I execute the script via trigger: |#|private ["_mingroups", "_max_groups", "...' Error Local variable in global space Here's the line it's from: private ["_min_groups", "_max_groups", "min_group_size", "_max_group_size", "_number_groups", "_man_type"]; private ["_this_speed","_speed","_this_formation","_formation","_formation_count","_this_group","_this_man_odds","skill_odds","_skill_index"]; I'm using the IFA3 mod for this, but that shouldn't be causing this problem should it?
  24. So I've noticed in some missions like MP domination, ARMA still lets you use DLC weapons but gives you popups about the DLC. I've also noticed that you aren't able to crew certain DLC vehicles and such. My question is that in terms of mission editing, what in particular will cause your mission to require APEX? For example, if I simply place APEX static objects like decorations, compared to requiring you to pilot a DLC helicopter. Would both cause your mission to require APEX? Or does ARMA let it slide on things like using APEX props and things that aren't necessary to your mission like using certain vehicles or weapons that would only be accessible if you do have APEX I also noticed you aren't able to connect to drones that are DLC that you don't have (in this case the new JETS stealth drone) but in relation to simply using things like DLC props, what will and what won't cause my mission to require APEX or whatever DLC? I know that the DLC maps like Tanoa wouldn't be accessible, but what if I placed APEX objects in my mission that are non-interactive?
  25. BUMP who has good answers for this? I have been unable to find any good information on it myself..
×