So, a very skilled user in this forum helped me a lot in the past with the Lunatic State Yanfly.
Thanks to him, I learned how to add the ID of an actor in a variable/array.
But after a lot of testing I just realized that the method I'm using keeps adding the ID of the actor if I use the same skill, even if the ID is already in that array.
The method is the next:
Now, the problem is that use other skills that check if some actors are in that array. But if I used the same state again, it will add the same ID of said actor to that array. This cause a conflict, where if I use a skill that call for that array, it will use the effect the amount of time of the actor ID is there.
I tried changing the code to:
this method kind of... "worked" but at the same time, it return me a new error.
When I call the variable[47] with a text to check what the array return, it returns me the ID of the actor, but without the brackets [ ]
All this time the array was returning me the ID/s of all actors in that array inside brackets. And I think that's what make it work. But with the method "unless" I'm using it change the array to have no brackets.
It's there a way to make that the array only save the id of said actor once and keeps the brackets?
Thanks in advance!
Thanks to him, I learned how to add the ID of an actor in a variable/array.
But after a lot of testing I just realized that the method I'm using keeps adding the ID of the actor if I use the same skill, even if the ID is already in that array.
The method is the next:
Code:
$game_variables[47] = [] if $game_variables[47] == 0
$game_variables[47].push(self.id)
Now, the problem is that use other skills that check if some actors are in that array. But if I used the same state again, it will add the same ID of said actor to that array. This cause a conflict, where if I use a skill that call for that array, it will use the effect the amount of time of the actor ID is there.
I tried changing the code to:
Code:
$game_variables[47] = [] if $game_variables[47] == 0
$game_variables[47].push(self.id) unless $game_variables[47] = self.id
this method kind of... "worked" but at the same time, it return me a new error.
When I call the variable[47] with a text to check what the array return, it returns me the ID of the actor, but without the brackets [ ]
All this time the array was returning me the ID/s of all actors in that array inside brackets. And I think that's what make it work. But with the method "unless" I'm using it change the array to have no brackets.
It's there a way to make that the array only save the id of said actor once and keeps the brackets?
Thanks in advance!