Comments (7)
Update: I found out you can "Label" nodes. What about adding extension method or member method to node like
new Selector(...).Labeled("Steering");
or "fake decorator" like
NPBehave.Labeled("Steering", new Selector(...));
Probably best solution would be to add this directly in the constructor like so
new Selector("Steering", ...);
But that would require a lot of changes
from npbehave.
Hey, so the intended syntax for the labelling is quite similar to your first idea
new Selector(...).Labeled("Steering");
it goes like this:
new Selector(
...
) { Label = "Follow" }
adding your idea wouldn't be much work, but maybe you can work already with the syntax we have?
from npbehave.
Checked it briefly, it's fine but "Fake Decorator" would be still a little better due to information flow. Because then you have label next to actual node definition and not after this.
This could be added as a simple Utility Method, I might try doing it later.
from npbehave.
OK. We can maybe also go for the one to include it in the constructor, but it will increase amount of mandatory fields. I would like to keep it optional if possible...
With 2.0 I'll probably have to rethink the way we handle growing amounts of fields in the constructors. Not sure if there is any better way to describe the trees by Code. But I would like to also reduce the amount of constructors if possible.
Maybe we could prefer using named parameters somehow, but I'm not sure if it works with the composites so well. Maybe we could live with something like
new Selector( label: "Follow", children: [
...
] ),
from npbehave.
Actual utility method would look more or less like this now that I look at it:
public static class NPBehaveUtils
{
public static Node Label(string label, Node node)
{
node.Label = label;
return node;
}
}
Now, you can just add using static NPBehaveUtils
on top of the script and done
Label("Steering", new Selector(
...
));
from npbehave.
I also think, after second thought that it would be the best solution due to it being universal for every Node
from npbehave.
right. Let's keep it simple for now. For 2.0 we can rethink this
from npbehave.
Related Issues (20)
- GC/Performance problems HOT 20
- Randomized Nodes HOT 16
- Still maintained? HOT 3
- BlackboardCondition seems can't stop lower priority repeater node when using a child blackboard HOT 2
- NPBehave TimeScale starts with 0
- [Question] Clock timer with repetitions HOT 3
- I want to do something for the Project.Among them, visual editing behavior, Chinese documents HOT 13
- Purpose of bool param in multiframe Action HOT 9
- Assertion in Wait action HOT 1
- NPBehave 2.0 Changes - Wishlist HOT 15
- Null check on Condition node works but not on BlackboardCondition node HOT 2
- RandomSequence Stop wrong children HOT 1
- Pausing the behavior tree HOT 8
- Creation Utility class HOT 3
- NavMoveTo always fails when stopOnTolerance==true HOT 3
- simpleAI example problem HOT 3
- A question about the source code of Clock.cs and Blackborad.cs HOT 2
- It is not possible to handle player input because the tree cannot wait for some action while execute other in parallel HOT 1
- Question about order of timers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npbehave.