武装突袭3

武装突袭3

Zombies and Demons
Diara 2017 年 4 月 23 日 下午 11:57
randomLootArrays.sqf
So this script will check for all Rifles (Includes all LMG's, Sniper rifles etc.), Items (Clothing, Medikits etc.), pistols, launchers and finally magazines for that stuff ... Including from any mod you might have installed like CUP, no need to adjust from your side.


These will be written in 5 corresponding Arrays

pistolArray
rifleArray
magazineArray
itemArray
launcherArray

The tricky part is executing it in multiplayer.. In Singleplayer you can just add it into the init.sqf and done.. The Array's will be accessible from your client/server.. but If you want to play in in multiplayer and use Eden for your zombie spawns and settings you have to add the script into the init of the loot module "RyanZM_ModuleLootSettings" (call the script not type it in there plz).

Then you just have to delete the standard fields for example Items (Civilians): [] and replace the [] with the corresponding array you want to be spawned.. like itemArray.





This script is not perfect and needs some work as it will have some errors with spawning a few items when you kills Zombies and then will show and error message whilest picking from the array. The basic function works fine though and performance isn't in any case worse with it.. Zombies drop completly randomized items - works like a charm!

if someone is willing to help me I would be very glad! Enjoy your random spawning :)


(The basic idea behind this script: https://www.youtube.com/user/LAXATiiVS)

---------------------------------------------------------------------------------
pistolArray = []; rifleArray = []; magazineArray = []; itemArray = []; launcherArray = []; // Check for Rifles, Items, Pistols, Launchers _cfgWeapons = "true" configClasses (configFile >> "cfgWeapons"); { _weaponString = configName (_x); _parents = [_x,true] call BIS_fnc_returnParents; if ("Rifle" in _parents) then { rifleArray append [_weaponString]; }; if ("ItemCore" in _parents) then { itemArray append [_weaponString]; }; if ("Pistol" in _parents) then { pistolArray append [_weaponString]; }; if ("Launcher" in _parents) then { launcherArray append [_weaponString]; }; } forEach _cfgWeapons; //Check for Magazines _cfgWeapons = "true" configClasses (configFile >> "cfgMagazines"); { _weaponString = configName (_x); _parents = [_x,true] call BIS_fnc_returnParents; if (("CA_Magazine" in _parents) && !("VehicleMagazine" in _parents)) then { magazineArray append [_weaponString]; }; } forEach _cfgWeapons; // Automation process end //hint format ["%1", rifleArray];
最后由 Diara 编辑于; 2017 年 4 月 23 日 下午 11:59
< >
正在显示第 1 - 4 条,共 4 条留言
Chuc 2017 年 5 月 14 日 下午 4:52 
ill give it ago and tell ya how it went
Chuc 2017 年 5 月 14 日 下午 7:55 
so i cant seem to get this to work.

How do you call it inside module loot settings?

RyanZM_ModuleLootSettings isnt there but this

fn_ModuleLootSettings.sqf

is there. I added

[] execVM "randomLootArrays.sqf";

but that didnt work so i tried

call compile preprocessFileLineNumbers "randomLootArrays.sqf";

I called then at the botttom and the top but niether seemed to work
Diara 2017 年 5 月 15 日 上午 7:15 
引用自 Chuc
so i cant seem to get this to work.

How do you call it inside module loot settings?

RyanZM_ModuleLootSettings isnt there but this

fn_ModuleLootSettings.sqf

is there. I added

[] execVM "randomLootArrays.sqf";

but that didnt work so i tried

call compile preprocessFileLineNumbers "randomLootArrays.sqf";

I called then at the botttom and the top but niether seemed to work

I made you an example mission with the working script:

http://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=926409506

最后由 Diara 编辑于; 2017 年 5 月 15 日 上午 7:15
Chuc 2017 年 5 月 15 日 下午 5:18 
sweet thanks man i spent most of the night with no luck this should help heaps thank you
< >
正在显示第 1 - 4 条,共 4 条留言
每页显示数: 1530 50