Skill Repeat not working

KimiRaven

Villager
Member
Joined
Sep 26, 2016
Messages
26
Reaction score
2
First Language
English
Primarily Uses
RMMV
Being stuck for a while now. I am trying to make a skill that repeat itself including inside the note 7 times.
I am Yanfly Target Core and the Action Sequence Pack. I have try both built repeat system and the target core. Somehow it only repeat once. Anyone have idea what went wrong? Before I was using the SumRndmDde Repeat Upgrade plugin but found not suitable with what what I am trying to do. Sorry for bad english.


What I have input inside the note;

<Repeat: 7>

<Target Action>

if $gameParty.items((9) >= 1 )

lose item 9: 1

MOTION THRUST: user

action animation: target

action effect

wait for animation

death break

else

end

</Target Action>
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
604
Reaction score
1,421
First Language
English
Primarily Uses
RMMV
You have parentheses () in the wrong place around your conditional statement, and your script call is the wrong one to check inventory amount.
You also shouldn't need the "else" statement, since you're not doing anything there.

Try this:
Code:
<Repeat: 7>

<Target Action>
if ($gameParty._items[9] >= 1)
lose item 9: 1
MOTION THRUST: user
action animation: target
wait for animation
death break
end
</Target Action>
EDIT: I don't see why that should have stopped your repeat, though. Make sure your plugins are in the order shown on the Yanfly Engine Plugins page.
 
Last edited:

KimiRaven

Villager
Member
Joined
Sep 26, 2016
Messages
26
Reaction score
2
First Language
English
Primarily Uses
RMMV
I directly follow the guide in yanfly plugin and both mine and yours code is functional, the item 9 does reduce by 1 every time the skill was used. I have tried to use only the repeat line and the attack does repeat 7 times but if I combine it will only does once. I have tried create a new fresh file and copy only the important part and same thing happen. Before using the repeat, i was using the repeating code but I find it impractical to do if else 7 times or 7 case. The death break also become not working even when the enemy hp already goes down to 0. I have rearrange the plugin yet nothing changes. I am putting empty else statement just in case item 9 is 0, skill does nothing ( have not try it yet ).

Code:
<Target Action>

if $gameParty.items( (9) >= 2 )
lose item 9: 1
MOTION THRUST: user
action animation: target
action effect
wait for animation
death break
lose item 9: 1
MOTION THRUST: user
action animation: target
action effect
wait for animation
death break
else if $gameParty.items( (9) >= 1 )
lose item 9: 1
MOTION THRUST: user
action animation: target
action effect
wait for animation
death break
else
end
</Target Action>
Everything were fine before I insert the Repeat Upgrade ( I forgot that Target Core already have repeat ). I am at a loss, maybe I try fresh install rpg maker mv again later.

You have parentheses () in the wrong place around your conditional statement, and your script call is the wrong one to check inventory amount.
You also shouldn't need the "else" statement, since you're not doing anything there.

Try this:
Code:
<Repeat: 7>

<Target Action>
if ($gameParty._items[9] >= 1)
lose item 9: 1
MOTION THRUST: user
action animation: target
wait for animation
death break
end
</Target Action>
EDIT: I don't see why that should have stopped your repeat, though. Make sure your plugins are in the order shown on the Yanfly Engine Plugins page.
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
604
Reaction score
1,421
First Language
English
Primarily Uses
RMMV
@KimiRaven your conditional is still incorrect, regardless of the fact that the skill triggers. It does NOT check whether the party has at least 1 of item 9 as you intended. It triggers as "true" BECAUSE it's incorrect. It will always trigger as "true", unless the party has NO inventory items at all. You need to correct this issue or your skill will not work as intended.

I will show you what your conditional currently does:
if $gameParty.items( (9) >= 1 )
1) Checks (9) >= 1, which is true.
if $gameParty.items( true )
2) Calls the function $gameParty.items(). True does nothing here. $gameParty.items() returns an array of the ITEMS (not number of items) in the party's inventory.
if (inventory array)
3) If the inventory is not empty, this is true! If the inventory is empty, this is false!

By contrast, this is what the conditional I gave you does:
if ($gameParty._items[9] >= 1)
1) Checks the object containing the NUMBER of items in inventory for the number of item 9 the party has.
if ((quantity of item 9) >= 1)
2) Checks if the quantity of item 9 in inventory is greater than or equal to 1. If so, this is true! If not, this is false!

Putting in "else" with nothing after it is the same as not putting "else" at all. It's just not needed, but it won't break anything if you do it, so if you want to leave it in, that's fine.

It's possible your death break is not working due to the following feature of the Battle Engine Core:
Multiple Hits
Multi-hit action will no longer end prematurely if the target dies midway through the action. This is done through toggling immortal states. To make use of feature, make sure your database has an Immortal State somewhere. If you do not wish to use this feature, set the Parameter for Immortal State ID to 0 instead.
For the repeat issue, try moving the repeat notetag below the target action notetag, as that would be the same order that the plugins are in.
 
Last edited:

KimiRaven

Villager
Member
Joined
Sep 26, 2016
Messages
26
Reaction score
2
First Language
English
Primarily Uses
RMMV
Ah, alright. I will follow yours conditional statement. I am still learning and practicing the JavaScript. Going to test it when i get back home. Thanks man.

@KimiRaven your conditional is still incorrect, regardless of the fact that the skill triggers. It does NOT check whether the party has at least 1 of item 9 as you intended. It triggers as "true" BECAUSE it's incorrect. It will always trigger as "true", unless the party has NO inventory items at all. You need to correct this issue or your skill will not work as intended.

I will show you what your conditional currently does:
if $gameParty.items( (9) >= 1 )
1) Checks (9) >= 1, which is true.
if $gameParty.items( true )
2) Calls the function $gameParty.items(). True does nothing here. $gameParty.items() returns an array of the ITEMS (not number of items) in the party's inventory.
if (inventory array)
3) If the inventory is not empty, this is true! If the inventory is empty, this is false!

By contrast, this is what the conditional I gave you does:
if ($gameParty._items[9] >= 1)
1) Checks the object containing the NUMBER of items in inventory for the number of item 9 the party has.
if ((quantity of item 9) >= 1)
2) Checks if the quantity of item 9 in inventory is greater than or equal to 1. If so, this is true! If not, this is false!

Putting in "else" with nothing after it is the same as not putting "else" at all. It's just not needed, but it won't break anything if you do it, so if you want to leave it in, that's fine.

It's possible your death break is not working due to the following feature of the Battle Engine Core:


For the repeat issue, try moving the repeat notetag below the target action notetag, as that would be the same order that the plugins are in.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,015
Members
137,563
Latest member
MinyakaAeon
Top