Hostile civilian weapons?

  1. 8 years ago

    As the title states, is it possible to change the weapons pool that hostile civilians use? im currently using Leights opfor for my Taliban faction and it look kinda strange when they pull a scorpion evo or an FNX-45 on you.

  2. There are some faction-specific weapon pools in the staticData.sqf that might work if you add one with the Lop faction name. Can post more info later.

  3. Don't know if I have this right but I think I've answered my own question here
    so, in the init.sqf I have

    call compile (preprocessFileLineNumbers "staticData.sqf");

    and in staticData.sqf I've got

    waitUntil {!isNil "ALiVE_STATIC_DATA_LOADED"};
    
    // civ weapon pools
    ALIVE_civilianWeapons = [] call ALIVE_fnc_hashCreate;
    [ALIVE_civilianWeapons, "LOP_TAK_Civ", [["rhs_weap_makarov_pmm","rhs_mag_9x18_12_57N181S"],["rhs_weap_akms","rhs_30Rnd_762x39mm"],["rhs_weap_akm","rhs_30Rnd_762x39mm"]]] call ALIVE_fnc_hashSet;

    is this correct, haven't really been able to test

  4. Edited 8 years ago by SpyderBlack723

    Yeah you found it :)

    Your code would look like this though

    // civ weapon pools
    [ALIVE_civilianWeapons, "LOP_TAK_Civ", [["rhs_weap_makarov_pmm","rhs_mag_9x18_12_57N181S"],["rhs_weap_akms","rhs_30Rnd_762x39mm"],["rhs_weap_akm","rhs_30Rnd_762x39mm"]]] call ALIVE_fnc_hashSet;

    Doing

    ALIVE_civilianWeapons = [] call ALIVE_fnc_hashCreate;

    would overwrite the existing data for other factions that has been added, which is why I removed it.

  5. ok, thanks

  6. Just tested this in a mission, seems to work really well.

  7. Edited 8 years ago by GhostNI

    How exactly did you set this up? I would like to try it.
    Can we only get hostile/weapon civs in asymmetric mode?
    I've only ever saw one ever and he had a trg in asymmetric mode.

  8. Edited 8 years ago by SpyderBlack723

    Missed your comment, sorry for the late reply.

    In your init.sqf you must call an external script or function:

    execVM "staticData.sqf";

    Inside the root of your mission folder, create a file named "staticData.sqf". Inside that file, write this:

    if (!isServer) exitWith {};
    waitUntil {!isNil "ALiVE_REQUIRE_INITIALISED"};
    
    _civilianFaction = "LOP_TAK_Civ";
    _weapons = [["rhs_weap_akms","rhs_30Rnd_762x39mm"],["rhs_weap_akm","rhs_30Rnd_762x39mm"]]; 
    [ALIVE_civilianWeapons, _civilianFaction, _weapons] call ALIVE_fnc_hashSet;

    _civilianFaction is a string of the faction name that you used in your ALiVE Civilian Placement modules
    _weapons is an array of possible weapons that civilians might pick up from a weapons depot (asymm) or by being given a rogue command. The array consists of sub arrays of [weapon classname,compatible ammo classname]. With three possible weapons, it would look like

    [[_weapon1,_weapon1ammo],[_weapon2,_weapon2ammo],[_weapon3,_weapon3ammo]]

    You can do some really neat things with this like detecting different addons and using weapons from them accordingly (although it's a bit more advanced), here is a snippet from a file I use in my mission.

    https://gist.githubusercontent.com/SpyderBlack723/5e1018523e197a2ad644/raw/d29e618a3b2a1a7ad06d5af23cc5b82c5c8289e6/gistfile1.txt

    A quick and easy way to get a weapon classname, and it's compatible ammo is this: Make a simple mission in the editor and open the BIS Arsenal. Select your preferred weapon and make sure it has some ammo that will work for that weapon. Pause the game and enter the following code in the debug console:
    copyToClipboard str primaryWeapon player //-- Copies your weapon classname to your clipboard
    copyToClipboard str ((primaryWeapon player) select 0) //-- Copies your weapon's ammo classname to your clipboard

  9. Spyder, I see you have two variations of Leights/RHS staticdata.sqf in here. Is the one directly above me usable out of the gate or will I need to adjust it by searching weapons classes in the editor?

    I don't care what Leight's civs carry. I just want it to be possible for them to be concealing weapons. Also, will I need to do anything to the scripts above to give Leights civs a chance for having grenades or suicide bombs on them or will ALiVE handle that part automatically?

  10. ALiVE handles having weapons/vests etc automatically, nothing is required. The above is simply for customized what weapons you want specific civilian factions to use.

    Referencing above, the gist.github was an example snippet from a mission I had built,

  11. Edited 8 years ago by HeroesandvillainsOS

    I thought yesterday, you said here: http://alivemod.com/forum/1603-middle-eastern-insurgents-civilians-question

    Only a few civilian factions are supported in terms of using native weapons.

    ...that only certain civilian factions would automatically have the possibility of being armed. And that others needed this staticdata.sqf addition.

    So ALiVE will automatically give Leights civilians or civilian classes not on the list you mentioned a percent chance of being armed without the above sqf file?

  12. Edited 8 years ago by SpyderBlack723

    What I meant is, only a few civilian factions are supported in terms of using weapons that they are packaged with, for example, CAF comes with custom AK's. CAF is supported, so they will use those AK's as their weapons. If a faction is not supported, they will fallback to default vanilla weapons.

    Basically, regardless of if a faction is "supported", they will always have the possibility of using weapons.

  13. Got it now! My bad. Thanks for clarifying. I totally read what you said and took it totally the wrong way. Sorry about that. It all makes sense now.

  14. Hmmm wow I didn't even know civilians could have weapons! I've never seen them have a weapon (but I have seem suicide vests) with Leights and Agressors? Do I need to add this script?

  15. It works by default, no scripts needed.

  16. weird I've never seen a civilian with a weapon? Is there a way to check? I've seen fnc_cc_rogue on the debug but when I teleport to it it's either empty or has a suicide bomber?

  17. Pretty sure it's the same message just with weapons on the end instead of rogue. I've noticed it seems more rare and I don't always see it on mission start with debug on but it definitely will work by default without any scripts or tinkering by you.

  18. If they do not have a weapon when you teleport to them, they'll most likely travel to get one.

  19. LOL! That's cool. Where do they get them from?

  20. Edited 8 years ago by SpyderBlack723

    Sometimes they simply pull them out of their pockets (non asymm missions), other times they may travel to a nearby HQ, Depot, Factory.

  21. Newer ›
 

or Sign Up to reply!