Ra TBS Set Move Range to Variable

Hopefully, this is one of the last questions I'm going to have to put here. I've got Ra TBS and have all the basics set up. Now I'm trying to edit it so that the note tags can read in a random variable. I know exactly where it creates the note tag to use, but when I look at this thing, I get lost. I'm seeing the "tb move" part, but I don't know what the \d+ or the /i
is.
1624904676247.png
If I'm not being to snappy....

the d+ is to signify a number
the /i means case insensitive

Use this site to test the expression
If I'm not being to snappy....
It's hard for me to read tone. It genuinely sounded like I was being talked down to, so I got defensive. My apologies.
the d+ is to signify a number
So I'd change that to something else to signify a variable?
Use this site to test the expression
Trying to do that and I'm a little lost. I've got stuff matching when I put in the expression as-is, but the suggestions on the site don't really say anything about variables. Unless "a" can be replaced with any variable?
You can't put a variable in an expression. You can make the output the value of a variable.
TBS classes and modules - line 397
That's where the unit_move is used. the value for the note tag is put into another variable for the battler.
You can add below that the variable you want to use and put the output into that variable.
$game_variables[1] = $1.to_i
Then the variable will have the value of the unit_move note tag that was last read.
Keeping in mind, this will be overwritten whenever the note tag is examined by this method.
So really that is not what you want to do as this will be overwritten for every note tag check when the game is launched. (load_tags_tb in load_database for datamanager, which happens when the game is launched)

You will need to copy that same method (or parts of) into another method when you are looking for a particular note tag value.
So unless you will be able to do this, you will need to provide more information for someone to be able to understand what the end goal is in order to possible code a solution.
I'll try and explain the best I can what I want to do.
So, what I'm trying to do is have it where each time the player moves a unit, a random number is generated for the amount of spaces the player can move. This is the dice roll effect I was talking about. So I guess the way to do that would either be to make it possible to put in a variable in a note tag, or a random array. Currently, it only accepts integers.
What's the range of the random roll? 1-4, 1-6, 1-20?
Maybe in TBS Classes and Modules line 1141
change the $data_actors[@actor_id].base_move_range
to roll = rand($data_actors[@actor_id].base_move_range)
then you can use the normal notetag for the move

or maybe line 2030
change @move = battler.base_move_range_tb
to is_actor? ? @move = rand(battler.base_move_range_tb) : @move = battler.base_move_range_tb

It's hard to say. I'm not going to work on it at the moment. Just peaking into the code.
But these or more are options. They need to be tested since I'm not the best coder and don't know this script well.
OK, so they both pretty much do the same thing. It's working to an extent, it just generates a new number every time you open the game rather than every time you move. Haven't tested if it changes with each battle. I'm thinking what might need to happen is make the note tag into a script call/comment so it's not static.

Original thread: https://forums.rpgmakerweb.com/threads/ra-tbs-set-move-range-to-variable.137904/