Jump to content
Sign in to follow this  
dj3hac

Loot spawn script not working. Escape from Chernarus.

Recommended Posts

Hello, long time lurker, first time poster here,

I seem to be having a bit of trouble with a particular script; Loot system. By: Horner. I figured that I would get better results posting here, because the script was posted a few years ago and wasn't overly popular. Hell, it may even be incompatible now for all I know.

What I'm trying to do is get this running alongside; Escape from Chernarus - HulaZone. However, I can't seem to get the loot spawning script to work at all, not even when its just base Chernarus + that script. I've tried running it as an addon, running the pbo as a mission, I've tried integrating the loot spawn script with the Escape mission file (seems most logical to me) with no luck.

This is exactly what I'm doing:

Use cpbo to extract Hulazone mission file, use cpbo to extract loot system pbo. Take directory "/loot" from loot system and place it in "/scripts" of Hulazone ("/scripts/loot/"). I then take the contents of init.sqf from loot system which looks like:

if (isServer) then
{
call compile preProcessFile "loot\positions.sqf";
call compile preProcessFile "loot\wepArrays.sqf";
hrn_fnc_loot = compile preProcessFile "loot\hrn_loot.sqf";
[] spawn hrn_fnc_loot;
};

And I change the file path to:

if (isServer) then
{
call compile preProcessFile "Scripts\loot\positions.sqf";
call compile preProcessFile "Scripts\loot\wepArrays.sqf";
hrn_fnc_loot = compile preProcessFile "Scripts\loot\hrn_loot.sqf";
[] spawn hrn_fnc_loot;
};

I'm then adding this chunk of code to the init.sqf of hulazone. But of course it doesn't work, that's why I'm here :p. I have gotten other addons to with with this version of Escape before, with no problems. (CBA, JSRS, SMK animations)

Am I going about this the wrong way? I've spent 8 hours straight, overnight trying to get this stupid little script working, could someone please point me in the right direction, or tell me the script I'm using is outdated or something? Thank you in advance!

P.S. I'm running the server locally. ie, multiplayer>new. If you need anymore information I will include it, I am unsure what is relevant in this case.

Share this post


Link to post
Share on other sites

Run OA with the -showScriptErrors parameter and see what the error message is.

Share this post


Link to post
Share on other sites
Run OA with the -showScriptErrors parameter and see what the error message is.

Thank you for your reply, I will give this a shot.

---------- Post added at 20:43 ---------- Previous post was at 19:49 ----------

The two errors that stuck out as more important than the many other errors are as follows:

'...0;
_random = round (random 100);
_arr = |*|hrn_CommonWepArray;
if (_random > 60) th...'
};
if (_random >...'



hrn_CommonWepArray = 
[
["Item...'
Error undefined variable in expression: hrn_CommonWepArray


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


'...r = hrn_veryRareWepArray;
];
_subArr = |*|_arr select (floor (random (count _arr))...'
{
_arr = |*|hrn_semiRareWepArray;
];
if (_random > 9...'



hrn_commonWepArray = 
[
["Item...'
Error undefined variable in expression: _arr

I can see that variable "_arr" is called before it is declared. I am going to repair this and see what happens.

Actually... reading through the code, it doesn't appear this way, it looks fine to me.

Edited by dj3hac

Share this post


Link to post
Share on other sites

Replacing my modified loot table with the original included by Horner made something actually spawn! I have debugging enabled and it marks the spawn locations on the map. I'm unsure if they are potential spawn locations, or locations that weapons have spawned and they are now inside the floor. So there is obviously something amiss in my modified loot table, either the formatting is the problem, or if it's because I'm referencing weapons that are unknown to the loot system script due to it trying to spawn the weapons before they are defined.

I'm obviously way over my head here, but I have a fair amount of java experience and determination.

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  

×