Jump to content
Sign in to follow this  
tmvbj83

Pickup a Suitcase, laptop or moneypile?

Recommended Posts

I am playing with a community, and as a gamemaster i would like to have the players to be able to secure a suitcase, laptop or moneypile. Just placed in the inventory. If the suitcase could be carried it would be great.

I don't want a fancy task that says a longer dialog og task complete. I just want to be able to pick up small items i have placed via zeus og editor.

Help please :-)

Any of you have any suggestions?

Share this post


Link to post
Share on other sites

Unfortunately, stuff like that is not configured to be placed in the inventory - at least not in vanilla Arma 3. That's why you always see the "fancy task" being done.

Share this post


Link to post
Share on other sites

As Fight9 says, these things are not "items" that can be put into your inventory. However you can simulate picking them up rather easily by:

1. Adding a "Pick up" action to the object.

2. Inside the action code, play an animation of picking it up (or don't even bother with it)

3. Wait until the animation is finished.

4. Use setVariable to simulate the player having the object. (ie. player setVariable ["hasSuitcase", true])

5. Delete the object from the game world.

I have used such a method in the past to simulate chopping wood out of a woodpile (required axe to be picked up first) because I thought it was interesting.

I can give you little more guidance here if you want. I have already thought heavily about how to code a "virtual inventory", I just haven't written any actual code.

Share this post


Link to post
Share on other sites

That functioning properly will probably be in a new DLC. =)

Share this post


Link to post
Share on other sites
That functioning properly will probably be in a new DLC. =)

you know something we dont?

Share this post


Link to post
Share on other sites
I can give you little more guidance here if you want. I have already thought heavily about how to code a "virtual inventory", I just haven't written any actual code.

Som more guidance would be very nice :-) When it comes to writing code, I have no idea what I am doing. Only simple stuff. It would be awesome if you could write an workable example!? ;-) pretty please with sugar on top :-)

Share this post


Link to post
Share on other sites
Som more guidance would be very nice :-) When it comes to writing code, I have no idea what I am doing. Only simple stuff. It would be awesome if you could write an workable example!? ;-) pretty please with sugar on top :-)

Sure, basically your base will be a simple assignment:

var = var + [newValue]; //it's slower, but you will NEVER overwrite an element using this or pushBack

You'll just store your items like the game does, as strings. Here's an example for picking up an axe:

this addAction ["Pick up hatchet", {
playerInventory = playerInventory + ["hatchet"]; //To add an element to an array, you must add 2 or more ARRAYS so that's why you enclose your item in square brackets
//You could also use: playerInventory pushBack "hatchet" but it's less clear what its function is.

hint "You have picked up a hatchet"; //notify the player that something has happened - always helpful
deleteVehicle (_this select 0); //remove hatchet from world space

if (debug) then {hint str playerInventory}; //support for some kind of "debug" mode - also proof that the code worked
}, [], 6, false, true];

Now you can use your virtual inventory in other code using:

if ("myItem" in playerInventory) then
{
//do something
};

Now, the biggest and most helpful advice for things like this is the same as simple coding - BE CONSISTENT. I mean, if you decide that all of your item names should start with a capital letter, than capitalize all the items. If you think that the entire word should be capitalized then do it for each one. Consistency can really cut down on debug time (wasted time) in a large or complex project.

Share this post


Link to post
Share on other sites
This mod might do the trick for you, it's client side and only 1 mb so not a bad download. The placement for carrying the suitcase and laptop is a little immersion breaking but if you can look past that it's great.

http://www.armaholic.com/page.php?id=23327

Looks great thanx. I'll check it out :-)

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  

×