Loot Bug Fix for v 0.1

Torndeco

Valued Member!
This is a client mission bug fix for 0.1

There is typos in the loot arrays basicly i.e
Code:
    class Land_ammostore2 : Military {
        maxRoaming =  2;
        lootPos[] = {-0.383789, -2.19238, -2.72875};
should be
Code:
    class Land_ammostore2 : Military {
        maxRoaming =  2;
        lootPos[] = {{-0.383789, -2.19238, -2.72875}};

The fix basicly checks the loot positons it receives from config file is a nested array (correct), if it isn't it adds the position into an array.

There is also diag_log statements that will print out debug lines to client's rpt logs that mention the broken type etc...

Code:
_temp_positions =    [] + getArray (_config >> "lootPos");
if (typeName (_temp_positions select 0) == "ARRAY") then {
    _positions = _temp_positions;
} else {
    _positions = [_temp_positions];
    diag_log ("LOOTSPAWN: Broken Type:" + str(_type));
    diag_log ("LOOTSPAWN: Old Fixed:" + str(_temp_positions));
    diag_log ("LOOTSPAWN: Fixed:" + str(_positions));
};


Its not ideal fix, but its a temp solution till next release..
At the very least u will get some get loot etc

--------------
Download the 2 files for spawning loot + zombies

In your init.sqf add
Code:
building_spawnLoot =        compile preprocessFileLineNumbers "building_spawnLoot.sqf";
building_spawnZombies =        compile preprocessFileLineNumbers "building_spawnZombies.sqf";

in your init.sqf should do the trick...
Note i have a habbit of incorpating a custom compiles.sqf & sort my file fixes into directorys, so am not 100% certain on the init.sqf part...
 

Attachments

  • building_spawnLoot.sqf
    2.1 KB · Views: 10
  • building_spawnZombies.sqf
    2.2 KB · Views: 6
There is also another typo mistake..
i.e
Code:
    class Land_bouda2_vnitrek : Farm {
        maxRoaming = 2;
        lootPos[] = {{-1.34631 1.36914, -0.610504}, {0.775391, -1.76465, -0.610504}};
    };

First position, has no comma...
Looks like a copy/paste
Dayz code ends up reading this as a string value then & errors out

Will update my fix to have a check type = Land_bouda2_vnitrek & hardcode the values in.
Unless someone wants to code it...

-----------

Thought i was going crazy why i couldn't get 1.7.5 loot spawning to work, was erroring out on intializing loot tables with the errors :)
 
Don't worry, I have almost finished the 1.7.5.1 code. I am just redoing the spawn code to stop it spawning in really bad area's like the north west corner.
 
Player spawn code isn't that hard..

Just change up the spawn locations is half the battle in the mission file..

Then u can alter the code to read more than 4-5 markers for spawn locations..
Also can change up the conditions for finding a spot i.e not to look only @ shore spots so u can spawn closer to towns if u wanted to...
That way u can players spawn in towns / @ out skirts...

And have a seperate loop for when server = busier to look for farther out spawns, if it can't find one in the first loop conditions.

Unless u are going more exotic route of spawn selection code i.e like tavi eu.

----------
----------

Anyway i am sorted now, back to using 1.7.5 code on server this weekend.
Now that i figured out what was going wrong with loot spawning.

Edit:
Updated Fix for Loot Spawning, has a check for the bugged "Land_bouda2_vnitrek".
Think thats all the bugged locations sorted now, with the workaround
 

Attachments

  • building_spawnLoot.sqf
    2.1 KB · Views: 13
  • building_spawnZombies.sqf
    2.2 KB · Views: 9
Back
Top