Library›Items
Swap item
fn/game.SwapItem
Takes so many of one item from somebody and, if they had them, gives so many of another. Done tells whether the swap happened.
- Does
- An action: done when the run reaches it
- Runs
- On every machine
- Listed under
- Library › Items
- In a file
fn/game.SwapItem
Pins
- inwhoa character
The person.
- ingivean item data
Give.
Starts as
item/BreadSlice - ingiveAmounta whole number
GiveAmount.
Starts as
1 - ingetan item data
Get.
Starts as
item/BreadSlice - ingetAmounta whole number
GetAmount.
Starts as
1 - outdoneyes or no
Done.
How it is made
Its body, as the bench opens it read-only. Copy into my mod on the bench makes a copy to change. The library's file is items.graph.json.
Built from
- Has enough
fn/game.HasEnoughWhether somebody carries at least so many of an item. - Branch
flow/BranchGoes one way when the condition holds, the other way when it doesn't. - Take item
call/Game.TakeItemTakes so many of an item from somebody's bag, if they have that many. - Give item
call/Game.GiveItemPuts so many of an item into somebody's bag.
Modding