Jump to content

Recommended Posts

Does anybody know why drag bodies doesn't work? Using carry all the time is really ineffective as the animation is so long.

Share this post


Link to post
Share on other sites

I might have an old version, I'll try updating it.

Share this post


Link to post
Share on other sites

Alright, so I was poking around to see if I could figure out the "No entry 'config.bin/CfgWeapons.'." error that pops up sometimes when players get knocked out. I found references to cfgWeapons in two lines of the =BTC=_functions.sqf. On Line 44 it's called out:

_fire_mode_array = getArray (configFile >> "cfgWeapons" >> _weap_sel >> "modes");

And then it's called out again in Line 167.

{if (isClass (configFile >> "cfgWeapons" >> _x)) then {_unit addweapon _x;};} foreach (_gear select 7);

I'm almost positive it's this second line that's causing the error. I threw some hints in near line 44 and 167 and the line 44 hint fires as soon as the mission starts without error. The Line 167 hint fired right when I got killed and the error message popped up.

I'm saying this from the perspective of being a total noob at scripting, but is there any reason why that line uses the configfile >> cfgWeapons and can't use code like you're using for the other gear checks below it with something like this?

if (count (_gear select 7) > 0) then {{_unit addweapon _x;} foreach (_gear select 7);};

---------- Post added at 13:08 ---------- Previous post was at 12:42 ----------

Hmm, a little followup, and I wonder if this is the underlying issue. I was trying to figure out what "_gear select 7" is in reference to. Up in the BTC_get_gear function above, --it looks like _gear is defined, and the 7th value is... "_back_pack_weap". I was having issues with that block (same script, lines 157-163) throwing undefined variable errors earlier. Might be able to just comment out lines 157-163 and 167 completely and be done with it.

I assume that means that when people are revived, they will lose any weapons they had been storing in their backpacks though.

Edited by MeatballCB

Share this post


Link to post
Share on other sites

@MeatballCB,

I believe _gear select 7 is _weapons not _back_pack_weap.

BTC_set_gear =

{

/*_gear =

[

_uniform,0

_vest,1

_goggles,2

_headgear,3

_back_pack,4

_back_pack_items,5

_back_pack_weap,6

_weapons,7

_prim_items,8

_sec_items,9

_handgun_items,10

_items_assigned,11

_uniform_items,12

_vest_items,13

_weap_sel,14

_mags_g,15

_at_mag

];*/

Share this post


Link to post
Share on other sites

Drag still did not work. I can start dragging people, but after the animation is done I can't move. Of course turning the dragged person around still helps a bit.

Share this post


Link to post
Share on other sites

No, I'm almost positive that it's _back_pack_weap. I tried to trace it back, and though it's messy, I'm pretty sure it's _back_pack_weap. The only place that function BTC_set_gear is called is in line 441 of =BTC=_functions.sqf. when the player is 'killed' and BTC_respawn_gear is set to 1.

if (BTC_respawn_gear == 1) then 
{
       _gear = [player,BTC_gear] spawn BTC_set_gear;
};

So, we're feeding the 'player' and the 'BTC_gear' variables to the BTC_set_gear function. Now, if you dig back and look for the 'BTC_gear' variable, in the same file, line 182:

BTC_gear = [] call BTC_get_gear;

So, the 'BTC_gear' variable is the output of the BTC_get_gear function that starts on line 16 of the functions file and if you look starting on line 91:

	_gear =
[
	_uniform,
	_vest,
	_goggles,
	_headgear,
	_back_pack,
	_back_pack_items,
	_back_pack_weap,
	_weapons,
	_prim_items,
	_sec_items,
	_handgun_items,
	_items_assigned,
	_uniform_items,
	_vest_items,
	_weap_sel,
	_mags_g,
	_at_mag
];
_gear

The end of that functions returns the list above, and the seventh item returned is _back_pack_weap. That list at the top of the BTC_set_gear function is commented out, and is probably leftover from an older version.

Edited by MeatballCB

Share this post


Link to post
Share on other sites

It's not the 7th item that is referenced by select 7 but the 8th, it starts at 0,1,2,3,4,5,6,"7" which is the 8th or select 7 character

It is "select 7" NOT "select 7th"

Edited by tomturner

Share this post


Link to post
Share on other sites

Firstly I would like to say a massive thank you for the script... we love it as a community.

I have been editing it (slightly) to suit our needs and I have ran into a wall

Would it be possible to have 2 types of medic

I.E. Recon paramedic can stabilize (halt the countdown till death timer) while Combat life saver can revive

If not its fine but if I didn't at least ask I know it wouldn't happen :)

