Jump to content
code34

OO VITEMS - Virtual items & inventory in game

Recommended Posts

OO VITEMS
Lastest version: 0.4 by Code34

 

Hi,

I propose a first alpha version of this system, which I will improve if you are interested. This version does not show all the features already present in the library .Virtual Items is an OOP Class which allows to manage virtual inventories in ARMA. This system makes it possible to store virtual objects in any of the 3D objects of the game. In this first demonstration, you will be able to see the contents of 4 x 3D objects deposited in the editor. These virtual objects were created directly via script in the initserver.sqf

 

More informations:

This class creates containers with properties that will contain virtual objects with properties. The containers are attached to the 3D objects of the game. You can easily add many objects that do not require 3D modeling, and all without using mods: keys, cans, screwdrivers etc.

 

Properties for the containers are:
- size
- the weight

 

Properties for objects are:
- the price
- size
- the weight
- the owner
- the description
- durability

 

These properties may evolve which allows to add very elaborate features to the games. Any feedbacks are welcome ! :drinking2:

 

Github: https://github.com/code34/oo_vitems.vr

Download: https://github.com/code34/oo_vitems.vr/releases

Reference: http://forums.bistudio.com/showthread.php?167980-Object-Oriented-SQF-Scripting-and-Compiling

 

Features:

- Simple demo version

 

Licence:
Under Gpl, you can share, modify, distribute this script but don't remove the licence and the name of the original author

  • Like 5
  • Thanks 2

Share this post


Link to post
Share on other sites
18 hours ago, GEORGE FLOROS GR said:

Nice stuff !

 

Thanks code34 !

 

you re welcome : ) I am interested in feedbacks and ideas of evolution or integration. Functions will also be added in Qwench

  • Like 1

Share this post


Link to post
Share on other sites

Hi @code34 I'm trying out the demo but I don't know what to do. is there instructions?

thx!

Share this post


Link to post
Share on other sites
10 minutes ago, gc8 said:

Hi @code34 I'm trying out the demo but I don't know what to do. is there instructions?

thx!

hi :don16:

 

just check the inventory of each objects and look the initserver.sqf to understand how it works :)

Share this post


Link to post
Share on other sites
6 minutes ago, code34 said:

hi :don16:

 

just check the inventory of each objects and look the initserver.sqf to understand how it works :)

 

I get no action :(

 

Share this post


Link to post
Share on other sites
Just now, gc8 said:

 

I get no action :(

 

 

do you download the zip file or files unitary from git ?

Share this post


Link to post
Share on other sites
1 minute ago, code34 said:

 

do you download the zip file or files unitary from git ?

 

the zip "archive/0.1.zip"

Share this post


Link to post
Share on other sites
Just now, gc8 said:

 

the zip "archive/0.1.zip"

 

 i have it :) sorry you have to test it in MP mode.

Share this post


Link to post
Share on other sites
1 minute ago, code34 said:

 

 i have it :) sorry you have to test it in MP mode.

 

works :D

Share this post


Link to post
Share on other sites

hello Foxhound

 

Thanks you for your help on this :)

Share this post


Link to post
Share on other sites

Hi all :)

 

Just release a new alpha 0.2 version with some cool features. You normaly can begin to have a nice sharing objects experience !

 

Release informations:

  • add containers capacities /weight informations
  • add player inventory
  • add drop / take actions and switch beetween inventory. You can now take an object in a container and put it in another one :)

 

screenshot1:

https://www.dropbox.com/s/4oa3tvfpwm4vp9s/demoscreen_vitems.png?dl=0

  • Like 2

Share this post


Link to post
Share on other sites

Hi Nicolas. I got an error while dropping an item on ground:

 

c:\bis\source\stable\futura\lib\network\networkserver.cpp NetworkServer::OnClientStateChanged:NOT IMPLEMENTED - briefing!
16:26:51 Error in expression <all, {nil}])});
["addItem", _item] call _inventory;
(if(isNil "_oopOriginCall")t>
16:26:51   Error position: <_inventory;
(if(isNil "_oopOriginCall")t>
16:26:51   Error Undefined variable in expression: _inventory
16:26:51 File C:\Users\Utilisateur\Documents\Arma 3 - Other Profiles\Kobayashi%20Maru\missions\oo_vitems.VR\gui\oo_UI_vitems.sqf, line 91

 

weaponHolder or container missing?

Edited

_inventory = cursorObject getVariable "inventory";

If player is pointing at ground, cursorObject is null. On the other hand, as far as these items are not modded (Arma Vanilla), it's useless to create a container for nuts. In this case, just delete the entry in the inventory and manage all other data.

But I suppose the aim is to drop a modded item (existing in Vanilla or mods).

So, if (isNull cursorbject) then {_inventory = "groundWeaponholder" createVehicle getpos cursorObject}; // just an example, you can check also the typeof cursorObject

Then you can place the same kind of item (for true modded items) in this holder.

  • Like 1

Share this post


Link to post
Share on other sites

Good idea :)

 

Currently, I have not looked at this use case yet. In fact, I've planned this system for vanilla play and all non-modeled objects that can not be used by conventional inventory. Maybe in the end there will be a mix with real 3d object, but I'm not there yet :)

For the idea of the "groundWeaponholder", it will anyway be necessary to use a 3d object in which placed the virtual objects on the ground to avoid that the virtual objects are lost when they are dropped. I will look in the list of 3d objects (all ideas are welcome :) ).

Share this post


Link to post
Share on other sites

Hi Code, nice job as usual!

 

I think it can be interesting to RP mod. For the 3d, you can use the stanag magazine.

  • Like 1

Share this post


Link to post
Share on other sites

Just a hint, if needed. the groundWeaponHolder disappear when empty, except "WeaponHolderSimulated_Scripted" which can wait for items even if empty.

  • Like 2

Share this post


Link to post
Share on other sites

Hi all

 

I just release the new version of oo_vitems 0.3

 

Release informations:

- add multiplayer first implementation

- add a first implementation of button to use object

- simplification of objects declaration with array :)

 

Example with new object prototype

_inventory = ["new", box] call OO_CONTAINER;
["setProperties", ["Box",100,100]] call _inventory;
_potatoe = ["Potatoe","A vulgar potato damaged","food",2,0.5,"Captain_A",10, {}];
["addItem", _potatoe] call _inventory;

 

  • Like 2

Share this post


Link to post
Share on other sites

Hello,

the next version will be released soon. If you have ideas, do not hesitate because it's the right moment.

I started adding the features so that the mod is compatible with all maps.

With this new version, you will be able to collect objects in the houses, and all the stuff will spawn randomly :don15:

Share this post


Link to post
Share on other sites

@code34 I don't know if this has been done already but maybe option to give picture to the items?

 

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

×