Is there a way to add an fail action following a TimeLimit decorator timeout? #331
-
I want fail a task after a given amount of time, however I also what that to result in setting an agent property to false. This will prevent the initial condition from triggering that same sequence in a loop. Currently I can only set that property if the sequence succeeds further than I'd like or completely independently of limboai. I have been able to do this by making a timer within a custom task that fails on timeout and returns to zero. Ideally, I wouldn't need to add this to every task in this style, instead I'd reuse the decorator. I feel like the TimeLimit decorator should have a on time out script? |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
This should do it:
|
Beta Was this translation helpful? Give feedback.
-
I should have mentioned Im using a dynamic selector which jumps back to the top of the stack
…________________________________
From: Serhii Snitsaruk ***@***.***>
Sent: Friday, May 30, 2025 1:11:46 AM
To: limbonaut/limboai ***@***.***>
Cc: OtherRealms ***@***.***>; Author ***@***.***>
Subject: Re: [limbonaut/limboai] Is there a way to add an fail action following a TimeLimit decorator timeout? (Discussion #331)
This should do it:
Selector
-- TimeLimit
---- MyAction
-- ActionToRunWhenTimeLimitFails
—
Reply to this email directly, view it on GitHub<#331 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AN5TQPZZXLPCZ3HK7EXD4IT3A4PTFAVCNFSM6AAAAAB6FXKSWCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMZRGA4TOMA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
This should work regardless of outside structure, as long as you wrap time limit under selector, as I described above. |
Beta Was this translation helpful? Give feedback.
-
So what I'd like it to do is break out of the entire sequence by resetting the precondition (check variable), so basically if it can't succeed on the first action within a given time, it looses interest and moves onto a different sequence.
If the agent does lock its view onto the player within the time limit, it then continues with the next step in the 'interested in player' sequence.
If got it working by embedding a timer within the first task but thought there might be a way to do it in the stack.
|
Beta Was this translation helpful? Give feedback.
-
Just use selector, what you describe is literally it's job description. If something fails, try the next thing and so on. |
Beta Was this translation helpful? Give feedback.
-
I understand but it won't pass this sequence as long as 'check if' is still true, I'd like to set it to false as a result of timeout.
The order is 1st SEQUENCE->CHECK IF =true -> TASK within time, ON FAIL -back to 1st SEQUENCE. This is the first sequence under the selector because it allows it to interupt any others. Being a dynamic selector, it gets stuck on the 1st sequence rather than moving onto the next.
Some context;
Its triggered by a collision between agent and player and I'd like it to remain true until set false by something meaningful , in this case the agent might attempt to face the player but may eventually give up. If the agent succeeds, they then follow the remaining tasks i.e. navigate to player..., then interest is set to false again at the end of the stack.
Pablo TA
…________________________________
From: Serhii Snitsaruk ***@***.***>
Sent: Friday, May 30, 2025 8:56:06 AM
To: limbonaut/limboai ***@***.***>
Cc: OtherRealms ***@***.***>; Author ***@***.***>
Subject: Re: [limbonaut/limboai] Is there a way to add an fail action following a TimeLimit decorator timeout? (Discussion #331)
Just use selector, what you describe is literally it's job description. If something fails, try the next thing and so on.
—
Reply to this email directly, view it on GitHub<#331 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AN5TQP5KRA5ND7BGFG6A3U33A6GANAVCNFSM6AAAAAB6FXKSWCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMZRGUZTOOI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I think it would work as expected with a regular selector, I used dynamic selector so that the first two sequences are able to interrupt Follow Path at anytime. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Just my two cents, you could also use two selectors like so:
This way, |
Beta Was this translation helpful? Give feedback.
here's my solution for a custom TimeLimit decorator:
*edited order, Flee can interrupt, Approach Player which can interrupt Follow Path.
I hope I didn't override something with on exit, otherwise it works as expected.