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,764
Reaction score
2,114
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 Profile Posts

Another comic with Backstage Malak...
If you want to ask him anything, you can ask on my DeviantArt page! I'm not sure if you're allowed to do it here.
Forum tip of the day ...
If you get a temporary suspension for being a jerk to people who are trying to help you, and arguing with mods and admins, don't go making new accounts. Chances are, if you p**s us off enough to suspend you for a week, we're not going to hesitate giving you a permanent ban when you give us a reason.
E_6fAErVkAQILXu.png
I'm so close to releasing my game on steam! :blush::blush::blush:
Us:
"This game is awesome! I wish there are more games like this in the future."
Also us:
"I hate how games stopped being original and start copying other successful games."
Should've done this a few days ago but...
PRI_200136808.jpg
Rest in Peace, Sir Clive Sinclair
1940 - 2021
Entrepreneur, Technologist, Father of the Modern British Computing Industry, and protagonist of Legend of ZUN.

Without you, England's games and tech industry wouldn't be where it is.

Forum statistics

Threads
115,287
Messages
1,088,665
Members
149,917
Latest member
statdev
Top