Skip to content

Instantly share code, notes, and snippets.

@ktemkin
Created January 4, 2021 21:09
Show Gist options
  • Save ktemkin/6d1ea9781fcdcb3db8f3dbd2c0feb59f to your computer and use it in GitHub Desktop.
Save ktemkin/6d1ea9781fcdcb3db8f3dbd2c0feb59f to your computer and use it in GitHub Desktop.
-- Get the basic systems we'll want to work with.
player = Game.GetPlayer()
scriptables = Game.GetScriptableSystemsContainer()
transaction = Game.GetTransactionSystem()
equipment = scriptables:Get(CName.new("EquipmentSystem"))
-- Get data for the player.
player_data = equipment:GetPlayerData(player)
-- Hack: we need the second internal entry with the same name; so we'll create our own entry pointing to the new function.
-- This feels _great_, doesn't it?
player_data['GetNovaStuff'] = player_data['GetItemInEquipSlot;gamedataEquipmentAreaInt32']
-- Try to grab the arm cyberware.
item_id = player_data:GetNovaStuff("ArmsCW", 0)
-- Remove it.
transaction:RemoveItem(player, item_id, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment