Created
September 27, 2023 05:17
-
-
Save Suor/a43ff60709e7f0d3ffd1f14e87541792 to your computer and use it in GitHub Desktop.
Dev Console Cheatsheat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cycle bros | |
local bros = World.getPlayerRoster().getAll(); | |
foreach (bro in bros) { | |
logInfo(bro.getName()); | |
// ... | |
} | |
// Add skill to a bro | |
local bro = ::getBro("Hubert") | |
local trait = this.new("scripts/skills/traits/master_trait"); | |
bro.getSkills().add(trait); | |
// Fix/break items in stash | |
local items = World.Assets.m.Stash.getItems(); | |
foreach (item in items) { | |
if ("setCondition" in item) item.setCondition(item.getConditionMax() - 1); | |
} | |
// Find enemies in combat by name | |
local name = "Brigand Headshot"; | |
local ops = getBro().getAIAgent().getKnownOpponents(); | |
ops = ops.map(@(r) r.Actor).filter(@(_, a) a.getName() == name); | |
std.debug(ops); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reroll all hires | |
local towns = this.World.State.m.Entities.m.Settlements; | |
foreach (town in towns) { | |
this.logInfo(town.getName()); | |
town.resetRoster() | |
town.updateRoster() | |
} | |
// reroll hires in a city | |
local town = ::getTown("Quadim"); | |
town.resetRoster() | |
town.updateRoster() | |
// reroll hires in a nearest city | |
local towns = this.World.EntityManager.getSettlements(); | |
local playerTile = this.World.State.getPlayer().getTile(); | |
local town, distance = 99999; | |
foreach (i, t in towns) { | |
local d = t.getTile().getDistanceTo(playerTile); | |
if (d < distance) {distance = d; town = t} | |
} | |
::logInfo("Nearest town is " + town.getName()); | |
town.resetRoster() | |
town.updateRoster() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment