You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently there are no conditional expression that compares time + delay with value in the blackboard.
Describe the solution you'd like
I've created one, it looked like this
@toolclass_nameDelayConditionextendsConditionLeaf## This expression should result in float of unix time## For example: get_state("last_aim_unix_time")@export_placeholder(EXPRESSION_PLACEHOLDER) varoperand_time_float: String=""## Time delay in second## Will be compared to the result of operand_time_float## Will not be checked if time is zero@export_range(0.0, 100.0, 0.0, "or_greater", "hide_slider") vartime_second: float=1.0@onreadyvar_expression_time_float: Expression=_parse_expression(operand_time_float)
functick(actor: Node, blackboard: Blackboard) ->int:
varnow=Time.get_unix_time_from_system()
vartime_raw: Variant=_expression_time_float.execute([], blackboard)
iftypeof(time_raw) !=TYPE_FLOAT:
push_error("The expression: \"%s\" does not result in float"%operand_time_float)
iftime_raw==0.0:
returnFAILEDiftime_raw+time_second>now:
returnFAILEDreturnSUCCESS
In the scene it looked like this (changed a bit for brevity):
Describe alternatives you've considered
None, for now.
Additional context
I'm using the behavioral tree instead of Finite State Machine for my main character's state. Currently I've implemented this condition for my main character's abilities. It goes like this:
Player click fire <--- add to blackboard the timestamp when it first clicked using just_pressed and get_unix_time_from_system
Must hold the fire for a duration of time <--- this is where this condition is being used
After it's passed, then fire the gun in the direction
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently there are no conditional expression that compares time + delay with value in the blackboard.
Describe the solution you'd like
I've created one, it looked like this
In the scene it looked like this (changed a bit for brevity):
Describe alternatives you've considered
None, for now.
Additional context
I'm using the behavioral tree instead of Finite State Machine for my main character's state. Currently I've implemented this condition for my main character's abilities. It goes like this:
The text was updated successfully, but these errors were encountered: