Cyber Engine Tweaks
Modding
Dictionary
Other
External docs
Other Wikis
Powered By GitBook
TransactionSystem
Documents the TransactionSystem class and its functions.
NOT DOCUMENTED
We currently don't have information on how these functions work. They are being documented here for visibility.

Invoking TransactionSystem

To invoke the transaction system, use the following Global function:
1
ts = Game.GetTransactionSystem()
Copied!

Sub-functions

AddItemToSlot

AddItemToSlot
Info & Usage
1
AddItemToSlot(obj : ref:GameObject, slotID : TweakDBID, itemID : ItemID, optional highPriority : Bool, optional itemObject : wref:ItemObject, optional plane : ERenderingPlane, optional keepWorldTransform : Bool, optional ignoreRestrictions : Bool) : Bool;
Copied!

AddPart

AddPart
Info & Usage
1
AddPart(obj : ref:GameObject, itemID : ItemID, partItemID : ItemID, optional slotID : TweakDBID) : Bool;
Copied!

CalculateTemporaryStatsBundle

CalculateTemporaryStatsBundle
Info & Usage
1
CalculateTemporaryStatsBundle(obj : ref:GameObject, rootPartID : ItemID, replacementPartID : ItemID, slotIdForReplacement : TweakDBID) : ref:StatsBundleHandler;
Copied!

CanItemBeActiveInSlot

CanItemBeActiveInSlot
Info & Usage
1
CanItemBeActiveInSlot(obj : ref:GameObject, slotID : TweakDBID, itemID : ItemID) : Bool;
Copied!

CanPlaceItemInSlot

CanPlaceItemInSlot
Info & Usage
1
CanPlaceItemInSlot(obj : ref:GameObject, slotID : TweakDBID, itemID : ItemID) : Bool;
Copied!

ChangeItemAppearance

ChangeItemAppearance
Info & Usage
1
ChangeItemAppearance(obj : ref:GameObject, itemID : ItemID, newAppearanceName : CName, optional useSuffixes : Bool);
Copied!

ChangeItemToSlot

ChangeItemToSlot
Info & Usage
1
ChangeItemToSlot(obj : ref:GameObject, newSlotID : TweakDBID, itemID : ItemID) : Bool;
Copied!

ClearAllSlots

ClearAllSlots
Info & Usage
1
ClearAllSlots(obj : ref:GameObject) : Bool;
Copied!

CycleActiveItemInSlot

CycleActiveItemInSlot
Info & Usage
1
CycleActiveItemInSlot(obj : ref:GameObject, slotID : TweakDBID) : ItemID;
Copied!

EquipActiveItemInSlot

EquipActiveItemInSlot
Info & Usage
1
EquipActiveItemInSlot(obj : ref:GameObject, slotID : TweakDBID, highPriority : Bool) : Bool;
Copied!

ForcePartInSlot

ForcePartInSlot
Info & Usage
1
ForcePartInSlot(obj : ref:GameObject, itemID : ItemID, partItemID : ItemID, slotID : TweakDBID) : Bool;
Copied!

GetActiveItemInSlot

GetActiveItemInSlot
Info & Usage
1
GetActiveItemInSlot(obj : ref:GameObject, slotID : TweakDBID) : ItemID;
Copied!

GetAvailableSlotsOnItem

GetAvailableSlotsOnItem
Info & Usage
1
GetAvailableSlotsOnItem(obj : ref:GameObject, itemID : ItemID, out availableSlots : array:TweakDBID);
Copied!

GetEmptySlotsOnItem

GetEmptySlotsOnItem
Info & Usage
1
GetEmptySlotsOnItem(obj : ref:GameObject, itemID : ItemID, out emptySlots : array:TweakDBID);
Copied!

GetItemAppearance

GetItemAppearance
Info & Usage
1
GetItemAppearance(obj : ref:GameObject, itemID : ItemID) : CName;
Copied!

GetItemData

