Status
Not open for further replies.

ZCSully

Regular
Regular
Joined
Nov 28, 2021
Messages
147
Reaction score
47
First Language
English
Primarily Uses
RMMV
Hello, I followed a video on how to add summons to the game using common events which works great, but my 1 issue I'm having is switching the actor back to a empty slot once the counter expires, I'm going to explain everything with pictures of my state etc.

This is a lot of info and I apologize I just want to be thorough as possible with my question!!!

The plugin I am using to make this possible so far is YEP PartySystem

ACTOR 10

1679583855098.png
This is my actor 10! I set his class to the appropriate class with move set and the moves work fine in battle!

Here's where it starts to get tricky:

I figured out that adding and removing the actors will screw up in battle meaning if you have more then 4 actors and summon a 5th, into battle, it will just add the 5th actor in your party to the fight in most cases. So my solution is to add 3 empty actors in the beginning of the game, lock actor 5 and remove actor 3 and 4!

1679584082318.png

Here is the starting event in my game

1679584107882.png

(Actor 2 is not important nor is the hard mode in this scenario)


So now we have Beginning sequence 1 and 2 that are invisible, that instantly leave after the event plays, and Actor 30, Summon Slot is now added to the party, like so:

1679584205899.png

Now I add in 3 other party members, since summoning won't be available before then, note how the 5th slot is empty which is what I want so far!

This is where it gets more confusing but it is my lack of knowledge on how the syntax of the code goes I suppose:

This is the Summon State with the counter of how long the summon exists:

1679584550518.png
The full code in the note tag is this:
Code:
<Custom Remove Effect>
$gameVariables.setValue(348, $gameParty.allMembers());
If 348 = 7
$gameParty.swapOrder(4, 6)
$gameParty.removeActor(10);
$gameParty.removeActor(11);
else
If 348 = 8
$gameParty.swapOrder(4, 7)
$gameParty.removeActor(10);
$gameParty.removeActor(11);
</Custom Remove Effect>

The note tag WITHOUT the If then statements WORKS but my game works as there will up to 9 potential swapping party members, so I need the event to check if there is 7 8 9 or 10 party members once the summon is included.

This parallel works for removing the actor if the summoned actor didn't expire or die, just be sure to switch on a switch at the beginning of the game:

1679584893681.png
So my main question is How do I write the state notetag "if then" syntax correctly?
x
 

Attachments

  • 1679583896744.png
    1679583896744.png
    76.8 KB · Views: 0

ShadowDragon

Realist
Regular
Joined
Oct 8, 2018
Messages
7,740
Reaction score
3,161
First Language
Dutch
Primarily Uses
RMMV
not sure if "if 348 === 8" with work without curly brackets "( )"
as most if statement is "if (348 === 8) do stuff".

but this might work:
JavaScript:
<Custom Remove Effect>
let gv = $gameVariables.setValue(348, $gameParty.allMembers());
If (gv === 7) {
$gameParty.swapOrder(4, 6)
$gameParty.removeActor(10);
$gameParty.removeActor(11);
} else if (gv === 8) {
$gameParty.swapOrder(4, 7)
$gameParty.removeActor(10);
$gameParty.removeActor(11);
} else {
    //whatever else if NOT battle members 7,8,9,10 etc
    // which is maybe empty to do nothing?
}
</Custom Remove Effect>

cannot guarantee this will work thoug, bu you can test it.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,002
Reaction score
8,887
First Language
English
Primarily Uses
RMMV
It would be helpful if you linked to the video that you followed. That helps us make sure there's no error in the logic of what you copied over.

Have you tried using a plugin that offers this functionality? The SRD_Summon works well and works with the Yanfly Party plugin and doesn't require to jump through all this rigamarole.

The full code in the note tag is this:
Code:
<Custom Remove Effect>
$gameVariables.setValue(348, $gameParty.allMembers());
If 348 = 7
$gameParty.swapOrder(4, 6)
$gameParty.removeActor(10);
$gameParty.removeActor(11);
else
If 348 = 8
$gameParty.swapOrder(4, 7)
$gameParty.removeActor(10);
$gameParty.removeActor(11);
</Custom Remove Effect>
A significant portion of this is incorrect JavaScript syntax.
Code:
$gameVariables.setValue(348, $gameParty.allMembers());
You're setting variable 348 to an array of actors, then later you're checking for it to be a specific value. That doesn't make sense. Are you trying to set it to be the number of actors in the party? That's
Code:
$gameVariables.setValue(348, $gameParty.allMembers().length);

Then...
Code:
If 348 = 7
$gameParty.swapOrder(4, 6)
There's a lot wrong here.
- "if" is not capitalized
- if statements require the conditions to be in parentheses
- if statements only apply to the next single code statement unless you create a code block with braces
- = is an assignment operator, you're setting the number 348 equal to the number 7, which produces an error. To check for equality you use ==
- Just 348 doesn't mean anything, you're looking for the value of game variable 348.
Code:
if ($gameVariables.value(348) == 7)
{
    $gameParty.swapOrder(4, 6)
    $gameParty.removeActor(10);
    $gameParty.removeActor(11);
}