Share this post


Link to post
Share on other sites
It's not the 7th item that is referenced by select 7 but the 8th, it starts at 0,1,2,3,4,5,6,"7" which is the 8th or select 7 character

It is "select 7" NOT "select 7th"

Ah...yep, you're right. :) My bad. Regardless, it definately appears to be that "{if (isClass (configFile >> "cfgWeapons" >> _x)) then {_unit addweapon _x;};} foreach (_gear select 7);" on line 167 causing the config.bin errors.

Share this post


Link to post
Share on other sites

Yeah of course, that was obvious...but why it gives away an error? That's the question! I'll look at it when i'll get back home from holiday

Share this post


Link to post
Share on other sites

It appears that an item returned using the script command _weapons = weapons player; // line 19 =BTC=_functions.sqf

is not in the BETA 0.74 'config.bin/CfgWeapons' as an addable weapon in _unit addweapon _x

You could write or add a hint or diag_log line in the iteration of

{if (isClass (configFile >> "cfgWeapons" >> _x)) then {_unit addweapon _x;};} foreach (_gear select 7);

to show you the offending weapons.

Just a suggestion.

Edited by tomturner

Share this post


Link to post
Share on other sites

Alright, think I figured it out something else while I'm poking around. Needs more testing to make sure I've not missed anything, but the answer was somewhat staring me in the face. So when you're getting the undefined variable "BTC_back_pack_weap" it's because the it's never defined prior to the first call of it anywhere. Simply adding a line clears it all up.

BTC_back_pack_weap = _gear select 6;
if (count (BTC_back_pack_weap select 0) > 0) then 
{
	for "_i" from 0 to (count (BTC_back_pack_weap select 0) - 1) do
	{
		(unitBackpack _unit) addweaponCargoGlobal [(BTC_back_pack_weap select 0) select _i,(BTC_back_pack_weap select 1) select _i];
	};			
};

Just adding that "BTC_back_pack_weap = _gear select 6;" fixes that error.

Still need to figure out the config error.

---------- Post added at 15:47 ---------- Previous post was at 15:31 ----------

Alright, Error #2. If a player gets knocked out but is not revived prior to the "BTC_revive_time_max" value, they can see the following error.

