![]() |
adding actions in front of actionlist
Hello,
I know that {avatar}.addAction adds an action pending in the end of an actionqueue, waiting to get handled. Now, in my project I would like to edit the pending actionqueue, in particular: add an extra action in front of the actionlist. For example I would have this scenario: avatar.addAction(walkToBar) avatar.addAction(orderAdrink) avatar.addAction(drink) but, considering above scenario, I would like to be able to edit this on the fly (by A.I. of the avatar) to for example: avatar.addAction(walkToBar) avatar.addAction(orderAdrink) avatar.addAction(drink) while the avatar is performing the walktoBar action, but on his path he meets a friend. Then I would like to change his actionqueue to: - talk with friend - walk to bar (continue the walk or restart a walk action) - order a drink - drink Is this possible in the current node3d/avatar implementation, or would I have to change my already inherited avatar class by extending it with a new sort of InsertAction()? Pseudo: Code:
todoActions = avatar.getActionList() 1, then in 2, etc..) Thanks! |
You would need to do something like your InsertAction code there and call a clearActions or runAction command and then add your list of actions again.
The different pools will be executed simultaneously so you can have actions running in parallel on an object. |
All times are GMT -7. The time now is 06:05 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC