(Unsolved, Updated) Choosing specific number in RandominRange

So In my game, for boss battles, after they are done wth an attack move, I want them to pick 1 of 2 different numbers to determine which attack to do next. However I think It’s picking a whole number within the whole RANGE bewtween the 2 numbers, instead of just of 2 different numbers I want it to pick. I noticed the boss keeps using the same 2 attcks over and over while rarely changing it up…

How to I get it to just pick only the 2 numbers I want it to pick from?

You can do that the manual way(math tools) or DL this extension by Ulises.

look at bubbles link

You did not show how you are picking number and when

is there a way to do it without having to use github?

What do you mean by that? I added another screenshot showing how it’s used.

No matter what A is
B can switch constantly since A don’t change

Its like you would have condition

Value of timer is greater than RandomInRange(2,5)

That means each frame you set this number to 2 3 4 or 5

And not set it once to random number

So as result you may feel its constantly just waiting for timer to reach 2

where is the action that change [currentmovetracker] ?

its currentmovetracker that initiate the whole logic chain. if no action changes that variable, the logic chain will start at the exact same place.

you must include a way to change the root of the chain, if you implement that at the end of the chain (aka, the end start another root) then you got a very nice way for your boss to always switch between many states (which would be semi-predictable and super cool)

Use the function to select number X or Y:
RandomWithStep(X, Y, Y-X)
For example, numbers 1 and 4:
RandomWithStep(1, 4, 3) because 4 - 1 = 3

RandomInRange() and Random() does not generate a real number, it DOES in fact generate an integer. to generate a real number, people use RandomFloatInRange() or simply RandomFloat()

I haven’t checked the link that was provided but I know there’s some faulty links around for that extension. I did check this link a month ago and it was a working version. This is a direct link, as soon as you click it, it will start downloading. https://github.com/GDevelopApp/GDevelop-extensions/files/7313760/Choose.zip

Here is my original posting of the link including a link to the page it’s from. Tuto for creating a function in GDevelop - #33 by Bubble I haven’t read the details in your topic so the fact that I’m providing the link is not an endorsement that it will solve your problem.

The extension by Ulises will lead you to overly complicated events.

You should use the Array Tools extension instead:

You only need 1 event instead of 4:

  • Change the variable MoveTransitionSelection of Boss: set to ArrayTools::RandomNumberInArray(MyBossMoves[CurrentMoveTracker])

@davy

Ops… sorry… maybe Bubble is right, I don’t know i thought the link was correct… the extension is just called 'Choose

i just do this when i need it.

Immagine 2026-07-04 142032

MyBossMoves? don’t you mean AttackMove? I’m confused…

I tried this, but it’s not working. What am I doing wrong?

I still don’t know where in your events, does the variable [currentmovetracker] get changed

(and why no one talks about it)

I have checked it now and it’s the page linked from the community list and yes, leads to an error when installed.

For future people: Choose extension working version, no error, see my post above for link.

It’s an Array of Array where you have your transitions:

  • #0
    • 0
  • #1
    • 2
    • 3
  • #2
    • 3
    • 4
  • #3
    • 1
    • 4
  • #4
    • 1
    • 2