halex1316
Member-
Content Count
79 -
Joined
-
Last visited
-
Medals
Community Reputation
3 NeutralAbout halex1316
-
Rank
Corporal
Contact Methods
-
Youtube
https://www.youtube.com/channel/UCfrC3S80kXYp-0Z70T9uJdg
-
Steam url id
http://steamcommunity.com/profiles/76561198010331324/
-
Understanding how "param" works
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
So I'm continuing work on this stuff, and I've turned the loot script I hashed out before into a function. params ["_trigger","_radius"]; _weaponArray = [ "srifle_DMR_05_blk_F", "SMG_01_F", "arifle_TRG20_F" ]; _position = getPos _trigger; _houseArray = _position nearObjects ["house",_radius]; howl_itemBoxArray = []; { _buildingPositions = [_x] call BIS_fnc_buildingPositions; { _weapon = _weaponArray select (floor(random(count _weaponArray))); _itemBox = "WeaponHolderSimulated" createVehicle [0,0,0]; _itemBox setPos _x; _itemBox addWeaponCargoGlobal [_weapon,1]; _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); _mag = _magazines select (floor(random(count _magazines))); _itemBox addMagazineCargoGlobal [_mag,5]; howl_itemBoxArray = howl_itemBoxArray + [_itemBox]; } forEach _buildingPositions; } forEach _houseArray; But there's a problem. I originally wanted a marker to take the position. So, in my trigger, I would type : [marker,100] call myTag_fnc_lootspawn; and nothing happens. But, I tried naming the trigger "trig1" and typing in the trigger's init: [trig1,100] call myTag_fnc_lootspawn; and it magically works. I tried changing _position = getPos _trigger; to _position = getMarkerPos _trigger; and it doesn't work. Why can't my call pass the name of a marker to my function? I realize now that the getMarkerPos requires a string, and so changing the call to : ["marker",100] call myTag_fnc_LootSpawn; works. -
Understanding how "param" works
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ahh ok. "_unit" can be defined in the params array, but because _faction needs unit to be defined i.e. faction _unit, it has to be separate in order to refer to the _unit value (whatever that might be). Thank you! That makes more sense now. -
Understanding how "param" works
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
So you can define an optional third parameter using the format: param [2, _parameterNameHere]; ? I'm not sure I still fully understand. Because it seems like this parameter for some reason doesn't need to be defined, but the function would fail if you didn't provide the first two bits of information. What is the difference between the first ones, defined under params and the singular one defined under param? Is the parameter with an index of two just being set to a default there? And that it will take information in the index 2 spot in its place, but only if it's declared when the function is being called? ["dc",this,"gobbledeegook"] call f_fnc_assignGear; in theory, should not do anything then, since "gobbledeegook" is not a faction. -
Hi there, So I was tinkering around in the F3 mission framework, and I'm slowly beginning to understand how CfgFunctions work as defined in the description.ext. There is a particular bit of code that I'm struggling to understand, however. params["_typeofUnit","_unit"]; private _faction = toLower (faction _unit); _typeofUnit = toLower _typeofUnit; _faction = toLower (param[2, (faction _unit)]); So the way this function is called is through : ["dc",this,"ctrg"] call f_fnc_assignGear; So "dc" is sent to "_typeofUnit", and this is sent to "_unit". In this case, "CTRG" is also passed, and I know (outside my knowledge of the code, I know this is a faction), but it isn't defined in the params. The line following this, private _faction = toLower (faction _unit) makes complete sense. It takes this and extracts the faction from it. _typeofUnit = toLower _typeofUnit just makes the input, like "dc" into all lower case. This also makes sense. But then, it looks like _faction is being redefined. _faction = toLower (param[2, (faction _unit)]); is what really doesn't make sense to me. I looked up "param" on the Bi Wiki and got this : I'm having a hard time understanding what is being said here. Can someone explain in some layman speak? Thank you very much!
-
Use of Conditionals for "case" in switch do arguments
halex1316 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, I'm back again with another question! I've been working on building up my skills in scripting and I've hit a roadblock. The end result is a bottom-up script built by myself to spawn loot (cliche, I know). I don't want to take someone else's code - this is kind of a labor of love that I want to go through in order to learn. For this part, I'm trying to create a conditional that will determine what is spawned. I've gone through the route of creating a mess of nested if ( ) then {} else {}; nonsense, and this is not how I want to do it. The script I've created looks like this (just know that it does not work, and I realize this) : _randomNumber = 1000; _randomNumber = (floor(random _randomNumber)); _case = {}; _greaterThan = {if (_randomNumber > 500) then {_case = 1};}; _lessThan = {if (_randomNumber <= 500) then {_case = 2};}; _infoType = {}; switch (_case) do { case 1: {hint format ["%1",_case];}; case 2: {hint format ["%1",_case];}; }; sleep 5; hint "Script is Over"; I've kind of drawn out the logical way I want it to do things. If the number is greater than 500, do the thing that I've defined as the case for things that are greater than 500. But, it seems that case only uses a string or a numerical value... not a range of values, like I might use to determine probability. I don't know exactly how to handle _case (in this example) in order to make it change based on the value of the random number being generated. I know I've got to put one of the _greaterThan or _lessThan into _case, but I'm not sure about the best way to do it. Does anyone have any suggestions? I've looked at the Switch Do wiki page, and checked out the Switch Type page but there was nothing listed there. The code here might not even be what is necessary to do the thing I'm trying to do, but I hope that the way I've written the code shows my intention. Any help is appreciated! -
Understanding References Made to ConfigFile
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I don't think he was suggesting you didn't understand. He quoted me in your message, so it tagged you in them. Not everyone is clear on the topic though, so more responses never hurt. Thank you Larrow! -
Understanding References Made to ConfigFile
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Okay, that explanation helps a lot! Thank you. If something has a scope of 2, being spawnable (and as I'm understanding this, it means it can be placed on the map in the editor, that being different from being placed into the inventory of a unit), that means the same classname ("Weapon_srifle_EBR_F") cannot be placed directly into the inventory of a unit? Instead, it seems I would need to truncate the classname and use just "srifle_EBR_F"? Or can the "Weapon_srifle_EBR_F" be used in both cases - being spawend on the ground, and added to the inventory? I guess I'm wondering if I would need to do this twice, and find two different arrays of weapons to do both of these things (spawning on the ground + adding to inventory). Or can both things be done with the one array we've (you've) created lol. -
Understanding References Made to ConfigFile
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you wouldn't mind humoring my questions a little longer - so I see the magic variable _x . In this case, is it referring to (configFile >> "CfgVehicles") so that, in the line where we are formatting _items, it would actually read: _items = format [ "%1\n%2", _items, getText(configFile >> "CfgVehicles" >> "displayName" ) ]; ? The only use of _x I'm familiar with is, for example: {_x additem "map"} forEach playableUnits How is it applying in this case? I'm getting lost in all of the nested items haha! -
Understanding References Made to ConfigFile
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hmm... So I'm looking in the Editor Config Viewer now, and I see that CfgEditorSubcategories (for example) provides a list of things that I would see in the eden editor (duh!). Is there a way to find a list of these things in the ConfigViewer? So, I realize I can look at the editor and see all of the different Sniper and Marksmen Rifles (for example). When I'm using EdSubcat_SniperRIfles, other than looking in the editor, how do I know what this is referring to? Or is it just as simple as looking at the editor? Thanks! Your explanation helped a lot. Still trying to figure this stuff out. Edit: I see now - the weapon itself, "Weapon_srifle_DMR_03_F" has a value in its config called editorSubcategory = "EdSubcat_SniperRifles"; I think it's really cool that it's possible to build arrays of objects by referring to these shared parameters. -
Understanding References Made to ConfigFile
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Oh, okay. I see that now. So in theory, I could replace "WeaponsPrimary" with "Car", let's say, if I wanted to pull an array of everything that matched that vehicleClass? Thank you for your response! -
Understanding References Made to ConfigFile
halex1316 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, I've taken to reading through a lot of the BI Wiki to learn ArmA scripting, but this example here is eluding my understanding. ___ _cfgArray = "( (getNumber (_x >> 'scope') >= 2) && {getText (_x >> 'vehicleClass') in ['WeaponsPrimary','weaponsSecondary','weaponsHandGuns'] && {_lootArray pushBack ( configName _x ); true} } )" configClasses (configFile >> "CfgVehicles"); So, to clarify what I do understand : scope is pulling the value of scope under the various CfgVehicles. Why it is important to pull this number, I am not sure, because it doesn't look like the value from the first use of getNumber is being used. vehicleClass refers to the thing itself. Like a classname for an object or vehicle (I think). But where it makes the clarification that it is looking "in ['WeaponsPrimary','weaponsSecondary','WeaponsHandGuns'] I do not understand. I've done a lot of searching and I cannot find references to these things anywhere. It doesn't look like it is listed in the config of any gun listed in CfgVehicles. Can anyone explain to me what is happening here while putting together the _cfgArray? Thank you! -
Checks on Tire Health for a Vehicle, and While Statement
halex1316 replied to halex1316's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Oh shit, you're right. For some reason, I was thinking that getHit would pull the HP of the part, which if the HP was 0, which I thought would mean that if it still had HP left, I defined it as the car not being damaged. I was thinking about it all backward. Thanks for the catch on _hi2 and _hit4. -
Checks on Tire Health for a Vehicle, and While Statement
halex1316 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
car sethit ["wheel_1_1_steering", 1]; car sethit ["wheel_1_2_steering", 1]; car sethit ["wheel_2_1_steering", 1]; car sethit ["wheel_1_2_steering", 1]; _hit1 = car getHit "wheel_1_1_steering"; _hit2 = car getHit "wheel_1_2_steering"; _hit3 = car getHit "wheel_2_1_steering"; _hit4 = car getHit "wheel_1_2_steering"; carDamaged = true; carRepaired = false; if ((_hit1 > .1) && (_hit2 > .1) && (_hit3 > .1) && (_hit4 > .1)) then {carDamaged = false}; while {true} do { sleep 1; while {carDamaged} do { sleep 5; carRepaired = false; }; while {!carDamaged} do { carRepaired = true; }; }; I'm trying to do a check for the tires on a vehicle. I want to create a task that requires that each tire be repaired. I'm hesitant to just do a check on the overall damage of the vehicle, because I only want to make sure that the tires (which are destroyed at the start of the script) become fixed. But for some reason, the first if is coming back as false, even though all of the _hit values should be 0, making them less than the .1 requirement. Any ideas? -
Difference between Arma3 Server and Hosting Server Through Client
halex1316 replied to halex1316's topic in ARMA 3 - TROUBLESHOOTING
You're definitely right, Panduhh. I appreciate your response. -
Difference between Arma3 Server and Hosting Server Through Client
halex1316 replied to halex1316's topic in ARMA 3 - TROUBLESHOOTING
So I am hosting the server on another machine - but I'm doing it through the Arma3 Client > Multiplayer > Host Server. Then, I connect to that server with my gaming pc. I was just curious if it made any difference if the server was being run by the arma3server_x64 executable vs. having it hosted: both of these cases would be on a second machine. To answer your questions: I do not have a server.cfg created, I'm just using the TADST program to launch it. The ports are definitely open. On the same note: if a server is hosted and visible on LAN, if it is connected to the internet, will it also be visible in the Internet tab of the server browser? Or will it only show it on LAN because that's the fastest way to see the server? It's difficult to tell if my server is even reaching the internet.