Jump to content
Sign in to follow this  
jandrews

RPT errors question

Recommended Posts

Don't know if you already fixed it, but regarding your bomb car:

_bomb1 = createVehicle [_rndBomb, [(getMarkerpos _newPos) select 0, (getMarkerpos _newPos) select 1, 0], [], 0, "NONE"];

and regarding the truck problem:

_men1 = (createGroup civilian) createUnit ["I_Soldier_TL_F", [((getPos _truck) select 0) + 8, (getPos _truck) select 1, 0], [], 0, "NONE"];
//or whatever side he's from

You may not create units outside any groups.

Edited by Heeeere's Johnny!

Share this post


Link to post
Share on other sites

ok. thanks and I will do some changing after work. thanks.

Share this post


Link to post
Share on other sites

New question. I want to create some vehicles over water for waterOPs. however these decide to spawn over land. what am I missing here AND if I set the z to -10 wouldn't that be the same as setPos line?

//creating the vehicle

_newPos = [getMarkerPos _markerAO, 0, 10, 10, 2, 0, 0] call BIS_fnc_findSafePos; <--- this is set to spawn over water correct? I believe so.

_SDV = createVehicle ["O_SDV_01_F",[((_newPos select 0) + 10), (_newPos select 1),0],[], 2, "CAN_COLLIDE"]; <---- can I set z to -10 for vehicle height? and not use setPos?

_SDV setDir random(359);

_SDV setPos [getPos _SDV select 0, getPos _SDV select 1, (getPos _SDV select 2) -10]; < ---- lose this line?

_SDV1 = createVehicle ["O_SDV_01_F",[((getPos _SDV select 0) + 10), (getPos _SDV select 1),0],[], 2, "CAN_COLLIDE"]; <---- can I set z to -10 for vehicle height? and not use setPos?

_SDV1 setDir random(359);

_SDV1 setPos [getPos _SDV1 select 0, getPos _SDV1 select 1, (getPos _SDV1 select 2) -15]; < ---- lose this line?

_trg = createTrigger["EmptyDetector", getPos _SDV];

_trg setTriggerArea[250, 250, 0, false];

_trg setTriggerActivation["EAST", "NOT PRESENT", false];

_trg setTriggerStatements["this && {{

_sdv = _x;

Share this post


Link to post
Share on other sites

All the "z" input is, is the "depth"/altitude of the object/vehicle, so all changing the "z" value will do is change the depth of the sub in the water, _SDV being 10m into the water, _SDV1 being 15m into the water.

Sorry, misread a bit, yes it would make sense that should work, but if it doesn't then just use setPos again.

As far as them spawning on land, with what you have, _newPos is only looking for a safe position in a 10m radius around the _markerAO, so I would recommend making sure that either the marker is directly over a water area, or expanding the radius that BIS_fnc_findSafePos is looking for.

Share this post


Link to post
Share on other sites
All the "z" input is, is the "depth"/altitude of the object/vehicle, so all changing the "z" value will do is change the depth of the sub in the water, _SDV being 10m into the water, _SDV1 being 15m into the water.

Sorry, misread a bit, yes it would make sense that should work, but if it doesn't then just use setPos again.

As far as them spawning on land, with what you have, _newPos is only looking for a safe position in a 10m radius around the _markerAO, so I would recommend making sure that either the marker is directly over a water area, or expanding the radius that BIS_fnc_findSafePos is looking for.

So I should be able to use:

_newPos = [getMarkerPos _markerAO, 50, 50, 50, 2, 0, 0] call BIS_fnc_findSafePos;

_SDV = createVehicle ["O_SDV_01_F",[((_newPos select 0) + 10), (_newPos select 1), - 15],[], 2, "CAN_COLLIDE"];

_SDV setDir random(359);

I would use (-) not (+) for vehicle to spawn in water correct? And I expanded the distance for min/max/min for vehicle to spawn off _markerAO and from objects. I will test later. just want to make sure its setup correctly.

Share this post


Link to post
Share on other sites

Yes that should work, and to clarify the "z" axis is just the "up and down" of the object, so in this case is the SDV above or below the surface of the water, so if by "spawn in the water" you mean "in" as in below the surface, then yes, that is what a (-) would do. And for the third 50 in your set of arguments, that is the:

minimum distance from the nearest object

So you won't want that too high, that one can probably stay at 5-10m.

Share this post


Link to post
Share on other sites

MORE RPT FUN == Not sure on any of these. Any help is always appreciated. Its a lot I know. trust me. If I knew.....:681:

call compile preprocessFile "scripts\downloadData.sqf";
call compile preprocessFile "scripts\secureBomb.sqf";

waitUntil { !isNil "downloadDataDONE" };
waitUntil { !isNil "secureBombINIT" };


if ( !isServer ) exitWith {}; 

sleep 10; // I dont know why, but some sleep is requied or the Actions on the Objects wont work ... this is beyond my knowledge 

[ [_bomb1], "T8_SB_fnc_addAction", true, true] spawn BIS_fnc_MP;
[ [_Drone1], "T8_fnc_addActionLaptop", true, true] spawn BIS_fnc_MP;

ERROR

20:28:08 Error in expression <sServer ) exitWith {};

