Hello!
I recently started an experiment with Script Calls to try and create a "chess-like" Strategy RPG (not a serious project, just curious to see how much i was capable to realize with Scripts).
The idea was that the battles happen map, and not on the standard battle screen. To do that, i created a Script that saved in Variables the actor's parameters, like this:
Where $gameVariables.setValue(loop, $gameActors.actor(id_actor).param(stat)) is there to scale to the variables that will contain each of the 4 party members' parameters, and this one works!
But then I realized that, if i wanted to do this for the Enemies, i would need to create arrays, since i don't want the enemies to appear in the same number every battle.
So my plan was that, during battle, all the enemies appearing would share ONE Variable Array for each parameter, and that Variable would alter its length according to how many enemies are there.
So the question is this: is it possible to script something like "var enemy_stat[] = new var [n_enemies];"?
I recently started an experiment with Script Calls to try and create a "chess-like" Strategy RPG (not a serious project, just curious to see how much i was capable to realize with Scripts).
The idea was that the battles happen map, and not on the standard battle screen. To do that, i created a Script that saved in Variables the actor's parameters, like this:
◆Variable:#0035 IDActor = 0
◆Variable:#0036 Index = 0
◆Variable:#0033 nCharacters = 4
◆Variable:#0034 Looping = 1
◆Loop
◆Script:var member = $gameVariables.value(36);
: :$gameVariables.setValue(35, $gameParty.members()[member]._actorId);
◆Variable:#0037 Paramater = 0
◆Loop
◆Script:var loop = $gameVariables.value(34);
: :var id_actor = $gameVariables.value(35);
: :var stat = $gameVariables.value(37);
: :$gameVariables.setValue(loop, $gameActors.actor(id_actor).param(stat));
◆Variable:#0034 Looping += 1
◆Variable:#0037 Parameter += 1
◆If:Parameter > 7
◆Interrupt Loop
◆
:End
◆
: Repeat
◆Variable:#0033 nCharacters -= 1
◆Variable:#0036 Index += 1
◆If:nCharacters = 0
◆Interrupt Loop
◆
:End
◆
:Repeat
◆Variable:#0036 Index = 0
◆Variable:#0033 nCharacters = 4
◆Variable:#0034 Looping = 1
◆Loop
◆Script:var member = $gameVariables.value(36);
: :$gameVariables.setValue(35, $gameParty.members()[member]._actorId);
◆Variable:#0037 Paramater = 0
◆Loop
◆Script:var loop = $gameVariables.value(34);
: :var id_actor = $gameVariables.value(35);
: :var stat = $gameVariables.value(37);
: :$gameVariables.setValue(loop, $gameActors.actor(id_actor).param(stat));
◆Variable:#0034 Looping += 1
◆Variable:#0037 Parameter += 1
◆If:Parameter > 7
◆Interrupt Loop
◆
:End
◆
: Repeat
◆Variable:#0033 nCharacters -= 1
◆Variable:#0036 Index += 1
◆If:nCharacters = 0
◆Interrupt Loop
◆
:End
◆
:Repeat
Where $gameVariables.setValue(loop, $gameActors.actor(id_actor).param(stat)) is there to scale to the variables that will contain each of the 4 party members' parameters, and this one works!
But then I realized that, if i wanted to do this for the Enemies, i would need to create arrays, since i don't want the enemies to appear in the same number every battle.
So my plan was that, during battle, all the enemies appearing would share ONE Variable Array for each parameter, and that Variable would alter its length according to how many enemies are there.
So the question is this: is it possible to script something like "var enemy_stat[] = new var [n_enemies];"?