# Is there a way to make multiple attack inputs before an attack?

#### jediMasterLenny

##### Villager
Just curious. I'm working on a math adventure game for my son to help him with math. I'd like to make it so he has to create a formula that equals the enemy's health.

So for example - Enemy HP =2

Select first option: 1

Select 2nd option: +1

If it = the enemy's health, he wins etc.

#### Faytless

##### recently unemployed Kung Fu Master
Project File

*ran out of space in dropbox, PM me for new link if you need it)

I made this just for you! <3  I sorta made this without edits and stuff... and sometimes im eating my mic.. sorry about that. I usually spend at least 2 hours per 10 minutes of video... this was done in 3 shots.  I hope this is what you're looking for!

If you're browsing the this thread now,  please wait 10 minutes from 12:36 PST to finish processing

Last edited by a moderator:

#### jediMasterLenny

##### Villager
Wow, I'm speachless. This is beyond helpful. Thank you so much!

#### jediMasterLenny

##### Villager
Now, to make this a little different, I've tried making 2 variables (x&y let's say) and set them both to random numbers 0-10. This way I can change the math to different values or even different operators at different points in the game without spending 100+ hours just typing in various problems.

I might be going into plugin/JS territory with this and I'm not opposed to going there but just wondered if there is a way in the maker to do the following (totally surprised at how powerful this program is!):

initialize x to random value 0-10

initialize y to random value 0-10

display text: " \v[x] + \v[y] = ?"

get input(note at bottom here)

if (input = x + y) {victory} else {enemy attacks}

NOTE: the input could either be a straight up input or a selection from a list

I can successfully get random problems to occur without changing using the looping you demonstrated (nested within the check loops for knockout conditions). The problem I'm running into is the final check. I have tried making a 3rd variable and setting it equal to x+y, but that's where I'm stuck: how do I set that variable!?

btw - you are a real kung fu master, thanks for your help, man!

Last edited by a moderator:

#### Faytless

##### recently unemployed Kung Fu Master
I might be going into plugin/JS territory with this and I'm not opposed to going there but just wondered if there is a way in the maker to do the following (totally surprised at how powerful this program is!):

Ah,  I wasn't sure how comfortable you were with RMMV.  Now that I had a nights sleep to think it over,  Yes theres a way to do it.  I run my own YouTube Channel for help like this,  so let me make another video for the benefit of you and others that are curious.  You can def go the plugin route, or code your own --  but personally,  I use RMMV to get away from that.  I do enough of it at work.

Here's how you can optimize it.

Last edited by a moderator:

#### jediMasterLenny

##### Villager
I'm definitely a fan of using tools that are already there rather than over-complicate a project (and potentially add more licenses that I don't care to manage!). You are truly amazing, thanks for all the help! Do you have a "donate to my efforts" button anywhere?

#### Faytless

##### recently unemployed Kung Fu Master
@jediMasterLenny Here you go,

thanks for all the help! Do you have a "donate to my efforts" button anywhere?

Yeah, its on my you tube channel on the top right.  You really don't have too though,  I offer my assistance for free! Sides,  I kind of turn on Ads on videos soo it kind of works out in my favor anyways! haha  Thanks for even considering

Last edited by a moderator:

#### jediMasterLenny

##### Villager
One more question. I have figured out how to do a timed battle (boss fight = answer x questions in x time or you lose!) but one thing that I am having problems with is applying the battle system to multiple enemies. I know the logic is probably staring me right in the face but I can't nail it down, may be a lack of knowledge of the maker

#### Faytless

##### recently unemployed Kung Fu Master
So, making sure I understand correctly,

Fight Starts

Timer Runs for 2 minutes.

if timer = 0

Game Over?

If 3 Questions correct = battle over

You'd have to also give me an idea on how your battle system is working now,  I assume you've made modifications to the way i've presented to you.

##### Veteran
Here's how you can optimize it...

