Search the Community
Showing results for tags 'scripting error'.
Found 3 results
-
setcurrentwaypoint Error with SetCurrent Waypoint.
Crotchety_Old_Buzzard posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am getting "Error Type Array, expected Group" when attempting to use setCurrentWaypoint, even though I am putting a group class variable in the correct position in the following script: _grpLiftHeli = createGroup east; _vehLiftHeli = createVehicle ["O_Heli_Transport_04_F", getMarkerPos "wpHeli_1", [], 0, "FLY"]; createVehicleCrew _vehLiftHeli; _vehLiftHeli setDir 240; _grpLiftHeli addVehicle _vehLiftHeli; _wpHeli1 = _grpLiftHeli addWaypoint [getPos wp6, 0]; _wpHeli1 waypointAttachObject TempTarget; _wpHeli1 setWaypointType "HOOK"; _grpLiftHeli setCurrentWaypoint [_wpHeli1, 1]; //group _vehLiftHeli setCurrentWaypoint [_wpHeli1, 1]; The error always gives the setCurrentWaypoint line number with the above listed explanation. I use prefixes that tell me the data type of the variables to avoid these kinds of trouble. As you can see, _grpLiftHeli is the created group I am using. addVehicle and addWaypoint require a Group Data Type for their opening parameters, as does setCurrentWaypoint. I used the same variable "_grpLiftHeli" for all three statements, yet, while addVehicle and addWaypoint give no errors, setCurrentWaypoint gives the "Error Type Array, expected Group" message. In the debug console I watched "xxx = groupID _grpLiftHeli;" and got back "Alpha 2-1", so it seems to be a proper group. I also tried replacing the last code line with the commented code line below it with the same results. I believe my syntax is correct based on BIS wiki, but know I still make mistakes. If anyone can explain this to me, I would be greatly appreciative. EDIT: I forgot to mention that I used the same general setup for creating a vehicle convoy and had no problems with the error. setCurrentWaypoint worked fine. -
Howdy, I'm trying to use a script that I 'borrowed' from a mission a friend shared with me. I believe the original script is by SPUn/LostVar (at least that's who's credited in the files I have), and the files I use were found in the mission "Operation Dagger" by OneShot. I'm getting an error message every time a trigger is tripped that calls on the "fillhouse" script that, in turn calls the "nearestBuilding" script that then calls on the "Patrol-vG" script. I know next to nothing about scripts, but if I read the error correctly, I think the problem is in the patrol-vG script. Anyway, the error popup states... '...t] call LV_nearestBuilding; _building = |#| _buildings select 0; while { alive _un...' Error undefined variable in expression: _buildings File C:\Users\etc\etc Profiles\etc\missions\testA.Altis\LV\Patrol-VG.sqf, line 12 The Patrol-vG script (part of it anyway (I don't want to step on anyones toes y'know...)) is as follows: ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ///////Simple House Patrol script vG 1.3 - SPUn / LostVar // //*infantry units patrols inside nearest building and outside of it //*Syntax: nul = [this] execVM "LV\patrol-vG.sqf"; private ["_unit","_newPos","_i","_i2","_bPoss","_building","_dir","_range","_curPos","_outOrNot"]; if(isNil("LV_nearestBuilding"))then{LV_nearestBuilding = compile preprocessFile "LV\LV_functions\LV_fnc_nearestBuilding.sqf";}; _unit = _this select 0; _buildings = ["nearest one",_unit] call LV_nearestBuilding; _building = _buildings select 0; while { alive _unit }do{ if(isNull(_unit findNearestEnemy _unit))then{ _unit forceSpeed 1; _unit setBehaviour "SAFE"; }; _bPoss = []; _i = 0; while { ((_building buildingPos _i) select 0) != 0 } do { _bPoss set [count (_bPoss), (_building buildingPos _i)]; _i = _i + 1; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ I'm assuming that the "LV_nearestBuilding" code works, since it states that the error occurs in line 12. But like I said...I know very little about scripting. Any help would be greatly appreciated.
-
addAction 11 elements provided, 3 expected
stingray_ posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello, I am trying to add a simple action to a unit and am failing at the most basic step. Below is what I am running in the Extended Debug Console. player addAction ["Hello World", "hint 'Hello'", nil, 1, false, true, "", true, 0, false, ""] I understand the syntax is as follows, object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection] Ref: https://community.bistudio.com/wiki/addAction However, when i execute this statement, I get the following error. 'player |#|addAction ["Hello World", "hint 'Hello'"...' Error 11 elements provided, 3 expected. I have also tried {} instead of "" around the code and that doesn't fix it. It works if i remove everything to the right of the script element but I want to eventually change the condition. Can anyone tell me what i'm doing wrong?