Then...
Code:
else
If 348 = 8
There's no line break between "else if".

So my main question is How do I write the state notetag "if then" syntax correctly?
If you Google the question, you'll find free JavaScript tutorials to help you.


let gv = $gameVariables.setValue(348, $gameParty.allMembers());
That doesn't work - setValue() does not return a value.

And the rest is still following what ZCSully did with storing an array then trying to compare it to a single value.
 
Last edited:

ZCSully

Regular
Regular
Joined
Nov 28, 2021
Messages
147
Reaction score
47
First Language
English
Primarily Uses
RMMV
not sure if "if 348 === 8" with work without curly brackets "( )"
as most if statement is "if (348 === 8) do stuff".

but this might work:
JavaScript:
<Custom Remove Effect>
let gv = $gameVariables.setValue(348, $gameParty.allMembers());
If (gv === 7) {
$gameParty.swapOrder(4, 6)
$gameParty.removeActor(10);
$gameParty.removeActor(11);
} else if (gv === 8) {
$gameParty.swapOrder(4, 7)
$gameParty.removeActor(10);
$gameParty.removeActor(11);
} else {
    //whatever else if NOT battle members 7,8,9,10 etc
    // which is maybe empty to do nothing?
}
</Custom Remove Effect>

cannot guarantee this will work thoug, bu you can test it.

I did something along the lines of this just writing the variables differently and it worked! The bracket stuff just confused me around the else if's etc..

It's just my common event that checks the party # when summoned now is broken if I put conditionals in there, I am going to just play around until it fixes!


@ATT_Turan
"It would be helpful if you linked to the video that you followed. That helps us make sure there's no error in the logic of what you copied over.

Have you tried using a plugin that offers this functionality? The SRD_Summon works well and works with the Yanfly Party plugin and doesn't require to jump through all this rigamarole."

(I don't know how to quote I tried the quote command but couldn't figure it out)

I can link you the video right here!
It's a very old video



I tried to use SRD Summon, it's actually in my load order, the problems I had with it:

The exit animation was incompatible with something about YEP SV animated enemies, so I changed the exit animation to just change the actor opacity to 0 and that worked! But then I got a pop up damage error the second my summoned actor damaged the enemy which was weird.

Regarding the rest of the corrections, thank you so much, I should always refer to that link I just forget about it sometimes, I ended up kind of going through the


Link for RPG Maker MV script calls, and just wrote out code based on a If else if statement that I found inside one of the examples!
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,002
Reaction score
8,887
First Language
English
Primarily Uses
RMMV
(I don't know how to quote I tried the quote command but couldn't figure it out)
If you use the +Quote button, an "Insert Quotes" button appears at the bottom of the post you're writing. You click it.

Or you can just click Reply.

I tried to use SRD Summon, it's actually in my load order, the problems I had with it:
You'd have to post a thread with the precise issues, all I can tell you is that I use SRD Summon with Yanfly's Party System and Animated SV Enemies and it works no problem.

Link for RPG Maker MV script calls, and just wrote out code based on a If else if statement that I found inside one of the examples!
If you can please find where in that document you saw conditionals typed out with that kind of syntax, it would be good to get it corrected.
 

ZCSully

Regular
Regular
Joined
Nov 28, 2021
Messages
147
Reaction score
47
First Language
English
Primarily Uses
RMMV
If you use the +Quote button, an "Insert Quotes" button appears at the bottom of the post you're writing. You click it.

Or you can just click Reply.


You'd have to post a thread with the precise issues, all I can tell you is that I use SRD Summon with Yanfly's Party System and Animated SV Enemies and it works no problem.


If you can please find where in that document you saw conditionals typed out with that kind of syntax, it would be good to get it corrected.
Thank you!


I can post a new thread with the issues if you want I just have to recreate them with screenshots which will take a few minutes!

No, I meant after I posted this I went and looked at the syntax which was correct, instead of searching on the javascript page that you sent, because I started searching for answers before any responses haha. The page is correct!
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,002
Reaction score
8,887
First Language
English
Primarily Uses
RMMV
I don't think it needs to be a new thread as it pertains to this issue. But yes, screenshots of any errors (hit F8 and go to the Console tab) and a description of what's happening.
 

ZCSully

Regular
Regular
Joined
Nov 28, 2021
Messages
147
Reaction score
47
First Language
English
Primarily Uses
RMMV
I don't think it needs to be a new thread as it pertains to this issue. But yes, screenshots of any errors (hit F8 and go to the Console tab) and a description of what's happening.
Ooooh okay I will report my new thread to be taken down as I post it here:

This happens when the summon runs out of turns or I'm assuming dies!:
1679591040440.png
1679591048079.png
This is another issue I'm having:

When some summons attack the this pops up right before the hit splat:

