Don't Starve Together

Don't Starve Together

ActionQueue Reborn
nope  [developer] 26 Aug, 2019 @ 6:01pm
ActionQueue Allowed Actions
In a somewhat recent update, I exposed some functions that would allow users to add to and modify the allowed_actions list that ActionQueue uses. This list is what determines if (and under what conditions) an entity can be selected for an action. These functions can be utilized from the in-game client console or added to the modmain of a client mod.

Add actions from other mods or base game actions that I haven't. Modify the conditions of actions already on the list to be more or less restrictive. Remove actions you don't use or cause conflicts for your playstyle. The console commands can be used to test / temporarily change an action and its condition. Enabling debug print in the config options will give information whether changes are successful or what the problem is if they aren't.

Console Commands
AddActionQueuerAction(category, action, testfn) AddActionQueuerActionList(category, ...) RemoveActionQueuerAction(category, action) RemoveActionQueuerActionList(category, ...)

AddComponentPostInit Functions
self.AddAction(category, action, testfn) self.AddActionList(category, ...) self.RemoveAction(category, action) self.RemoveActionList(category, ...)
Last edited by nope; 6 Oct, 2019 @ 11:10pm
< >
Showing 1-4 of 4 comments
nope  [developer] 6 Oct, 2019 @ 8:41pm 
category
These would be used for the "category" parameter.
"leftclick" "rightclick" "allclick"
An action should always exist in 1 of these 3 categories.
  • "leftclick" is for adding actions that are performed by leftclicking.

  • "rightclick" is for adding actions that are performed by rightclicking.

  • "allclick" is for adding actions that are performed by leftclicking but can initiated by rightclicking within action queue. ACTIONS.CHOP is in this category; This allows rightclick selecting a tree to chop it without selecting logs near it since ACTIONS.PICKUP is a leftclick action only. This is typically used to allow filtering for tool actions.

"single" "tools" "autocollect" "collect" "noworkdelay"
An action may exist in several of these categories or none of them.
  • "single" is for actions that do not change after performing that action. Beefalo will always have the option to shave whether it has fur or not. Without this category, the player would be stuck trying to shave the same beefalo forever.

  • "tools" is for actions involving tools to ensure that the action thread waits for a tool to be re-equipped, it would exit the queue thread when a tool breaks otherwise.

  • "autocollect" are actions that will trigger a collection of nearby entities if auto-collect is enabled.

  • "collect" contains the actions that are eligible for collection when an auto-collection is triggered.

  • "noworkdelay" actions added to this category have the potential to be performed faster by skipping the time waiting for the player to be idle again before continuing to the next entity.

action
The "action" parameter is where you enter the action to add, modify, or remove it from the allowed actions list.
"DRY" or ACTIONS.DRY "CHOP" or ACTIONS.CHOP "PICK" or ACTIONS.PICK
The string name or the ACTIONS table reference can be used.

"..." parameter allows you to add a list of actions without a condition.
"DRY", "CHOP", "PICK" ACTIONS.DRY, ACTIONS.CHOP, ACTIONS.PICK

testfn
"testfn" parameter can be true or a conditional function. It is only used when adding actions individually.
true function(target) --[[conditional]] end
  • true would add the action to the specified category without condition.

  • A function allows you to specify inclusions or exclusions based on the target entity or ThePlayer.

An example of a inclusive condition would be
function(target) return target:HasTag("evergreen") end
If used with ACTIONS.CHOP, only evergreen trees would be selectable for chopping with action queue.

An example of a exclusion condition would be
function(target) return not target:HasTag("evergreen") end
This would conversely allow all trees except evergreens.

A testfn of true with ACTIONS.CHOP would allow chopping of any entity that prompts that action.
Last edited by nope; 7 Oct, 2019 @ 5:48pm
nope  [developer] 6 Oct, 2019 @ 8:58pm 
Client Console Examples
RemoveActionQueuerAction("allclick", "CHOP") AddActionQueuerAction("leftclick", "CHOP", true) AddActionQueuerAction("leftclick", "CHOP", function(target) return target:HasTag("evergreen") end)

AddComponentPostInit Examples
AddComponentPostInit("actionqueuer", function(self, inst) self.RemoveAction("allclick", "CHOP") self.AddAction("leftclick", "CHOP", true) self.AddAction("leftclick", "CHOP", function(target) return target:HasTag("evergreen") end) end)
Last edited by nope; 6 Oct, 2019 @ 9:42pm
Shift 7 May, 2022 @ 9:15pm 
I have been trying my hand at adding an action queue for planting seeds in the new farm soil entity. I have been unsuccesful thus far.

You seem to have the know how. Would it be possible to add an action queue for planting seeds in the new farm soil or does it have something to do with the old farm plots still being in the game?
♡ Kitty Cat ♡ 24 Nov, 2022 @ 2:22pm 
Originally posted by Shift:
I have been trying my hand at adding an action queue for planting seeds in the new farm soil entity. I have been unsuccesful thus far.

You seem to have the know how. Would it be possible to add an action queue for planting seeds in the new farm soil or does it have something to do with the old farm plots still being in the game?

I believe the new soil uses a different planting action from the old farm plots.
It's either PLANTSOIL or PLANTWEED.

Shameless plug for an expansion mod that adds the actions you wanted:
https://steamproxy.net/sharedfiles/filedetails/?id=2892856427
Last edited by ♡ Kitty Cat ♡; 24 Nov, 2022 @ 2:24pm
< >
Showing 1-4 of 4 comments
Per page: 1530 50