Jump to content

meatball

Member
  • Content Count

    734
  • Joined

  • Last visited

  • Medals

Posts posted by meatball


  1. @MeatballCB

    I am not sure I follow what you are saying. When you tried to call a spawn from the init.sqf you got errors or you are getting errors now?

    Well, I'm using a trigger call in game to run the SLP Spawn script and when I do I'm getting the following error:

    ...er) exitwith{};
    waituntil {scriptdone |#|SLP_init};
    
    _spawnname = _this select 0;...'
    Error Undefined variable in expression: slp_init

    I found that waitUntil in both the SLP_Spawn and SLP_markers the sqf files and since I'm calling the SLP Spawn with a trigger way after the mission has started, I'm not worried about the SLP_init.sqf not having been run since it's in my init.sqf, so I just commented that out in both the spawn/markers files.


  2. 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;};


  3. 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.


  4. 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.


  5. 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.


  6. Okay, I finally managed to get a screenshot of the error I was getting with your revive script, the exact text is:

    No entry 'bin\config.bin/CfgWeapons.'.

    Is it possible it's just a typo causing this? I haven't seen too many instances where its okay to have both \ and / in the same line. Could it possibly be the . at the end of the line? It sounds too simple to have been missed but then I once lost a week of work debugging a program when I used an upper case O instead of a 0

    Hey Giallustio - I know you mentioned you'd look at this at some point. Did you ever figure out what causes that?


  7. Alright, I made it work, but it's a total kludge :)

    First I created a publicVariable up in the server side script of the randomly generated number in the _rand > 0 section with the following:

    spawnRand = _rand;

    Then I forced that to a be a public variable at the end of the server block with:

    publicvariable "spawnRand";

    Then down in the client else block I added the following (lines 4-6 below):

    _this spawn {
       private ["_s","_m","_p"];
       waituntil {!isnull player};
       waituntil {!isnil "spawnRand"};
    _newPos = getmarkerpos format ["startpos_west_%1",spawnRand];
    player setPos [((_newPos select 0) + (random(20)-10)), ((_newPos select 1) + (random(20)-10)),0];
    

    It works, it's a mess, but it works. Player as the server actually sees the other players on the intro map in the wrong location until they fully load in, then it appears to update, but everyone spawns near each other.


  8. Hmm...you know, you're right. Try this link and I believe it should work. Appears that BI must have made a change that if you change the name of .pbo file (which I did to add the version name and have always done), it now shows up as blank in the mission list. If you look at your list you probably see a gap in the mission list that you can click on and gives you a generic mission popup, but that's the mission.

    Regardless, the link above should have fixed that...Let me know if it doesn't. Sorry about that.


  9. Hmm, can you expand on that Strong? I'm actually wondering if it's possible to have variable delays for the different types of groups. So, say I have infantry and helicopters spawning. If an infantry platoon is destroyed, I don't mind if a replacement spawns right away, but if a heli is destroyed, I'd like to have a delay of a minute or two before the next one spawns so the players aren't overloaded with helicopters constantly. I think that's possible, just trying to understand the syntax. Would something like this work to spawn 5 groups of 8 infantry with a 5 second delay, and 5 units of 1 heli with a 2 minute delay?

    0=["trg1",[0,2,true],[trg1,50],[5,8,5]],[],[],[5,1,120],["patrol",30]] spawn SLP_spawn;

    If that's not possible in one call, I know I can probably do it with different calls for the different units, but just trying to see if there's a way to do it all in one call.

    ---------- Post added at 09:07 ---------- Previous post was at 08:56 ----------

    Hmm, looks like my hope to do varying delays per unit type won't work and it's one set delay for all spawns. Unless I'm missing something I'll just need to set up different spawn calls.


  10. Yeah, I tried that, but no go. I assume when you said siteObjects you meant to create an object and add it to the move call for randstapos. I added a wrench in the editor, called it startMoveObject, and put that as something to move with the move call. Then did the setpos on the getpos on the wrench. Had a friend test it out with me and he still spawned at the original location while I ended up at the randomized site.

    If I add in AI, they do all move, it's just other players.

    ---------- Post added at 20:50 ---------- Previous post was at 19:22 ----------

    Alright, I _think_ I know where the problem lies, I just don't have the slightest idea how to fix it. In the script after all the 'isserver' code, in the 'else' block, that code is actually running on the other players machines (I stuck a hint in there and they saw it pop up). Maybe this code no longer works in Arma 3?

    } else {
     _this spawn {
       private ["_s","_m","_p"];
       waituntil {!isnull player};
       waituntil {!isnil "SHK_randstapos_selected"};
    
       _s = tolower(str(side player));
    

    Just a guess.


  11. Hey Giallustio, quick question, what does this code block do in the =BTC=_functions.sqf?

    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];
    	};			
    };

    That was the only section throwing an error for me after the last patch, and I commented it out. Seems like everything is working fine without it, so just wanted to check with the boss. :)


  12. Moving my conversation from the wrong thread.

    ------

    I'm using the old "SHK_randstapos.sqf" you had published a while back. I've made no changes to the actual script itself, and I'm calling it as the first line in my init script with:

    [["west",10,[heliStart,heliKiller]]] call compile preprocessfile "shk_randstapos.sqf";

    My mission has 8 units the players can choose from (not all of them may be in every game). I've also pre-populated the map with a bunch of startpos_west markers (startpos_west, startpos_west_1, startpos_west_2...) like you said to do in the script instructions.

    If I'm running the server, my player is moved, along with the two named helicopters listed above, yet if anyone else plays while I'm running the server, when the mission stats, my unit and the helicopters have moved correctly to the randomized location, but the other players spawn in the original location all the units were (startpos_west) in the editor.


  13. Yeah, .7 has an issue. :) Appears the random start is only moving the first player and noone else...I'll get something new up when I figure it out.

    ---------- Post added at 22:58 ---------- Previous post was at 21:24 ----------

    Updated and disabled the random start location for now. Same download link.


  14. New Update!

    v 0.70 Release

    - Fixed a lot of the undefined variable messages with the help of spunFin!

    - May still be some bugs with the new patch and new functions.

    Still may be some outstanding issues, but I think I got the bulk of them. But since the new patch and a lot of new functionality, more testing will probably find more issues. If you run into anything, let me know!


  15. I do have the marker 'respawn_west', but I don't have the 'BTC_base_flag_west' object because I've disabled the mobile respawn and don't have any of them listed in the init file and didn't think it was necessary.

    ---------- Post added at 15:01 ---------- Previous post was at 14:54 ----------

    Just tested. Commenting out that code block does get rid of the error message. No idea if it causes any other issues with it being commented out though. While I'm not a scripter by any means it appears that is checking if the player has any weapons in their backpack, and if so, it will re-add it on spawn. But that's just a guess...


  16. Getting the same error at dbtj up above. Here's the actual error box.

    btcError.jpg

    That call is located in =BTC=_functions.sqf, down between lines 156-160. This is the actual code block.

    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];
    	};			
    };
    

    Not sure why "BTC_back_pack_weap" would kick an error since it looks like that's a global variable and shouldn't need to be locally defined.

×