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,748
Reaction score
2,100
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

I might not participate in the Boss Battle contest after all... I have more important things to do, like Wishful Wanda. And of course the Dark Deception spinoff I plan to pitch, Demon Slayer.
Changed my avatar, goodbye Alan Sugar, hello George Carlin (one of my favorite human beings ever)
If you still don't subscribe our Polish channel please consider it :)
1.png
Who wants to see my review of the worst star wars movie? This movie has all the excitement of being on Jury Duty of the most boring case ever about trade negotiations.
A lot to learn to make a game. Can I handle it?

Forum statistics

Threads
115,171
Messages
1,087,801
Members
149,720
Latest member
Kirbyslasher
Top