Comments (1)
Ohhh my... Today I've had a hard nut to crack. Haha.
Have a look at this code (https://github.com/acdamiani/schema/blob/main/Runtime/Proc/ExecutableNode.cs#L178):
bool isSub = current.IsSubTreeOf(node);
bool isPriority = current.IsLowerPriority(node);
switch (c.abortsType)
{
case Conditional.AbortsType.Self when !isSub:
case Conditional.AbortsType.LowerPriority when !isPriority:
case Conditional.AbortsType.Both when !isPriority && !isSub:
continue;
}
bool status = c.Evaluate(conditionalMemory[id][j], context.agent);
status = c.invert ? !status : status;
if (!lastConditionalStatus.TryGetValue(j, out bool last)) last = status;
lastConditionalStatus[j] = status;
if (last == status) continue;
switch (c.abortsWhen)
{
case Conditional.AbortsWhen.OnSuccess when status:
case Conditional.AbortsWhen.OnFailure when !status:
case Conditional.AbortsWhen.Both:
return true;
}
These kind of double negations is not made for a human brain. :)
For instance:
I have a class that returns true if the enemy has Mana to fight.
I want him to chase the player if there is no mana but abort the node if mana is back.
Sounds easy but the settings creates a knot in a humans head. Haha.
If you would create an if statement it would look like this:
if (!HasMana()) {
ChasePlayer();
} else if (AbortType == AbortType.Self && HasMana()) {
StopChasePlayer
}
I've create my own text for this Conditional to make it more clear.
Maybe you could also do that by default? I know it's not easy because of the different wordings. Believe me, in German it would be hell on earth to standardize that. Haha.
from schema.
Related Issues (13)
- Connections and some nodes are gone after update to commit 15b26ec4829f64418e47cd99410415604fe16ac7 HOT 3
- BlackboardEntry references are gone after adding an entry to Blackboard HOT 9
- RotateTowardsVector resets references when I hit play HOT 1
- Conditional is evaluated even if corresponding node is not running HOT 3
- I get this error when searching for components. HOT 5
- Missing OnNodeExit() Call on conditional node abort HOT 3
- entryType is NULL HOT 5
- OverlapSphere does not check against Internal Types HOT 2
- Stop Idle Node Execution HOT 5
- Node execution in parallel
- `BlackboardEntrySelector` cannot currently be used in a Modifer
- Conditionals do not abort lower priority nodes on failure 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 schema.