Playmaker Forum
PlayMaker Feedback => Feature Requests => Topic started by: djaydino on January 29, 2018, 02:44:57 PM
-
Hi.
It would be nice if there is a reset bool option on all the standard 'get next' action as i noticed that this is useful in many cases.
-
Hi,
yes, I agree, I'll check with Alex if he's ok for this to be added. The problem is it's complex to explain, but indeed I think necessary for completness in possibilities.
Bye,
Jean
-
Not sure what this is. Can you give an example?
-
Hi.
@tcmeric
for example a get next action will loop from 0-9 but then you only want to loop it until a certain object is found (object was for example on index 4)
Later you want to loop again from the start, if there is no reset option the action will continue from it last position which means (in the example) it will not start from 0 but it will start from index 5 (continue from its last know index)
With a reset option the action will check if reset is true before continuing.
If false it will continue like looping.
If true it will Start back from the 'start index' and set the reset bool to false.
You can see the difference on 'ArrayGetNext2' on the ecosystem.
There are many cases that you do not want to loop thru the whole array list (or other lists like 'Get Next Child')
-
Good point. Also an auto array lenght on array get next. It would avoid aving to get the array lenght an create a variable just for that.
-
Hi.
@Marc Saubion
If you leave the end index to 0 it will loop thru the whole list, then you do not need the Length :)
-
I actually added a reset button to those default "get next" actions a short while ago while working on the DialogManager for my game, without even knowing that there seems to be a demand for that functionality.
As it turns out, there couldn't be anything more trivial: since those actions rely on caching the current index in a private variable which don't get reset when re-entering the action, so you have to do it yourself at the start of OnEnter(), like so:
if(reset.Value) nextItemIndex = 0; reset.Value = false;
(as you can see I even added that the reset bool automatically gets set back to false after resetting the index, since there's no plausible reason to keep resetting the action, and if there is, one could just keep the bool set to true in the action after that "get next" action).
You can find the two customized actions for 'Array Get Next' and 'Get Next Child' in the attachments and I would also urge HutongGames to add that option to the standard actions, so that no one has to rely on these or their own custom actions just for that function (even though you rarely need it, it's very nice-to-have if one does).
-
Hi.
@Marc Saubion
If you leave the end index to 0 it will loop thru the whole list, then you do not need the Length :)
Thanks for the tip. I should read the tooltip more carefully. XD
-
hi.
Reset options will be added to the official actions soon (maybe in the next update)