I would just like to congratulate you on the clarity of your exposition, despite your modest deprecation. Exemplary pedagogy, warts an' all. Directly applicable to the original question, but also eminently useful for many other applications, using these same principles. Well done.

Is there nothing more than 'Like' for such worthy posts..? It seems somewhat inadequate, somehow..!

#### jediMasterLenny

##### Villager
Ikr? This guy is GREAT!

#### jediMasterLenny

##### Villager
So, making sure I understand correctly,

Fight Starts

Timer Runs for 2 minutes.

if timer = 0

Game Over?

If 3 Questions correct = battle over

You'd have to also give me an idea on how your battle system is working now,  I assume you've made modifications to the way i've presented to you.

Actually, not much. But yes it is something like that. A timer starts, a wrong answer means you get attacked (which is a double penalty because you lose time so accuracy is super important), right answers add up. His first boss fight is answer 10 correctly in 30s. The timer took me HOURS to figure out - I didn't realize the timer "disappeared" from RAM when it was done so I kept checking for a certain time on the timer but it wasn't there. The coding/logic is not optimized at all but it would work for more boss fights later (also with other operations, subtraction, multiplication etc.).

The thing I am struggling with is if there are 2 enemies - solve 2 problems, 3 enemies, 3 problems and so forth.

I'm sorry, I think that in telling you how i've gone forward I confused the question. I don't need a timer run or anything - I just need to figure out how to use the battle system you demonstrated in the videos to me against multiple enemies. The timer thing was something I did on my own

Last edited by a moderator:

#### Faytless

##### recently unemployed Kung Fu Master
I would just like to congratulate you on the clarity of your exposition, despite your modest deprecation. Exemplary pedagogy, warts an' all. Directly applicable to the original question, but also eminently useful for many other applications, using these same principles. Well done.

Is there nothing more than 'Like' for such worthy posts..? It seems somewhat inadequate, somehow..!

Hey, Thank you It's always nice to be appreciated!  Yes,  whats great about learning something this way is that you can apply this method to SOO many different things in RPG maker, the logic is universal!  If YOU ever have something you need me to look at,  just let me know!

@jediMasterLenny

You wouldn't have to do anything special to it against multiple enemies.  Essentially,  the turns still happen with the messaging system.  Set your battler to attack an enemy at random, and then your battler will then have to attack an enemy at random as well.  Now to make it one enemy dies per correct answer,  you just holy **** beef up the attack power of your hero,  or lower the HP of the enemy.  If you don't want to show damage,  you can also edit your system image for numbers to... well blank.

Soo the log is below. ( minus the timer)

Encounter Starts

> 3 Enemies Appear

> Loop

> Hero gets it correct

> Hero Attacks one of the enemies,  ( enemy has 1 hp, or hero has 999 str)

> 1 Enemy Dies

> End Loop

Last edited by a moderator:

#### Faytless

##### recently unemployed Kung Fu Master
double post *delete me*

Last edited by a moderator:

#### jediMasterLenny

##### Villager
I changed the system to add knockout state to the enemies with a correct answer. So - 1 right answer = 1 enemy dies. So do I need to write this out for each and every enemy?

Last edited by a moderator:

### Latest Profile Posts

By the power of timezones! This picture shall still be posted on december 1st!!!

This is not something I'd ever even considered but wow! What a way to use music in a game.
I am a complete fool. I went through the trouble of making a clone sprite and setting up a system to have the characters flash, when it turns out - I never noticed that the "._mainSprite" was the actual bitmap being used. I'm happy since that makes compatibility easier, but I also want to scream.
Synchronizing bust and sprite expressions! Plus using a phone behaviour

Long gif tho, let it load first
Wondering how to force a Save State in VNMaker with a name and how to call it with a scene event in order to double check if this Save State exists or not. Phew... Leaving breadcrumbs for chapter DLCs to pickup would be more than half the fight in order to finish this visual novel