Results 1 to 4 of 4

Thread: Loot spawn script not working. Escape from Chernarus.

  1. #1

    Loot spawn script not working. Escape from Chernarus.

    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:

    Code:
    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:

    Code:
    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 . 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.

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

  3. #3
    Quote Originally Posted by DreadPirate View Post
    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:

    Code:
    '...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.
    Last edited by dj3hac; Mar 8 2015 at 20:00.

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

Similar Threads

  1. Loot system (Configurable Loot script)
    By BangaBob in forum ARMA 3 - MISSION EDITING & SCRIPTING
    Replies: 24
    Last Post: Jul 1 2015, 03:31
  2. Spawn loot inside and outside buildings, with the same script.
    By Icaruk in forum ARMA 3 - MISSION EDITING & SCRIPTING
    Replies: 5
    Last Post: Jan 16 2014, 21:06
  3. Chernarus custom loot spawn positions
    By JW Custom in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 3
    Last Post: Mar 31 2013, 07:03
  4. Random loot spawn
    By Hewlitt in forum ARMA 2 & OA : Community Made Utilities
    Replies: 2
    Last Post: Oct 22 2012, 16:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •