KimiRaven

Veteran
Veteran
Joined
Sep 26, 2016
Messages
38
Reaction score
12
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
608
Reaction score
1,432
First Language
English
Primarily Uses
RMMZ
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

Veteran
Veteran
Joined
Sep 26, 2016
Messages
38
Reaction score
12
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
608
Reaction score
1,432
First Language
English
Primarily Uses
RMMZ
@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

Veteran
Veteran
Joined
Sep 26, 2016
Messages
38
Reaction score
12
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:

Latest Threads

Latest Profile Posts

i want to make videogame, though i am burned out on games with RPG elements, but the only gamedev tool i know how to use is rpg maker. :/
Rakon wrote on xizorandy's profile.
Hello! I found a post of lightning strike pictures you posted. You said you made them, am I allowed to use them in my commercial project. Would be really cool!^^
evhht2zr.png

Have a nice day!
It's almost 3 month and this piece of drawing is still not finished yet.
aaaa.jpg

Really busy with other stuffs like commission and coping with personal problem.
Stella & Elyune, maybe used for promotional art if my game project finished one day.

Forum statistics

Threads
112,253
Messages
1,066,836
Members
145,858
Latest member
signcentre12
Top