1679591063559.png
1679591069038.png
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,002
Reaction score
8,887
First Language
English
Primarily Uses
RMMV
I appreciate you providing information, but you don't need to do so much :guffaw:

The Yanfly error log and the Console tab show the exact same thing, so just one of those is sufficient.

And the Elements tab is useless.

Have you tried simply rearranging the plugin order in your plugin manager? Everything works for me with the Summon Core beneath all the Yanfly stuff.

Aside from that, I guess a screenshot of your summon skill.
 

ZCSully

Regular
Regular
Joined
Nov 28, 2021
Messages
147
Reaction score
47
First Language
English
Primarily Uses
RMMV
I appreciate you providing information, but you don't need to do so much :guffaw:

The Yanfly error log and the Console tab show the exact same thing, so just one of those is sufficient.

And the Elements tab is useless.

Have you tried simply rearranging the plugin order in your plugin manager? Everything works for me with the Summon Core beneath all the Yanfly stuff.

Aside from that, I guess a screenshot of your summon skill.
:rswt.. I did not know that haha! I guess that does make sense.

I will show you the bottom of my plugin list, unless there is a way to provide my entire plugin list in one picture or text:

1679591580530.png

This is as much of it as I can get, the only cutoff part is <Cooldown: 5>
1679591637221.png
 

Attachments

  • 1679591613628.png
    1679591613628.png
    20.5 KB · Views: 1

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,002
Reaction score
8,887
First Language
English
Primarily Uses
RMMV
Have you made sure the rest of your Yanfly plugins are in the correct order?

If they're not in the order listed on the Yanfly Engine Library page, it can cause weird glitches.

I'm using all of the plugins listed in your error trace, plus the Summon Core, and I don't have any issues.

If you check that the entire order is correct, I suggest some basic, logical troubleshooting.

- turn off all plugins except the summon, see if it works
- if yes, turn back on half of your plugin list, see if it works
- if yes, turn those off and turn on the other half. If no, turn off half of those.
- Continue until you isolate the specific combination of plugins that produces an error.
 

ZCSully

Regular
Regular
Joined
Nov 28, 2021
Messages
147
Reaction score
47
First Language
English
Primarily Uses
RMMV
Have you made sure the rest of your Yanfly plugins are in the correct order?

If they're not in the order listed on the Yanfly Engine Library page, it can cause weird glitches.

I'm using all of the plugins listed in your error trace, plus the Summon Core, and I don't have any issues.

If you check that the entire order is correct, I suggest some basic, logical troubleshooting.

- turn off all plugins except the summon, see if it works
- if yes, turn back on half of your plugin list, see if it works
- if yes, turn those off and turn on the other half. If no, turn off half of those.
- Continue until you isolate the specific combination of plugins that produces an error.
How badly will this screw up my game by turning them off? will the parameters save?

I will try this in a bit when I get back to my computer thank you so much!!

I hope to answer back here to you or at least edit this comment within the next few hours :)
 

ShadowDragon

Realist
Regular
Joined
Oct 8, 2018
Messages
7,740
Reaction score
3,161
First Language
Dutch
Primarily Uses
RMMV
use the plugin in my spoiler (ALOE_YEP_PluginOrderChecker) to see which one
are correct and incorrect.

I forgot the rest of the code when I post a solution which ATT_Turan mentioned
on the length (that I forgot) but specially overlook the "setValue" for value and
the capitalize "If" that is always lowercase "if", which I should corrected.

ATT_Turan is good in lunatic code and can help you set it up right.
but start with setting all YEP plugin in the correct order as they crash or
dont work correctly when placed incorrectly.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,002
Reaction score
8,887
First Language
English
Primarily Uses
RMMV
How badly will this screw up my game by turning them off? will the parameters save?
It doesn't screw up your game, or I wouldn't have recommended it as a standard troubleshooting measure.

Plugin parameters are saved in your project until you delete the plugin from your plugin manager. Turning it off and on does nothing permanent.
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,153
Reaction score
16,958
First Language
English
Primarily Uses
RMMV

Closed at OP's request

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

If you guys wonder why I hardly ever help anyone anymore... Im going to be on here even less. Thank the trolls for that.
New update for Battle Castle: Shadow from the Past A Shadow's Echo. No gameplay changes or new content, but lots of things got renamed, including the game title, for extra immersion. Some things related to sound too, like activating chests and taking things.
Obvious One.gif
Meet my new mascot. He's also a mimic! No prizes for guessing this guy's name, though, haha
BANNER2.png
I put out a new pack and I swear, I did not realize how it looks like the ones on the right are scared/nervous of the one on the left until way after o_O I just wanted to showcase some of them randomly xD
Well, if anyone has a funny, simple, easy RM game they want me to playtest/review, I would love it.
Someone close to me straight up told me they didn't think my relationship with my girlfriend would last. No lead up, very bluntly. Like it's obvious or something. Trying not to let it get to my head, but it's hard.
The distraction would be a life saver.

Forum statistics

Threads
134,756
Messages
1,250,359
Members
177,520
Latest member
crimnt
Top