sleep 10;

[ [_bomb1], "T8_SB_fnc_addAction", true, tr>

20:28:08 Error position: <_bomb1], "T8_SB_fnc_addAction", true, tr>

20:28:08 Error Undefined variable in expression: _bomb1

20:28:08 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\init.sqf, line 47

20:28:09 Error in expression < format [ "%1_%2", "T8_pubVarDataTask", _x ];

_cDT = missionNamespace getVariabl>

20:28:09 Error position: <_x ];

_cDT = missionNamespace getVariabl>

20:28:09 Error Undefined variable in expression: _x

20:28:09 Error in expression <this;

};

T8_SB_fnc_addAction =

{

_this addAction [ T8_SB_varTLine01, "call T8_S>

20:28:09 Error position: <addAction [ T8_SB_varTLine01, "call T8_S>

20:28:09 Error addaction: Type Array, expected Object

//creating the vehicle

_newPos = [getMarkerPos _markerCO, 0, 50, 10, 0, 20, 0] call BIS_fnc_findSafePos;

_mrap = [[((_newPos select 0) + 20), (_newPos select 1),0],random(359),"O_MRAP_02_hmg_F",East] call BIS_fnc_spawnVehicle;
_mrap setFuel 0;

ERROR

20:28:13 Error in expression <,East] call BIS_fnc_spawnVehicle;

_mrap setFuel 0;

_hq = [[((getPos _mrap selec>

20:28:13 Error position: <setFuel 0;

_hq = [[((getPos _mrap selec>

20:28:13 Error setfuel: Type Array, expected Object

20:28:13 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 32

//creating the vehicle

_newPos = [getMarkerPos _markerCO, 0, 50, 10, 0, 20, 0] call BIS_fnc_findSafePos;

_arty1 = [[((_newPos select 0) + 20), ((_newPos select 1) - 10),0],random(359),"O_MBT_02_arty_F",East] call BIS_fnc_spawnVehicle;
nul = [_arty1,(getMarkerPos _markerCO), 0] call BIS_fnc_taskDefend;
_arty1 setFuel 0;
_arty1 setVehicleAmmo 1;
_covernet = createVehicle ["CamoNet_OPFOR_big_F", getPos _arty1, [], 0, "CAN_COLLIDE"];
_covernet attachTo [_arty1,[0,0,0]];
sleep 1;
detach _covernet;

ERROR

20:28:40 "Andrews/log: ERROR: [bIS_fnc_setRank] is not a valid rank"

20:28:43 "Andrews/log: ERROR: [bIS_fnc_setRank] is not a valid rank"

20:28:46 "Andrews/log: ERROR: [bIS_fnc_setRank] is not a valid rank"

20:29:53 "Andrews/log: ERROR: [bIS_fnc_setRank] is not a valid rank"

20:29:53 Error in expression <CO), 0] call BIS_fnc_taskDefend;

_arty1 setFuel 0;

_arty1 setVehicleAmmo 1;

_cov>

20:29:53 Error position: <setFuel 0;

_arty1 setVehicleAmmo 1;

_cov>

20:29:53 Error setfuel: Type Array, expected Object

20:29:53 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 849

_hq = [[(_newPos select 0), (_newPos select 1),0],random(359),"O_G_Offroad_01_armed_F",East] call BIS_fnc_spawnVehicle;

_cache = createVehicle ["O_supplyCrate_F",[((getPos _hq select 0) + 15), ((getPos _hq select 1) - 5),0],[], 0, "NONE"];
_cache setDir random(359);
_covernet = createVehicle ["CamoNet_OPFOR_F", getPos _cache, [], 0, "CAN_COLLIDE"];
_covernet attachTo [_cache,[0,0,0]];
sleep 1;
detach _covernet;

ERROR

20:29:53 Error in expression <e = createVehicle ["O_supplyCrate_F",[((getPos _hq select 0) + 15), ((getPos _hq>

20:29:53 Error position: <getPos _hq select 0) + 15), ((getPos _hq>

20:29:53 Error getpos: Type Array, expected Object,Location

20:29:53 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 160

waitUntil {!alive _radar && !alive _AA && !alive _AA1 && !alive _AA2 && !alive _AA3};

ERROR

waitUntil {!alive _radar && !alive _AA && !alive _AA1 && !alive _AA2 >

20:32:27 Error position: <alive _AA && !alive _AA1 && !alive _AA2 >

20:32:27 Error alive: Type Array, expected Object

20:32:27 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 941

waitUntil {!alive _rtower && !alive _devicehq && !alive _hq};

ERROR

waitUntil {!alive _rtower && !alive _devicehq && !alive _hq};

_null =>

20:32:42 Error position: <alive _devicehq && !alive _hq};

_null =>

20:32:42 Error alive: Type Array, expected Object

20:32:42 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 583

_specapc = [[((getPos _spebase select 0) - 15), ((getPos _spebase select 1) + 5),0],random(359),"O_APC_Wheeled_02_rcws_F",East] call BIS_fnc_spawnVehicle;
nul = [_specapc,(getpos _spebase), 15] call BIS_fnc_taskDefend;
_covernet1 = createVehicle ["CamoNet_OPFOR_big_F", getPos _specapc, [], 0, "CAN_COLLIDE"];
_covernet1 attachTo [_specapc,[0,0,0]];
sleep 1;
detach _covernet1;

ERROR

20:32:55 Error in expression <= createVehicle ["CamoNet_OPFOR_big_F", getPos _specapc, [], 0, "CAN_COLLIDE"];

>

20:32:55 Error position: <getPos _specapc, [], 0, "CAN_COLLIDE"];

>

20:32:55 Error getpos: Type Array, expected Object,Location

20:32:55 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 462

_sniper1 = [getPos _hq, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OI_SniperTeam")] call BIS_fnc_spawnGroup;
nul=[_sniper1, (getpos _hq), 20]; call BIS_fnc_taskDefend;
_sniper1 setBehaviour "STEALTH";
_sniper1 setCombatMode "RED";
_sniper1 setDir random(359);

ERROR

20:32:59 Error in expression <

_sniper1 setCombatMode "RED";

_sniper1 setDir random(359);

_sniper2 = [getPos >

20:32:59 Error position: <setDir random(359);

_sniper2 = [getPos >

20:32:59 Error setdir: Type Group, expected Object

20:32:59 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 333

waitUntil {!alive _shed && !alive _house && !alive _APC && !alive _APC1};

ERROR

20:33:02 Error in expression <ntil {!alive _shed && !alive _house && !alive _APC && !alive _APC1};

_null = [[>

20:33:02 Error position: <alive _APC && !alive _APC1};

_null = [[>

20:33:02 Error alive: Type Array, expected Object

20:33:02 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 1007

waitUntil {!alive _hq && !alive _offr && !alive _rammo};

ERROR

enemyDead = false;

waitUntil {!alive _hq && !alive _offr && !alive _ram>

20:33:03 Error position: <alive _hq && !alive _offr && !alive _ram>

20:33:03 Error alive: Type Array, expected Object

20:33:03 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 405

//creating the vehicle

_newPos = [getMarkerPos _markerCO, 0, 50, 10, 0, 20, 0] call BIS_fnc_findSafePos;

_newOffsetPos = [((_newPos select 0) + 20), ((_newPos select 1) - 10), (_newPos select 2)];

_camps_classes = ["CampA","CampB"] call BIS_fnc_selectRandom;

_hq = [(getMarkerPos _markerCO), EAST, (configfile >> "CfgGroups" >> "Empty" >> "Guerrilla" >> "Camps" >> (_camps_classes))] call BIS_fnc_spawnGroup;  

_or1 = [[((getPos _hq select 0) + 10), (getPos _hq select 1),0],random(359),"I_G_Offroad_01_armed_F",East] call BIS_fnc_spawnVehicle;
nul = [_or1,(getpos _hq), 0] call BIS_fnc_taskDefend;

ERROR

20:33:05 Error in expression < call BIS_fnc_spawnGroup;

_or1 = [[((getPos _hq select 0) + 10), (getPos _hq >

20:33:05 Error position: <getPos _hq select 0) + 10), (getPos _hq >

20:33:05 Error getpos: Type Group, expected Object,Location

20:33:05 File C:\Users\Andrews\Documents\Arma 3\missions\COOP_30_Altis_SOW.Altis\scripts\makeClearOps.sqf, line 629

Edited by JAndrews1

Share this post


Link to post
Share on other sites

BIS_fnc_spawnVehicle returns array, not object: https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle.

Use this code:

_mrap = [[((_newPos select 0) + 20), (_newPos select 1), 0], random 359, "O_MRAP_02_hmg_F", east] call BIS_fnc_spawnVehicle;

(_mrap select 0) setFuel 0;

You can pass desired azimuth to BIS_fnc_spawnGroup: https://community.bistudio.com/wiki/BIS_fnc_spawnGroup. So you don't need to set azimuth separately. Moreover, it is inadmissible for group.

Edited by Schatten

Share this post


Link to post
Share on other sites

Firstly, ou only need to "call compile preprocessFile" if you explicitly want that file to be called. But as you're doing this in the init.sqf, which runs in scheduled environment (spawned), you could use execVM as it's way shorter and does the same thing, plus it returns a scriptHandle, so you can actually wait for it to be done using scriptDone.

Secondly, you need to provide more code for us to be able to help you. You only gave us 13 lines of your 47+ line long init.sqf (the RPT reveals it), so we don't know if you simply forgot to set "_bomb1" somewhere of if there's an error somewhere else resulting in "_bomb1" to be nil.

For your error with your "T8_SB_fnc_addAction":

You have the folling lines in your init.sqf:

[ [_bomb1], "T8_SB_fnc_addAction", true, true] spawn BIS_fnc_MP;
[ [_Drone1], "T8_fnc_addActionLaptop", true, true] spawn BIS_fnc_MP;

Let's make a Crash Course on how to use "BIS_fnc_MP".

The first argument for that function are parameters. The second argument is the function these arguments are for. That means, the way you wrote it is the same as if you wrote

[_bomb1] spawn T8_SB_fnc_addAction;

Notice that you surrounded "_bomb1" with "[]" which means that inside "T8_SB_fnc_addAction", "_this" will be an array with one element, namely "_bomb1".

The problem you encounter is because in your "T8_SB_fnc_addAction" you used "_this addAction ...". Now remember that "_this" is an array which would mean you execute "addAction" like this:

[_bomb1] addAction ...

But correct would be:

_bomb1 addAction ...

So to achieve that, you can do two things. Either inside your "T8_SB_fnc_addAction", you select the bomb from that array and execute addAction with that:

_bomb1 = _this select 0;
_bomb1 addAction ...

or you call "T8_SB_fnc_addAction" differently, namely without the brackets around the "_bomb1" parameter:

[ _bomb1, "T8_SB_fnc_addAction", true, true] spawn BIS_fnc_MP;

So, before we move on, I'd recommend you to read your RPT properly, because it tells you what exactly the problem is, where and in which file, in which line it occurs. Find out if you did this in other places, too.

Kind regards,

Johnny

---------- Post added at 18:26 ---------- Previous post was at 17:58 ----------

For your problems with _arty1, _hq, _specapc, read the previous post by Schatten.

Similar thing applies to _sniper1. BIS_fnc_spawnGroup does not return an object, but a group. You can read up the details about it in the respecitve BIKI article.

The problem with

getPos _hq select 0

is that the compiler evaluates it this way:

(getPos _hq) select 0

So it firstly evaluates (getPos _hq) and the it would do (select 0) on the result. But that is not what you want. You want it to evaluate that way:

getPos (_hq select 0)

So then write it that way. In doubt, better place parantheses.

For your waitUntil problems, that's actually a result of what I mentioned before. You try to use "alive" on an array which of course does not work.

Final advice:



READ PROPERLY!!!



This should not be any bollocking or something of that kind. Please take this as constructive criticism.

You post a bunch of errors here which you can easily fix yourself if you just read your RPT and the BIKI articles for the commands/functions you're using. Other scripters, just as me, learned it the same way. The BIKI tells you (almost) everything you need to know about the commands and functions.

Kind regards,

Johnny

Edited by Heeeere's Johnny!

Share this post


Link to post
Share on other sites

Ok jonny. first, I didn't make this script

call compile preprocessFile "scripts\downloadData.sqf";
call compile preprocessFile "scripts\secureBomb.sqf";

waitUntil { !isNil "downloadDataDONE" };
waitUntil { !isNil "secureBombINIT" };


if ( !isServer ) exitWith {}; 

sleep 10; // I dont know why, but some sleep is requied or the Actions on the Objects wont work ... this is beyond my knowledge 

[ [_bomb1], "T8_SB_fnc_addAction", true, true] spawn BIS_fnc_MP;
[ [_Drone1], "T8_fnc_addActionLaptop", true, true] spawn BIS_fnc_MP;  

I am only following the directions given by the author. If I knew how to then.....

As to the other errors, IF I was a scripter/coder/ whatever, I don't think I would be posting this stuff here for turds and giggles. Sry I have WAAYYY better things to do. BUT I do thank you for taking your time and giving advice.

Why you posted that the way you did is your business, you can choose to not reply by just skipping over this thread or any threads with my sig as author.

Edited by JAndrews1

Share this post


Link to post
Share on other sites

Sent you a PM as this discussion does not belong here.

Nevertheless, please don't feel like your questions aren't welcome. They always are even if my last post might make a different impression. The PM will explain.

So please, if you have questions, continue to post them so we can help you with it.

Kind regards,

Johnny

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×