Actually, I must have had a brain freeze, you don't need chooseindex.
Just use Array.At(0,counter)
Looks very similar to my issue:
construct.net/en/forum/construct-3/general-discussion-7/help-editor-randomly-lagging-173900
Freezes in the expression editor are the worst. But there are also lags when dragging events or objects in layout view, very much like in your video.
Only in my case the issue seems to be random, I am not sure if it gets worse the longer the editor is open.
You do not have permission to view this post
Counter is just a name of a variable. When the dialogue starts, set counter to 0. Each time a dialogue line is shown, you need to increase it by 1. (up to the maximum number of lines)
Here is my version:
dropbox.com/s/ga1lmu24525aas1/frankensentence2.c3p
But instead of storing these texts in variables, I would of course use an array. Especially if you are planning to have hundreds of them.
choose() expression does exactly that - picks one random option.
You probably need chooseindex() expression.
Set Text To---> Chooseindex(counter, Array.At(0,1)Array.At(0,2), Array.At(0,3))
After each time increase the counter variable.
No, don't use "Trigger once" - it won't work correctly with multiple enemies.
Play reloading sound only when a particular event happens, for example the enemy arrives to the reloading spot (Pathfinding On Arrived). Or when it starts the reloading animation.
In some cases it is easier to use a variable, I often do this in my projects. For example, when firing a weapon set cooldownTime to time+0.5
There are many advantages of using Timer behavior though. You can pause/resume/cancel it. It conveniently triggers "On Timer" event for each instance. It works correctly when you change object's time scale. It has several expressions allowing to get the total or remaining time. And finally, you can run many timers, even with dynamically assigned tags.
Develop games in your browser. Powerful, performant & highly capable.
It's an elementary school level math..
A+B*id
If you want the make the initial delay shorter, change A.
If you want to make the delay between instances shorter, change B.
Just reduce or remove 2.5s
The interval between circles will remain 1.5s
Have you tried changing the values in that formula?
2.5 seconds + object.id*1.5 seconds
Member since 26 May, 2016 Last online 3 Feb, 2025