The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: mitoz on January 07, 2010, 01:56:57 AM

Title: Make event occur if all enemies are dead?
Post by: mitoz on January 07, 2010, 01:56:57 AM
I am having a little problem figuring something out. I am currently using the Mr. Mo abs and i want to make it so that a event occurs once i kill all of the monsters on the map. How would i proceed in doing something like this? I tried searching around various forums but i can not figure it out.

I would appreciate any help that you can possibly give me. 


Title: Re: Make event occur if all enemies are dead?
Post by: Grafikal on January 07, 2010, 02:04:46 AM
Well, if I remember correctly, this is directly related to the events noted as 'enemies' on the map and so you would have to find where in the script it says to add a number to a variable. Generally you do this within the event of the enemy upon death on map. I don't know anything about Mr.Mo abs so I couldn't tell you and for that reason, I'm moving this to script support.
Title: Re: Make event occur if all enemies are dead?
Post by: mitoz on January 07, 2010, 03:33:56 AM
Thanks for moving the thread bud.

I have tried messing around with the variables before i posted here but i couldn't get it working after like an hour of working on it. I am not the best when it comes down to variables though. :-\
Title: Re: Make event occur if all enemies are dead?
Post by: mitoz on January 09, 2010, 06:12:59 PM
Bump. Can anyone help me with this?
Title: Re: Make event occur if all enemies are dead?
Post by: DarkGamer on January 09, 2010, 08:18:00 PM
Search for some variable threads, i bet there are a lot there...

Variables work with Conditional Branch...

You set variables for something, i will give an example... A dice rolling example...

Ok, when you roll a dice it can be 1,2,3,4,5 or 6...

Ok, lets start:

"A simple dice gambling system that is coming from my head atm xD"

Rolling the dice:

"you add a npc to make the dice game start, to activate the switch rolling dice, and start the game."

if Switch Rolling dice On
Show choices:
Want to roll the dice?
Yes
variable (dice) rating 1~6
switch dice event on
else
nothing

Set (dice) variable = 0


Conditional Branch:
If switch dice event on
If variable (dice)= 1
"here you could show a picture witha number 1 on the dice"
Show picture (dice 1)
else
Conditional Branch:
If switch dice event on
If variable (dice)=2
show picture (dice2)
So on with the other 4 numbers.


Now to add something to happen when the value is 1...

in another paralell process

Conditional Branch
if variable (dice)=1
erase picture (dice 1)
show message: That roll sucked, try again...
Set variable (dice)=0
switch dice event off
Switch Rolling dice On
else
Conditional Branch
if variable (dice)=6
erase picture (dice 6)
show message: You just won, take this as a reward.
add item: 1000G
Set variable (dice)=0
switch dice event off
Switch Rolling dice On
else
Conditional Branch
if variable (dice)=3
erase picture (dice 3)
show message: Too bad, that's an unlucky number.
remove item: 500G
Set variable (dice)=0
switch dice event off
Switch Rolling dice On


This is a simple dice gambling system that i think is easy to teach you how it does work...
This was what came to my mind atm, so, hope you can understand and start using variables in a ton of diff ways.

Gl