GetItemData
Info & Usage
1
GetItemData(obj : ref:GameObject, itemID : ItemID) : wref:gameItemData;
Copied!

GetItemDataByOwnerEntityId

GetItemDataByOwnerEntityId
Info & Usage
1
GetItemDataByOwnerEntityId(id : EntityID, itemID : ItemID) : wref:gameItemData;
Copied!

GetItemInSlot

GetItemInSlot
Info & Usage
1
GetItemInSlot(obj : ref:GameObject, slotID : TweakDBID) : ref:ItemObject;
Copied!

GetItemInSlotByItemID

GetItemInSlotByItemID
Info & Usage
1
GetItemInSlotByItemID(obj : ref:GameObject, itemID : ItemID) : ref:ItemObject;
Copied!

GetItemList

GetItemList
Info & Usage
1
GetItemList(obj : ref:GameObject, out itemList : array:wref:gameItemData) : Bool;
Copied!

GetItemListByTag

GetItemListByTag
Info & Usage
1
GetItemListByTag(obj : ref:GameObject, tag : CName, out itemList : array:wref:gameItemData) : Bool;
Copied!

GetItemListByTags

GetItemListByTags
Info & Usage
1
GetItemListByTags(obj : ref:GameObject, tagList : array:CName, out itemList : array:wref:gameItemData) : Bool;
Copied!

GetItemQuantity

GetItemQuantity
Info & Usage
1
GetItemQuantity(obj : ref:GameObject, itemID : ItemID) : Int32;
Copied!

GetItemQuantityByTag

GetItemQuantityByTag
Info & Usage
1
GetItemQuantityByTag(obj : ref:GameObject, tag : CName) : Int32;
Copied!

GetItemsInstallableInSlot

GetItemsInstallableInSlot
Info & Usage
1
GetItemsInstallableInSlot(obj : ref:GameObject, itemID : ItemID, slotID : TweakDBID, out installableItems : array:ItemID);
Copied!

GetNextActiveItemInSlot

GetNextActiveItemInSlot
Info & Usage
1
GetNextActiveItemInSlot(obj : ref:GameObject, slotID : TweakDBID) : ItemID;
Copied!

GetNumItems

GetNumItems
Info & Usage
1
GetNumItems(obj : ref:GameObject, optional tagFilters : array:CName) : Int32;
Copied!

GetTotalItemQuantity

GetTotalItemQuantity
Info & Usage
1
GetTotalItemQuantity(obj : ref:GameObject) : Int32;
Copied!

GetUsedSlotsOnItem

GetUsedSlotsOnItem
Info & Usage
1
GetUsedSlotsOnItem(obj : ref:GameObject, itemID : ItemID, out used : array:TweakDBID);
Copied!

GiveItem

GiveItem
Info & Usage
1
GiveItem(obj : ref:GameObject, itemID : ItemID, amount : Int32) : Bool;
Copied!
Example
1
ts = Game.GetTransactionSystem()
2
3
player = Game.GetPlayer()
4
tid = TweakDBID.new("Items.money")
5
itemid = GetSingleton("gameItemID"):FromTDBID(tid)
6
7
result = ts:GiveItem(player, itemid, 100000)
Copied!

GiveItemByItemArrayQuery

GiveItemByItemArrayQuery
Info & Usage
1
GiveItemByItemArrayQuery(obj : ref:GameObject, itemQueryTDBID : TweakDBID, optional seed : Uint64) : Bool;
Copied!

GiveItemByItemData

GiveItemByItemData
Info & Usage
1
GiveItemByItemData(obj : ref:GameObject, itemData : ref:gameItemData) : Bool;
Copied!

GiveItemByItemQuery

GiveItemByItemQuery
Info & Usage
1
GiveItemByItemQuery(obj : ref:GameObject, itemQueryTDBID : TweakDBID, optional amount : Uint32, optional seed : Uint64, optional telemetryLogSource : String) : Bool;
Copied!