'...erPos BTC_respawn_marker;
deleteVehicle |#|_obj;
};
if (BTC_black_screen == 0 || BT...'
Error Undefined variable in expression: _obj

_obj is not defined anywhere prior to where it's used in =BTC=_function.sqf (line 559) if you are not using a MobileRespawn. Looks like _obj is defined in the BTC_mobile_marker function starting on 656.

What I did to fix it was to update line 559 to read:

if (BTC_mobile_respawn == 1) then {deleteVehicle _obj;};

Share this post


Link to post
Share on other sites

With the new stable it returns an error i know, i was already away when the update was released and i couldn't fix it

Share this post


Link to post
Share on other sites

Is it possible to edit this script to change the location of the player when they are waiting for time until respawn counter (BTC_respawn_time) to finish? I ask this as I'm using a script that reduces health for opfor when they are out of their play area. Because BTC revive script moves the player out of their play area while they're waiting to respawn, they keep dying over and over and retriggering the respawn wait time. If this is possible what do I need to edit and which file? Thanks

Edited by clydefrog

Share this post


Link to post
Share on other sites

So, Clyde, if I'm following you right, you have a set amount of time you players to be stuck unconscious and not be able to revive, but you don't want them to move? If that's the case, I bet setting BTC_respawn_time to 0 or 1, and then setting BTC_revive_time_min and BTC_revive_time_max to the time you want would do the same thing. Say you want people to be stuck 'unconscious' for 2 minutes, set revive_time_min/max to 119/120 and then set respawn_time to 1.

Share this post


Link to post
Share on other sites
So, Clyde, if I'm following you right, you have a set amount of time you players to be stuck unconscious and not be able to revive, but you don't want them to move? If that's the case, I bet setting BTC_respawn_time to 0 or 1, and then setting BTC_revive_time_min and BTC_revive_time_max to the time you want would do the same thing. Say you want people to be stuck 'unconscious' for 2 minutes, set revive_time_min/max to 119/120 and then set respawn_time to 1.

No, what I mean is when you use BTC_respawn_time so you have a delay between pressing the respawn button and respawning, it sets the players position to [0,0,6000], so in the corner of the map 6000 metres up in the air. I have now found this and what values to change so they are moved to a different place while they wait to respawn. Unfortunately putting them 6000 up in the air which is much safer than them being on the ground (where they can be shot while they are waiting to respawn) will not work with my script that detects when a player leaves the area and damages them. When I set them to the ground height in that area it is ok though. I think I've worked out how to do it now, just have the problem with not being able to set them up in the air.

Share this post


Link to post
Share on other sites

How does the script detect the player leaving the area? Sometimes you can set people captive and it will stop them for setting off triggers and such.

Share this post


Link to post
Share on other sites
How does the script detect the player leaving the area? Sometimes you can set people captive and it will stop them for setting off triggers and such.

Hmm that's a point, this is the bit of the BTC script that moves the player while they wait to respawn:


if (BTC_respawn_time > 0) then
{
	player enableSimulation false;
	player setpos [3126,5974,0];
	player setVelocity [0,0,0];
	sleep 1;
	private ["_n"];
	for [{_n = BTC_respawn_time}, {_n != 0}, {_n = _n - 1}] do
	{
		private ["_msg"];
		player enableSimulation false;
		player setpos [3126,5974,0];
		player setVelocity [0,0,0];
		titleText [format ["Respawn in %1",_n], "BLACK FADED"];
		sleep 1;
	};
	player enableSimulation true;
	deTach player;
	player setVelocity [0,0,0];
	player switchMove "amovpercmstpslowwrfldnon";
	player setPos getMarkerPos BTC_respawn_marker;
	deleteVehicle _obj;

I suppose you could do player setcaptive true until they respawn and then setcaptive false, the same way as with the enablesimulation above.

Share this post


Link to post
Share on other sites

You could just comment out the 'player setpos [3126,5974,0];' lines and see if that fixes it...

Share this post


Link to post
Share on other sites
You could just comment out the 'player setpos [3126,5974,0];' lines and see if that fixes it...

That will make the dead players new body stand where they died instead of being moved out of view.

I'm just going to leave it as I have it I think, they will be moved to a building while waiting to respawn and can't be hurt there due to player enablesimulation false so there isn't really anything to worry about.

Share this post


Link to post
Share on other sites

Does this script re-add any code in the mobile respawn vehicles init when it respawns, or has anybody here tried adding that to it?

Share this post


Link to post
Share on other sites

havent checked if this has been reported, but I get an Error on

if ((_gear select 3) != "") then {_unit addHeadgear (_gear select 3);};

if (count (BTC_back_pack_weap select 0) > 0) then

{

for "_i" from 0 to (count (BTC_back_pack_weap select 0) - 1) do

{

(unitBackpack _unit) addweaponCargoGlobal [(BTC_back_pack_weap select 0) select _i,(BTC_back_pack_weap select 1) select _i];

};

tested and reproduced, add player, add playable grouped. enter map, swap to playable unit, kill player unit, you will automatically be killed yourself and the helmet of the player unit will be deleted (they also may or may not die sometimes)

I dont know shit about how the scripts work for this, but thats about all i could track down and reproduce

---------- Post added at 02:23 ---------- Previous post was at 02:22 ----------

oh that stuff is in =BTC= functions.sqf lines 156 thru 161

Share this post


Link to post
Share on other sites

this error has been reported

Just add this line :

BTC_back_pack_weap = _gear select 6;

before :

if (count (BTC_back_pack_weap select 0) > 0) then

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

×