Yes, That is exactly the solution I was going to suggest here as well 🙂
That is to create a condition that checks the state status and thus this way, it is also possible to use it normally within a condition list and to do an “If State Finish OR Something Else”.
Your version of the condition should work fine, but here is a slightly different one:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
usingNodeCanvas.Framework;
usingParadoxNotion;
usingParadoxNotion.Design;
usingNodeCanvas.StateMachines;
namespaceNodeCanvas.Tasks.Conditions{
[Category("✫ Utility")]
[Description("Check the parent state status. This condition is only meant to be used along with an FSM system.")]
publicclassCheckStateStatus:ConditionTask{
publicCompactStatus status=CompactStatus.Success;
protectedoverridestringinfo{
get{returnstring.Format("State == {0}",status);}
}
protectedoverrideboolOnCheck(){
varfsm=ownerSystem asFSM;
if(fsm!=null){
varstate=fsm.currentState;
return(int)state.status==(int)status;
}
returnfalse;
}
}
}
Thanks!
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.