GiveItemByTDBID

GiveItemByTDBID
Info & Usage
1
GiveItemByTDBID(obj : ref:GameObject, tdbID : TweakDBID, amount : Int32) : Bool;
Copied!

GiveItems

GiveItems
Info & Usage
1
GiveItems(obj : ref:GameObject, itemList : array:ItemModParams) : Bool;
Copied!

GiveMoney

GiveMoney
Info & Usage
1
GiveMoney(source : ref:GameObject, target : ref:GameObject, amount : Int32, currency : CName) : Bool;
Copied!

GivePreviewItemByItemData

GivePreviewItemByItemData
Info & Usage
1
GivePreviewItemByItemData(obj : ref:GameObject, itemData : ref:gameItemData) : Bool;
Copied!

HasItem

HasItem
Info & Usage
1
HasItem(obj : ref:GameObject, itemID : ItemID) : Bool;
Copied!

HasItemDataInSlot

HasItemDataInSlot
Info & Usage
1
HasItemDataInSlot(obj : ref:GameObject, slotID : TweakDBID, itemID : ItemID) : Bool;
Copied!

HasItemInAnySlot

HasItemInAnySlot
Info & Usage
1
HasItemInAnySlot(obj : ref:GameObject, itemID : ItemID) : Bool;
Copied!

HasItemInSlot

HasItemInSlot
Info & Usage
1
HasItemInSlot(obj : ref:GameObject, slotID : TweakDBID, itemID : ItemID) : Bool;
Copied!

HasTag

HasTag
Info & Usage
1
HasTag(obj : ref:GameObject, tag : CName, itemID : ItemID) : Bool;
Copied!

InitializeSlots

InitializeSlots
Info & Usage
1
InitializeSlots(obj : ref:GameObject, out slotIDList : array:TweakDBID) : Bool;
Copied!

IsSlotEmpty

IsSlotEmpty
Info & Usage
1
IsSlotEmpty(obj : ref:GameObject, slotID : TweakDBID) : Bool;
Copied!

IsSlotEmptySpawningItem

IsSlotEmptySpawningItem
Info & Usage
1
IsSlotEmptySpawningItem(obj : ref:GameObject, slotID : TweakDBID) : Bool;
Copied!

MatchVisualTag

MatchVisualTag
Info & Usage
1
MatchVisualTag(entity : ref:Entity, tag : CName, optional matchUsingDefaultAppearance : Bool) : Bool;
Copied!

OnItemAddedToEquipmentSlot

OnItemAddedToEquipmentSlot
Info & Usage
1
OnItemAddedToEquipmentSlot(owner : ref:GameObject, itemID : ItemID) : Bool;
Copied!

OnItemRemovedFromEquipmentSlot

OnItemRemovedFromEquipmentSlot
Info & Usage
1
OnItemRemovedFromEquipmentSlot(owner : ref:GameObject, itemID : ItemID) : Bool;
Copied!

PrefetchItemAppearance

PrefetchItemAppearance
Info & Usage
1
PrefetchItemAppearance(obj : ref:GameObject, itemID : ItemID, newAppearanceName : CName);
Copied!

RefreshAttachment

RefreshAttachment
Info & Usage
1
RefreshAttachment(obj : ref:GameObject, out slotID : TweakDBID, optional keepWorldTransform : Bool);
Copied!

RegisterAttachmentSlotListener

RegisterAttachmentSlotListener
Info & Usage
1
RegisterAttachmentSlotListener(owner : ref:GameObject, callback : ref:AttachmentSlotsScriptCallback) : ref:AttachmentSlotsScriptListener;
Copied!

RegisterInventoryListener

RegisterInventoryListener
Info & Usage
1
RegisterInventoryListener(owner : ref:GameObject, callback : ref:InventoryScriptCallback) : ref:InventoryScriptListener;
Copied!

ReinitializeStatsOnEntityItems

