Sign in to follow this  
Followers 0
Trades82

How do i add a 2nd or more loot crate to a custom DMS mission?

7 posts in this topic

Hi All,

I am working on a custom DMS mission that i'm about 80% complete in making, I'm trying to add a 2nd crate (And possible more) to the mission. Idea behind this is to have a crate for different types of items to spawn in. So a crate for weapons, optics, items etc.

i can spawn the first crate in with no issues. and everything seems to work how it should.

My 1st crate spawn is as follows. (Please note loot values are default as this works)

Spoiler

_crate_sniper = 
    [
        "B_supplyCrate_F",                                // STRING: The classname of the crate you want to spawn.
        [(_pos select 0) +5, (_pos select 1) +2, 0]        // ARRAY (position): Where to spawn the crate.
    ] call DMS_fnc_SpawnCrate;
    
_crate_loot_values_sniper =
    [
        [_crate_weapons,_crate_weapon_list],        // Weapons
        [_crate_items,_crate_item_list],            // Items + selection list
        _crate_backpacks                             // Backpacks
    ];

 

 

i can get the 2nd crate to spawn, but the 2nd crate spawning, I can not get the items i want to spawn in the 2nd crate, And the pop smoke is in a continues loop, Each time it pops the the smoke it adds more and more items to the crate. With the 2nd crate just sitting there doing nothing. 

2nd crate code is as follows

Spoiler

_crate_sniper_items = 
    [
        "B_supplyCrate_F",                                // STRING: The classname of the crate you want to spawn.
        [(_pos select 0) +5, (_pos select 1) +2, 0]        // ARRAY (position): Where to spawn the crate.
    ] call DMS_fnc_SpawnCrate;
    
_crate_loot_values_sniper_items =
    [
        [_crate_weapons,_crate_weapon_list],        // Weapons
        [_crate_items,_crate_item_list],            // Items + selection list
        _crate_backpacks                             // Backpacks
    ];

_missionObjs code for both is as follows

Spoiler

_missionObjs =
    [
        _staticGuns+_baseObjs+[_veh],                    // armed AI vehicle, base objects, and static guns
        [_vehicle],                                        //this is prize vehicle
        [[_crate_sniper,_crate_loot_values_sniper]],    //this is prize crate

       [[_crate_sniper_items,_crate_loot_values_sniper_items]]
    ];

As mentioned this just makes a pop smoke loop. 

Also tried the following with the same results

Spoiler

// Create Crate type - same for all levels
_crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate;

// setup crate iteself with items - same for all levels
_crate_loot_values1 =
[
    [_crate_weapons,_crate_weapon_list],        // Weapons
    [_crate_items,_crate_item_list],            // Items + selection list
    _crate_backpacks                             // Backpacks
];

 

// Create Crate type - same for all levels
_crate2 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate;

// setup crate iteself with items - same for all levels
_crate_loot_values2 =
[
    [_crate_weapons,_crate_weapon_list],        // Weapons
    [_crate_items,_crate_item_list],            // Items + selection list
    _crate_backpacks                             // Backpacks
];

_missionObjs =
[
    _staticGuns+_baseObjs+[_veh],            // armed AI vehicle, base objects, and static guns
    [_vehicle],                                //this is prize vehicle
    [[_crate1,_crate_loot_values1]],           //this is prize crate

    [[_crate2,_crate_loot_values2]]
];

I have spent many hrs over many days trying different things to get this to work, But so far has no luck.

Any ideas or thoughts would be great,

Thanks heaps in advanced for any help anyone can provide, Even if it to a forum that help me solve this.

Cheers

Trades82

Edited by Trades82

Share this post


Link to post
Share on other sites

******** Update ********

I now have this working. So please ignore this post. :)

Edited by Trades82

Share this post


Link to post
Share on other sites
Advertisement
On 6.3.2017 at 3:07 PM, Trades82 said:

******** Update ********

I now have this working. So please ignore this post. :)

let the world know which solution you found here. ;)
so maybe others can learn from your topic.

Edited by syntax
2 people like this

Share this post


Link to post
Share on other sites

The main issue was this line of code

On 3/6/2017 at 0:27 AM, Trades82 said:

_missionObjs =
[
    _staticGuns+_baseObjs+[_veh],            // armed AI vehicle, base objects, and static guns
    [_vehicle],                                //this is prize vehicle
    [[_crate1,_crate_loot_values1]],           //this is prize crate

    [[_crate2,_crate_loot_values2]]
];

It needs to be like this for it to work right (or in a sim format)

Quote

_missionObjs =
    [
        _staticGuns+_baseObjs+[_veh],                    // armed AI vehicle, base objects, and static guns
        [_vehicle],                                        //this is prize vehicle
        [[_crate_sniper,_crate_loot_values_sniper],
        [_crate_sniper1,_crate_loot_values_sniper],
        [_crate_sniper2,_crate_loot_values_sniper]]     //this is prize crate
    ];

As you can see here there is an extra crate added to make it a 3 crate spawn (mostly for testing). But will work the same if you had 2 or more crates as long as you follow how it is here.

That fixed the issue with the loop of endless spawning loot, But the loot will only spawn in one crate and not in each crate as intended, Still working on the code, and feel like i have almost worked it out. Will update with more information when i get it working right.

Edited by Trades82

Share this post


Link to post
Share on other sites
2 hours ago, Trades82 said:

_missionObjs =
[
    _staticGuns+_baseObjs+[_veh],            // armed AI vehicle, base objects, and static guns
    [_vehicle],                                //this is prize vehicle
    [[_crate1,_crate_loot_values1]],           //this is prize crate

    [[_crate2,_crate_loot_values2]]
];

think the crate line should be:

[[_crate1,_crate_loot_values1], [_crate2,_crate_loot_values2]]           

Share this post


Link to post
Share on other sites

Yes it dose as i pointed out in my reply.

13 hours ago, Trades82 said:

 [[_crate_sniper,_crate_loot_values_sniper],
        [_crate_sniper1,_crate_loot_values_sniper],
        [_crate_sniper2,_crate_loot_values_sniper]]     //this is prize crate

Dose not need to be in a single line as long as you have the [[_Name of crate,_Crate loot values]] in the right format otherwise things brake

 

This is my current working crate spawn, with loot in all three crates. but not custom loot like i want.

Quote

_missionObjs =
    [
        _staticGuns+_baseObjs+[_veh],                    // armed AI vehicle, base objects, and static guns
        [_vehicle],                                        //this is prize vehicle
        [[_crate1,_crate_loot_values1],
        [_crate2,_crate_loot_values2],
        [_crate3,_crate_loot_values3]]                     //this is prize crate
    ];

the name hase been changed from _crate_Sniper1 to _crate1 only cos i got sick of typing _crate_Sniper1 works just as well

Edited by Trades82

Share this post


Link to post
Share on other sites
11 hours ago, red_ned said:

think the crate line should be:

[[_crate1,_crate_loot_values1], [_crate2,_crate_loot_values2]]           

Sorry i didn't read it right, And relised another mistake i did, Thanks red_Ned, The loot values where wrong in my original reply. Thanks for pointing that out :)

Edited by Trades82

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.