For context, my goal is to apply an afterimage to ALL events on the map using SAN_ResidualSprites.
This is tied to an event that will run javascript code with a parallel trigger
Now, how I'm trying to do this is by using a for loop like so:
for (i = 0; i <= $gameMap.events().length; i++){
$gameMap.event(i).residual().setValid(true);
$gameMap.event(i).residual().setColorTone([0, 0, 0, 0]);
$gameMap.event(i).residual().setOpacity(50);
$gameMap.event(i).residual().setDuration(30);
$gameMap.event(i).residual().setPeriod(5);
}
What I expected this to do is, upon every loop it would:
Set i to 0 to (however many events are on the map, let's say 30 for simplicity).
count from 1 to 30 (which is i++) and for each number it counted it would run the rest of the code, then loop back to 'for'.
the issue is that it just doesn't do that, it's instead undefined? i assume it RUNS the gameMap.event code but as soon as it reaches i, it must count off all the numbers, then get confused or something.
Upon fiddling with thing i did find out putting "28, 29, 30" in place of "i" also did not work so I assume listing off multiple events do not work.
I also found out putting "events()" or "events().length" in place of "event(i)" does not work, i assume an oversight on the developers end.
Using the for loop accompanied by $gameMessage.add(i) works perfectly fine.
So, yeah i don't know if there's any listing methods I need to do or if there are any different loop methods i can use I'm just pretty confused.
if you have any questions feel free to ask and any help is appreciated.
Link to the plugin code here
This is tied to an event that will run javascript code with a parallel trigger
Now, how I'm trying to do this is by using a for loop like so:
for (i = 0; i <= $gameMap.events().length; i++){
$gameMap.event(i).residual().setValid(true);
$gameMap.event(i).residual().setColorTone([0, 0, 0, 0]);
$gameMap.event(i).residual().setOpacity(50);
$gameMap.event(i).residual().setDuration(30);
$gameMap.event(i).residual().setPeriod(5);
}
What I expected this to do is, upon every loop it would:
Set i to 0 to (however many events are on the map, let's say 30 for simplicity).
count from 1 to 30 (which is i++) and for each number it counted it would run the rest of the code, then loop back to 'for'.
the issue is that it just doesn't do that, it's instead undefined? i assume it RUNS the gameMap.event code but as soon as it reaches i, it must count off all the numbers, then get confused or something.
Upon fiddling with thing i did find out putting "28, 29, 30" in place of "i" also did not work so I assume listing off multiple events do not work.
I also found out putting "events()" or "events().length" in place of "event(i)" does not work, i assume an oversight on the developers end.
Using the for loop accompanied by $gameMessage.add(i) works perfectly fine.
So, yeah i don't know if there's any listing methods I need to do or if there are any different loop methods i can use I'm just pretty confused.
if you have any questions feel free to ask and any help is appreciated.
Link to the plugin code here