ReinitializeStatsOnEntityItems
Info & Usage
1
ReinitializeStatsOnEntityItems(obj : ref:GameObject);
Copied!

ReleaseItem

ReleaseItem
Info & Usage
1
ReleaseItem(owner : ref:GameObject, item : wref:ItemObject) : Bool;
Copied!

RemoveAllItems

RemoveAllItems
Info & Usage
1
RemoveAllItems(obj : ref:GameObject) : Bool;
Copied!

RemoveItem

RemoveItem
Info & Usage
1
RemoveItem(obj : ref:GameObject, itemID : ItemID, amount : Int32) : Bool;
Copied!

RemoveItemByTDBID

RemoveItemByTDBID
Info & Usage
1
RemoveItemByTDBID(obj : ref:GameObject, tdbID : TweakDBID, amount : Int32) : Bool;
Copied!

RemoveItemFromAnySlot

RemoveItemFromAnySlot
Info & Usage
1
RemoveItemFromAnySlot(obj : ref:GameObject, itemID : ItemID, optional shouldDestroyEntity : Bool, optional keepWorldTransform : Bool) : Bool;
Copied!

RemoveItemFromSlot

RemoveItemFromSlot
Info & Usage
1
RemoveItemFromSlot(obj : ref:GameObject, slotID : TweakDBID, optional shouldDestroyEntity : Bool, optional keepWorldTransform : Bool, optional skipSendAnimEquipEvents : Bool) : Bool;
Copied!

RemoveMoney

RemoveMoney
Info & Usage
1
RemoveMoney(obj : ref:GameObject, amount : Int32, currency : CName) : Bool;
Copied!

RemovePart

RemovePart
Info & Usage
1
RemovePart(obj : ref:GameObject, itemID : ItemID, slotID : TweakDBID, optional shouldUpdateEntity : Bool) : ItemID;
Copied!

ResetItemAppearance

ResetItemAppearance
Info & Usage
1
ResetItemAppearance(obj : ref:GameObject, itemID : ItemID);
Copied!

SellItem

SellItem
Info & Usage
1
SellItem(seller : ref:GameObject, buyer : ref:GameObject, itemID : ItemID, amount : Int32, currency : CName, optional price : Int32) : Bool;
Copied!

SellItemStrict

SellItemStrict
Info & Usage
1
SellItemStrict(seller : ref:GameObject, buyer : ref:GameObject, itemID : ItemID, amount : Int32, currency : CName, optional price : Int32) : Bool;
Copied!

SetActiveItemInSlot

SetActiveItemInSlot
Info & Usage
1
SetActiveItemInSlot(obj : ref:GameObject, slotID : TweakDBID, itemID : ItemID) : Bool;
Copied!

TakeItem

TakeItem
Info & Usage
1
TakeItem(newOwner : ref:GameObject, itemToLoot : wref:ItemObject) : Bool;
Copied!

ThrowItem

ThrowItem
Info & Usage
1
ThrowItem(owner : ref:GameObject, item : wref:GameObject, setUpAndLaunchEvent : ref:gameprojectileSetUpAndLaunchEvent) : Bool;
Copied!

TransferAllItems

TransferAllItems
Info & Usage
1
TransferAllItems(source : ref:GameObject, target : ref:GameObject) : Bool;
Copied!

TransferItem

TransferItem
Info & Usage
1
TransferItem(source : ref:GameObject, target : ref:GameObject, itemID : ItemID, amount : Int32) : Bool;
Copied!

UnregisterAttachmentSlotListener

UnregisterAttachmentSlotListener
Info & Usage
1
UnregisterAttachmentSlotListener(owner : ref:GameObject, listener : ref:AttachmentSlotsScriptListener);
Copied!

UnregisterInventoryListener

UnregisterInventoryListener
Info & Usage
1
UnregisterInventoryListener(owner : ref:GameObject, listener : ref:InventoryScriptListener);
Copied!
Last modified 9mo ago