if i want start battle troopID(1),
I thought it would work if I write 'BattleManager.setup(1, false, false);'. But nothing happened.
Oh nice! Thank you very much. Of course, it can be simple, but I tried to make something with TropID as a variable. Anyway, I checked that it was working. 🙂
Well you would just replace troopId with $gameVariables.value(n) in the first line, where n is the id of the variable you want to use, with no leading zeros. It's the setting of the callback that might cause an issue. But I suppose if you do it in a Script call within an event, it might still work.
Just to be clear: the Battle Processing command has a "designation with variable" option, so you don't need a script call for that~ 🙏
Oh, I know that. What I was going to do was work for convenience. Because I wanted to have different monsters with different weights on different maps and come out probabilistic according to the weights, after I went through JavaScript calculations, to have a battle according to the probability. I couldn't explain in detail because I was not good at English. (If you can't understand this article, I'm sorry. T.T)
OK, that explains what you are thinking - but what has us confused is why you think javascript is a convenience here.
The default encounters are already weighted, and allow all that without even once touching javascript.
In fact using javascript in what you describe is as someone wanting to travel from Paris to Brussels by first flying to New York and then taking the shortcut through Peking and Moscow...
Because I didn't use the basic encoder. I use the symbol encounter. I needed something to apply collectively to many events. 🙂
if there is an easier way, but if I don't know, I apologize. T_T