Search the Community
Showing results for tags 'param'.
Found 4 results
-
This is mainly a comment about unexpected behaviour from the param (and ultimately the params) command. I have this at the start of a function: _houseInf = param [ 1, [], [[]], [0,3] ]; The second parameter I am passing to the function has a value [1,2]. i.e. an array with 2 elements. As the expectedArrayCount is [0,3] I expect it to accept arrays of 0 to 3 element so 2 elements should be fine. However I get an error message: Error 2 elements provided, 0 expected I changed the code to: _houseInf = param [ 1, [], [[]], [1,3] ]; Passing the same value i.e. [1,2] all is now fine. I guess this means you can't check that a passed array is empty. Hope this saves someone some time. S
-
I want a unit to move in a vehicle after respawn but it shows that error code: 17:52:36 Error in expression <_wp = _unit addWaypoint [_pos1, 0];> 17:52:36 Error position: <_unit addWaypoint [_pos1, 0];> 17:52:36 Error Undefined variable in expression: _unit 17:52:36 Error in expression <_unit setWaypointType "MOVE";> 17:52:36 Error position: <_unit setWaypointType "MOVE";> 17:52:36 Error Undefined variable in expression: _unit 17:52:36 Error in expression <_unit setWaypointSpeed "Full";> 17:52:36 Error position: <_unit setWaypointSpeed "Full";> 17:52:36 Error Undefined variable in expression: _unit 17:52:36 Error in expression <_unit setWaypointBehaviour "Combat";> 17:52:36 Error position: <_unit setWaypointBehaviour "Combat";> 17:52:36 Error Undefined variable in expression: _unit 17:52:36 Error in expression <_unit setWaypointType "GETIN NEAREST";> 17:52:36 Error position: <_unit setWaypointType "GETIN NEAREST";> 17:52:36 Error Undefined variable in expression: _unit the script is activated with this in the unit's init:this addMPEventHandler ["MPRespawn", {[_unit] exec "respawnvehiclescript.sqf"}]; the script: _unit = _this select 0; _pos1 = getMarkerPos "Marker1"; _wp = _unit addWaypoint _pos1 _unit setWaypointType "MOVE"; _unit setWaypointSpeed "Full"; _unit setWaypointBehaviour "Combat"; _unit setWaypointType "GETIN NEAREST"; hint "%1 respawned!!!"
- 16 replies
-
params Can't make the mission parameters to work properly
hydrobull3t posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello guys! Not long ago I had posted a topic with a problem in my loadout. I have tried long ago to fix it, but I forgot all of the scripting I have learned so there wasn't much to do... Unit today I had tried again as I am currently in a vacation from my military services (got injured). Well, I figured out that the loadout script and everything is ok, but the problem is much more small than I thought it is. I am using Mission Parameters to choose between Night or Day loadout, Add or Remove NVG according to mission time, as well as Silencer and Map Nav Aids. As the updates started to come the code was outdated, But I have tried couple of time to fix it with no luck.. If someone done it or Know how to fix it, Please reply here, As I want to regroup my old friends to start play again in this awesome MilSim. Loadout Description RPT Log fn_processParamsArray Huge Thanks Guys!!! -
passing parameters getting returns problem
stuguy posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am very familiar with programming and I have been experimenting how ARMA passes variables to functions. I think I understand how params and param work, but I am having difficulty calling a function to return a desired result. This below code is simply trying to call on a function that requires the input of a group, in this instance, I am sending it "group player" with the call function. From what I understand, the function returns the last line, so the count should return the number of men in the group. However, it sends an error stating that it is expecting a number, but is getting type string. This is confusing because I am sending it Group Player, an array of men to be counted. Just writing a count out with "_num = count units group player" works without a hitch. So why is it I am unable to pass it the _grp parameter? getGrpCount = { param ["_grp"]; count units _grp; }; _num = [group player] call getGrpCount; hint format ["%1",_num]; no workie _num = count units group player; hint format ["%1",_num]; works Existing user? Sign In