-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotations related to script tasks #6596
base: develop
Are you sure you want to change the base?
Conversation
seems to not be referenced in any files?
---| and " instead of --- | and '
This is what you get from `GetUnitCommandFromCommandCap`
Specify every RULEUCC conversion Add the default "None" value Fix spelling
the comment was being set as the comment for the import on the line after it
Basically mprovements upon annotations in FAForever#5822 Co-Authored-By: (Jip) Willem Wijnia <[email protected]>
This reverts commit cc440f3.
@@ -73,6 +73,7 @@ end | |||
function debug.allocatedsize(obj) | |||
end | |||
|
|||
--- Returns a cached table of all table allocations tracked between calls of `debug.trackallocations(true)` and `debug.trackallocations(false)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is super interesting!
RULEUCC_Invalid = None | ||
```]] | ||
---@param rule EngineCommandCap | ||
---@return string | "None" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could turn this into a list of options instead of just a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some much-needed documentation on the available tasks. I strongly believe there's still a world to discover here for the FAForever project 😄 !
---| -3 # Abort: "kill all tasks on this thread". Not implemented, usage will cause the unit to be stuck on the command. | ||
---| -4 # Delay: move task to end of this tick's task queue. There is no way to have multiple tasks per tick? | ||
---| 0 # Repeat execution immediately. | ||
---| 1+ # 1+: The task waits the given number of ticks. For example, the value `3` means the task waits for three ticks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1+
? Maybe +1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"1+" means "1 or more". Also are you referring to the 1+ in the type or in the comment? The + symbol in the type doesn't actually do anything with intellisense, it doesn't even show up in the tooltip, so that's why I repeated "1+" in the comment.
@@ -3,12 +3,17 @@ local TASKSTATUS = import("/lua/sim/scripttask.lua").TASKSTATUS | |||
local GiveUnitsToPlayer = import("/lua/simutils.lua").GiveUnitsToPlayer | |||
local SpawnPing = import("/lua/simping.lua").SpawnPing | |||
|
|||
local transferList = {} | |||
local transferList = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There mustn't be global values like this in sim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such tables tend to prevent from garbage collection entities that were already destroyed. Something like this really has to be weak or be defined within some other object like ai brain.
lua/sim/ScriptTask.lua
Outdated
self.CommandData = commandData | ||
end, | ||
|
||
-- Called by the engine every tick. Function must return a value in TaskStatus | ||
--- Called by the engine in an interval. Function must return a value in TaskStatus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether Function must return a value defined in TaskStatus
or Function must return a value from TaskStatus
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or simply Function must return TaskStatus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "Called by the engine at an interval determined by the returned TaskStatus value"?
The required return value is obvious from the @return
and every script task using it, so I omitted it and added info about how the interval is determined.
Description of the proposed changes
ScriptTask
s and related code.orders.lua
's interaction with scripted abilities like ScryTesting done on the proposed changes
commandmode.lua
andUserScriptCommand
RemoteViewing.lua
, andXAB3301_script.lua
Clipboard command to view all UnitCommands from RULEUCC command caps
Checklist