Comrades in Arms Discussion Board

Full Version: [COOP 16] Home Unlimited
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Currently I have
Code:
_unit selectWeapon "this";


I see there's some replies at the bottom of the wiki on how to get all muzzles. I'll check that out.
Reading further... I assume muzzlenames in Arma 3 if they have no grenade launchers or something the same as weaponName? If yes that'll make my job easier.
From what I analyzed while testing in the console. The default muzzleName of all the Arma 3 weapons are called "this" . Pretty much all weapons have muzzleName "this" and unbarrel GL have "this" and then their GL's name for muzzleName.

I pretty much already put
Code:
_unit selectWeapon "this";

at the bottom of my code right before
Code:
reload _unit;

Which occurs before the newly added checking for hintSilent parseText format for units that don't have a weapon or uniform.

Adding selectWeapon "this" right after addWeaponGlobal doesn't fix the problem either.
Somehow "this" doesn't sound right when the examples have actual names: player selectWeapon "M203Muzzle";

The second example works for me:
Quote: if ( (primaryWeapon player) != "") then
{
  private['_type', '_muzzles'];

  _type = primaryWeapon player;
  // check for multiple muzzles (eg: GL)
  _muzzles = getArray(configFile >> "cfgWeapons" >> _type >> "muzzles");

  if (count _muzzles > 1) then
  {
    player selectWeapon (_muzzles select 0);
  }
  else
  {
    player selectWeapon _type;
  };
};


A loadout with selectWeapon at the end, I started with the pistol selected.
Code:
if (isNull _this) exitWith {};
comment "Exported from Arsenal by Outlawz7";

comment "Remove existing items";
removeAllWeapons _this;
removeAllItems _this;
removeAllAssignedItems _this;
removeUniform _this;
removeVest _this;
removeBackpack _this;
removeHeadgear _this;
removeGoggles _this;

comment "Add containers";
_this forceAddUniform "U_B_CombatUniform_mcam";
_this addItemToUniform "FirstAidKit";
for "_i" from 1 to 2 do {_this addItemToUniform "30Rnd_65x39_caseless_mag";};
_this addItemToUniform "Chemlight_green";
_this addVest "V_PlateCarrier1_rgr";
for "_i" from 1 to 7 do {_this addItemToVest "30Rnd_65x39_caseless_mag";};
for "_i" from 1 to 2 do {_this addItemToVest "16Rnd_9x21_Mag";};
_this addItemToVest "SmokeShell";
_this addItemToVest "SmokeShellGreen";
_this addItemToVest "Chemlight_green";
for "_i" from 1 to 2 do {_this addItemToVest "HandGrenade";};
_this addHeadgear "H_HelmetB";
_this addGoggles "G_Bandanna_blk";

comment "Add weapons";
_this addWeapon "arifle_MX_ACO_pointer_F";
_this addPrimaryWeaponItem "acc_pointer_IR";
_this addPrimaryWeaponItem "optic_Aco";
_this addWeapon "hgun_P07_F";

comment "Add items";
_this linkItem "ItemMap";
_this linkItem "ItemCompass";
_this linkItem "ItemWatch";
_this linkItem "ItemRadio";
_this linkItem "NVGoggles";

_this selectWeapon (handgunWeapon _this);


Actually, when do you add these loadouts, before or after mission start? Because I start with the pistol selected if it's the only weapon in the loadout.
(12-01-2015, 12:41 PM)Outlawz7 link Wrote: [ -> ]player selectWeapon "M203Muzzle";

Speaking of "wrong", I would never ever use "player" on a dedicated server. This doesn't work at all. Even if you think that the code will only need to run when a player is there, it will cause problems when the player logs in.

Don't ever use it
(12-01-2015, 12:41 PM)Outlawz7 link Wrote: [ -> ]Somehow "this" doesn't sound right when the examples have actual names: player selectWeapon "M203Muzzle";

Actually, it can be the right one, but it is a bad idea. This used to work with all weapons in Arma 2 except for the G36, because the G36 defined its own muzzle. Normally, only a grenade launcher is defined as extra muzzle which is why "this" works... most of the time.
New update:
- Remove hardcode for player array (I'm using switchableUnits and playableUnits to count the players instead depending on whether you're on MP or SP). You should be able to disableAI on the mission without breaking it now.


- Added another Random Marker-Based spawn option. This pretty much is like the last marker spawn randomly on the map and find nearestBuilding except that the marker will be placed only on land and not water (so this will avoid the ocean). This will reduce the super high probability of your town being a coastal town.


- Added nearestLocations based spawn where a randomize Location object from Arma 3 is picked then place a marker around that area and use nearestBuilding to place you in a building in that city, village, etc. There are 5 Random Location parameters to choose from....
+ CityCapital only; CityCapital, City; CityCapital, City, Village; CityCapital, City, Village, Local; Marine (close to ocean)


