Here is a collection of Lua tips that I've posted.

Table of contents:

  • Refreshing Perks / Character Deck Changes
  • Toggling Uniformed Access
  • Adding ETO / Tech Points
  • Trying on Clothing
  • Lua Misc Snippets

How to use Lua commands:
  • Open the Lua console via Lua > Open Lua Console
  • Copy and paste a Lua command from below into the Lua console. Make any customizations (if necessary).
  • Click Execute.



Lua Tip: Refreshing Perks / Character Deck Changes

Normally, after changing your character's perks, you need to switch operatives, or save and reload the game before all perk changes are effective.

To refresh perks instantly without having to reload the game, run the below Lua command with your active operative that has the modified perks/character deck.

This is especially useful when you're making many changes or experimenting with perks.

lua('AddItem("Items.9223372285441124841", 1)')

This item is the multidrone gadget and it's special because it is one of the few items with the "Perk"-type. When added, the game will immediately refresh all perks, items and atoms associated with the perks.

Important note: Every time you run this command, the game will add one more multidrone perk to your character.

There is no harm in having the perk, but to remove extra copies of the perk, go to the Perks section of your operative (Operative > NPC Data > Perks) and set the multidrone entry to 0 (Empty) to remove it, then save changes.



Toggling Uniformed Access

Normally, you can only toggle Uniformed Access outside of a restricted zone. The following Lua script allows you to do so even if you're inside a restricted zone, allowing you to duck behind a pillar and switch disguises on-the-fly. I recommend assigning this one a hotkey so that you can activate it without leaving the game.

Toggle Uniformed Access while in restricted zones:
lua([[
local equipUniform = 1
if HasAccessUniformEquipped(GetLocalPlayerEntityId()) == 1 then
  equipUniform = 0
end
EquipAccessUniform(GetLocalPlayerEntityId(), equipUniform)
]])




Lua Showcase: Adding ETO / Tech Points

Add some crypto or tech points with the following Lua commands.

Add 1k ETO:
lua([[
TriggerRuleSmithRule('589221860', '', GetLocalPlayerEntityId())
]])


Add 20k ETO:
lua([[
for i=1,20 do
  TriggerRuleSmithRule('589221860', '', GetLocalPlayerEntityId())
end
]])


Add 10 tech points:
lua([[
TriggerRuleSmithRule('189922678', '', GetLocalPlayerEntityId())
]])




Lua Showcase: Trying on Clothing

The Appearance section of the editor allows you to change an inactive operative's clothing, and you can preview your changes in the Team menu right away.

But what if you want to try on pieces of clothing on your current operative, without having to switch back-and-forth between operatives?

Use the EquipWolfskinItemOnEntity Lua command to try on clothing on your current active operative. (All clothing items are wolfskin items)

Lua command:
lua([[
local wolfskinItemToEquip = "WolfskinItemDB.9223372174236484278"
EquipWolfskinItemOnEntity(wolfskinItemToEquip, wolfskinItemToEquip, GetLocalPlayerEntityId(), 0)
]])

How to use:
  • Under the Lua section of the editor, enable thread-safe mode, then open the Lua console.
  • Go to the list of all clothing wolfskin items and copy the dec (decimal) ID of your desired clothing item.
  • Copy and paste the above Lua command into the Lua console, replacing the ID number with your desired ID.
  • Click Execute, then return to the game to see your newly equipped clothing item.

Extra: Here is the list of outfit IDs.



Lua Misc Snippets

Spawn Wrench's Drone, Sergei, at the reticle location:

lua([[
local loc = GetReticleHitLocation()
local archetypeToSpawn = "{e082946e-343d-40e6-ac9a-f3e17c31318e}"
if spawnedEnt ~= nil then RemoveEntity(spawnedEnt) end
spawnedEnt = SpawnEntityFromArchetype(archetypeToSpawn, loc[1], loc[2], loc[3], 0, 0, 0)
]])

Article information

Added on

Edited on

Written by

registrator2000

4 comments

  1. suixing
    suixing
    • member
    • 0 kudos
    你能写更多实用的Lua脚本吗,例如传送,无设备冷却时间等。另外我想知道生成物品时,对应的物品代码在哪里查看,谢谢。
  2. XxxTASERxxX
    XxxTASERxxX
    • BANNED
    • 20 kudos
    About LUA clothing: it's working for outfits too. I think you need add outfits list too. 
    1. registrator2000
      registrator2000
      • premium
      • 2,592 kudos
      Thanks for testing it. I've added the list of outfits to the post.
    2. XxxTASERxxX
      XxxTASERxxX
      • BANNED
      • 20 kudos
      Cool)