Repository navigation
Build Item Config Properties
Headers\descriptionEXT\GUI\shopGUICommonDefines.hpp
Type(s): NUMBER
Description:
This property handles how far in to the side of the player the item should be when they purchase it from the shop. For example, a value of
1will place the item 1m to the right of the player.-1will place it 1m to the left.
Example(s):
attachmentX = 0;
Type(s): NUMBER
Description:
This property handles how far in front of the player the item should be when they purchase it from the shop.
Example(s):
attachmentY = 1;
Type(s): NUMBER
Description:
This property handles how far above or below the player the item should be when they purchase it from the shop.
Example(s):
attachmentZ = 3;
Type(s): STRING
Description:
Categories can be any string so you can make your own very easily. You can find some already made category macros in the
shopGUICommonDefines.hppfile listed above.
Example(s):
category = OTHER_CATEGORY;
category = "My Category";
Type(s): NUMER or BOOL
Description:
A true value (either
trueor1) will register this item as an object that should register with the AI collision script. AI will try not to walk directly through the object.
Example(s):
detectCollision = false;
detectCollision = 1;
Type(s): STRING
Description:
The
DisplayNameproperty is only required if you would like a custom name for the item. Otherwise, the item'sCfgVehiclesclass displayname will be used. This name will also show up in the object's actions when purchased.
Example(s):
displayName = "My Custom Name";
Type(s): NUMER or BOOL
Description:
If the item is intended to have AI, it will be spawned with
BIS_fnc_spawnVehicleas opposed to justcreateVehicle. This is mostly intended for auto-turrets.
Example(s):
hasAI = false;
hasAI = 1;
Type(s): NUMER or BOOL
Description:
Simply makes the item invincible or not.
Example(s):
invincible = 0;
invincible = true;
Type(s): NUMER or BOOL
Description:
If false, inventory will be cleared from item if it has any.
Example(s):
keepInventory = 0;
Type(s): STRING
Description:
This is uncompiled code that fires locally each time the player picks up an item of that type (also fires during purchase).
Parameters:
OBJECT:
_object- The picked up object
Example(s):
onPickedUp = "hint str _object";
Type(s): STRING
Description:
This is uncompiled code that fires locally each time the player places down an item of that type.
Parameters:
OBJECT:
_object- The placed object
BOOL:
_wasSnapped- Was the object snapped to the surface
Example(s):
onPlaced = "hint str [_object,_wasSnapped]";
Type(s): STRING
Description:
This is uncompiled code that fires locally each time the player purchases an object of this type. Specifically this prefix function fires before before the item is created and is capable of initiating an abort of the purchase.
Parameters:
STRING:
_this select 0- The class of the object to be purchased
ARRAY:
_this select 1- An array of these various config properties related to the item:
0: PRICE <NUMBER>
1: CATEGORY <STRING>
2: ROTATION <NUMBER>
3: ATTACHMENT_COORDS <ARRAY>
4: HAS_AI <BOOL>
5: INDESTRUCTABLE <BOOL>
6: KEEP_INVENTORY <BOOL>
7: DETECT_COLLISION <BOOL>
8: DISPLAY_NAME <STRING>
BOOL:
_doExit- Set to true to exit the purchase function
BOOL:
_refund- Set to true to get a refund if exiting the purchase function
Example(s):
onPurchasedPrefix = "hint (_this select 0)";
Shows class name.
onPurchasedPrefix = "_doExit = true; _refund = true; hint 'You can't buy this, but here's your money'";
Exits purchase and refunds. Also shows a message to the player.
onPurchasedPrefix = "params ['','_propertiesArray']; hint (_propertiesArray select 8)";
Hints the displayname of the item.
Type(s): STRING
Description:
This is uncompiled code that fires locally each time the player purchases an item. Specifically it fires after the item is created, all the relevant properties have been loaded from the config, and the actions have been added to the local player.
Parameters:
OBJECT:
_object- The purchased object
Example(s):
onPurchasedPostfix = "hint str _object";
Type(s): STRING
Description:
This is uncompiled code that fires locally each time the player purchases an item. Specifically it fires locally after the item's actions are synced across the network. This is ~10 seconds after the item is first placed down by the player who purchased it. (this is because of issues with transferring ownership of items too soomn if someone tries to manipulate the object)
Parameters:
OBJECT:
_object- The purchased object
Example(s):
onPurchasedPostNewtork = "hint str _object";
Type(s): STRING
Description:
This is uncompiled code that fires locally before an item is sold (with the action when it is outside the shop). This code MUST return a BOOL. That bool determines whether or not the item can be sold.
Parameters:
OBJECT:
_object- The purchased object
Example(s):
onPurchasedPostNewtork = "hint str _object; true";
Item can be sold
onPurchasedPostNewtork = "hint str _object; false";
Item can't be sold
Type(s): NUMBER
Description:
The amount of points the item costs in the shop
Example(s):
price = 100;
Type(s): NUMBER
Description:
The rotation of the item when it is purchased from the shop.
Example(s):
rotation = 90;
Type(s): STRING
Description:
A custom tooltip of the object in the shop.
Example(s):
tooltip = "This object is special";
-
NUMER or BOOLmeans the property can accept either0orfalseor1ortrue - Currently as of version
0.9.0the build events are always compiled each time they are called. So keep the code within the actual string short and if a larger function is needed, place it into either aCfgFunctionsentry or global variable for example.