- I fixed a code for loadouts at the end for hintsilent say the uniform name if you're naked to count uniform instead of count weapons... This is used for debugging purposes in case you guys have no uniforms or weapons.




I think its good enough now. I was testing the crap out of it although I can still find some bugs here and there that I cannot reproduce and disappear when I reload the mission or whatsoever.


Issues I came across:
- After not hardcoding the player spawns, all the spawns that are not predefined by the mission making, may have a chance of not spawning the player at the designated spawn point (so the player is pretty much stuck far away from the objective). I tried to add a hint to switchableUnits count and playableUnits count and it says 16 so that's correct. I had a feeling that something interrupted the code for counting playable or switchable units so it didn't get all the players, not sure. I clicked team switch before the script finished running. I ran the mission again and got same problem some times, then relaunch again multiple time and it was completely okay so I have no idea...


- False negatives with "missing weapons" on hints. Makarovs, CZ Phantom, pistols should have the proper ammo and gun now. I did got a couple X not missing but I already encountered for weapons. I didn't get that anymore though later so no idea....


- naked dude. I swore all the uniforms I tested with forceAddUniform should work. I don't know about the U_Marshall from the Karts DLC for those who don't have it, but I was naked once while testing (low ammo if naked Sad ), but other than that I haven't been naked. No idea on problems, but I'm suspecting the Kart DLC uniform, but I'm not completely sure myself.


Overall, I'm probably about to port this over to Altis soon after my finals. I'm not sure if this post is clear on some points. I'm going to take a break now since my forearms are a bit sore-ish and I can't think much while I'm writing this.
Just tested on dedi again using TADST and didn't notice any problems, but do tell me if you find any. Not sure when random ones do occur.


Oh and I'm wondering if the Spawn Type names are intuitive enough before I release.
Currently working on an Altis port. I'm handpicking some locations to randomized spawn for people who choose to randomize by handpicked locations instead. This is what I currently have so far



Altis Airport Terminal
Cap Strigla
Ghost Hotel
Kastro Castle
Kavala Hospital
Oreokastro Church
Pyrgos Business Complex
Thronos
Zaros Church


9 Locations. Tell me which one you guys might want on the list and I'll add it Big Grin . Altis version will have spot to pick the exact handpick location to play on instead of randomize too if you so desire.
An Altis port, Sweet! I really like this mission Phantom it's awesome. The other day me and Evans played it for like two hours straight. No kidding.

Maybe you could have an option like Urban/Rural spawn and just pick a bunch of random buildings. Several nice spots in Kavala alone. Good locations you have so far but I don't quite get the airport. It's my least favorite location on Stratis as well, to open and flat. Oh and maybe have all weapons but pistols off by default for the player? This mission is definitely best played with pistols only.  8)

Looking forward to the next iteration
I thought the facility was nice enough to be inside. Of course players are inside the airport. You mean Altis, not Stratis. I'm working on the Altis port version.


I assume you suggest that I make it default pistols only? Shall this be for players or enemies too? Default at the moment is pistols, SMGs, shotguns, lee enfields. Of course players can set it, but what'd you think would be the best default values.
(12-11-2015, 09:54 AM)McGregor link Wrote: [ -> ]Oh and maybe have all weapons but pistols off by default for the player?
I support that motion. Pistols are what makes this mission, better set that as the default.
(12-11-2015, 10:48 AM)Phantom link Wrote: [ -> ]I thought the facility was nice enough to be inside. Of course players are inside the airport. You mean Altis, not Stratis. I'm working on the Altis port version.

I mean I don't like the airport setting at all, neither Altis nor Stratis. IMO It's too flat and open. This mission really shines in an urban setting

(12-11-2015, 10:48 AM)Phantom link Wrote: [ -> ]I assume you suggest that I make it default pistols only? Shall this be for players or enemies too? Default at the moment is pistols, SMGs, shotguns, lee enfields. Of course players can set it, but what'd you think would be the best default values.

Pistols for players and let the enemies have all the goodies by default  Smile

Oh and guys we should really consider playing this mission as a "last mission of the night" some times. Just a few people and overwhelming odds makes it extremely fun. Me and Evans took on 60 guys. Ended in glorious death for the both of us but we gave them a hell of a fight
Noted McGregor. And I'll appreciate a reminder.
(12-11-2015, 11:19 AM)Variable link Wrote: [ -> ]Noted McGregor. And I'll appreciate a reminder.

Will do
Mission Updated:
- Players default weapons: Pistols Only
- Enemies default weapons: Everything

Good Luck Big Grin  (I'll probably hide in a house and wait for some dude with a longer weapon to come close so I can pop him to take his gun Smile )
Pages: 1 2 3 4 5