-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Some nodes can only use fixed values #224
Comments
|
So what are the best practices for those who need runtime changes? Can I only use BTask to implement the functions that the decorator already has? Fixed: BBNode -> BBParam |
I've found that it's possible to define the value of the setting yourself by inheriting from the decorator class. But it seems that inheritance doesn't implement the built-in logic, so I'll confirm it when I look into it |
Ah, you meant BBParam. I tried to use BBParam only where it's most needed, because it takes more clicks to edit parameters in GDExtension (unlike in module version). If this PR gets accepted, we can adopt it more widely: |
Extending BTDecorator does what I expected so far, but Limboai demo doesn't seem to have an example of this. For example, if I want to implement my own defined BTColldown decorator, then: extends BTCooldown
func _setup() -> void:
duration = agent.attack_frequency
func _tick(delta: float) -> Status:
return get_child(0).execute(delta)
The above code didn't work, didn't extend BTCooldown, so I ended up choosing to extend BTDecorator extends BTDecorator
@export var duration: float
var _time: float = 100
func _setup() -> void:
duration = agent.attack_frequency
func _tick(delta: float) -> Status:
if _time > duration:
_time = 0
return get_child(0).execute(delta)
_time += delta
return FAILURE |
That's not how inheritance work. If you override |
If I don't override _tick method, then Cooldown will never execute the child node. extends BTCooldown
func _setup() -> void:
duration = agent.attack_frequency If I don't cover anything, including _setup, that custom Cooldown works. extends BTCooldown
use Godot4.4 dev2 test |
Right, that may be a bug. Since you are overriding |
Fixing it in #227. |
Problem statement
Can built-in decorator nodes only use fixed values? For example, the Duration of Cooldown and the Run Limit of RunLimit can be changed to refer to BBNode, similar to the animation playback node of Scene, which greatly increases flexibility.Even all the properties can be set directly or by code using BBNode.
Proposed solution
none
Alternatives
none
The text was updated successfully, but these errors were encountered: