RMMZ [Solved] Use script to call animation: "requestAnimation" inside battle

Saliacoel

Villager
Member
Joined
Jul 28, 2021
Messages
8
Reaction score
1
First Language
English
Primarily Uses
RMMZ
Hey there, sorry for such an easy question, but I have tried to find an answer for the last 5 hours and now I give up.
Basically, while inside the battle I am calling this script:

$gameTemp.requestAnimation($gameParty.members[0] , 48);

It should play animation 48 on party member 0... but I get an error:
"targets is not iterable"

can anyone help?

Solved:

$gameTemp.requestAnimation([$gameParty.members()[0]], 48);
 
Last edited:

Rugman

Veteran
Veteran
Joined
Jun 11, 2020
Messages
297
Reaction score
82
First Language
English
Primarily Uses
RMMV
Perhaps it should be $gameParty.battleMembers
 

Saliacoel

Villager
Member
Joined
Jul 28, 2021
Messages
8
Reaction score
1
First Language
English
Primarily Uses
RMMZ
nope, i still get the same error.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,739
Reaction score
2,094
First Language
EN
Primarily Uses
RMMZ
Two problems:
  • Missing brackets: members references the function object; members() evaluates the function and returns an array of members.

  • requestAnimation expects an iterable object, typically an array, but you're trying to pass in a single battler (party leader).
Try this instead:
JavaScript:
$gameTemp.requestAnimation([$gameParty.members()[0]], 48);
 

Saliacoel

Villager
Member
Joined
Jul 28, 2021
Messages
8
Reaction score
1
First Language
English
Primarily Uses
RMMZ
Two problems:
  • Missing brackets: members references the function object; members() evaluates the function and returns an array of members.

  • requestAnimation expects an iterable object, typically an array, but you're trying to pass in a single battler (party leader).
Try this instead:
JavaScript:
$gameTemp.requestAnimation([$gameParty.members()[0]], 48);

Tested and works! Thank you!! (solved)
 

Latest Threads

Latest Posts

Latest Profile Posts

Noriko_Human.png
Worked on some face-sets. Need to finish up the lot and cut some out of the game. She's looking pretty cute.
Even though I'm not going for the first time in...ten years or something...ordered my Gen Con dice!
Will be focusing on map making today and adding locked chests :LZSsmile:Screenshot 2021-09-16 095316.png
It's hard to stay consistent for at least a week
new enemies for the game I'm working on...

Forum statistics

Threads
115,106
Messages
1,087,272
Members
149,573
Latest member
sdfsdfa
Top