Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork104
best practice for populating variables vis custom resource#319
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
assuming my agents have a custom resource like "AgentStats" that define core stats like "base_speed" what is the best practice for populating the Blackboard. As I understand it, is this the best way:
|
BetaWas this translation helpful?Give feedback.
All reactions
It depends on what you need. You could also just pass the resource and work with it instead.
Or, you could write a general-purpose function to add variables from a resource like that (provided you want the same names as the property names):
for prop_info in my_resource.get_property_list(): if prop_info.usage & PROPERTY_USAGE_SCRIPT_VARIABLE and prop_info.usage & PROPERTY_USAGE_STORAGE: blackboard.set_var(prop_info.name, my_resource.get(prop_info.name))Replies: 1 comment
-
It depends on what you need. You could also just pass the resource and work with it instead. Or, you could write a general-purpose function to add variables from a resource like that (provided you want the same names as the property names): |
BetaWas this translation helpful?Give feedback.