topic
How can I make a skill hit a random enemy?
RPG Maker 2000/2003 SupportOpen up the Database editor, go to the Skills tab, and the option is located under "Scope".
And check for any potential bug fixing scripts... just saying.
I just checked under Scope. There is no random option in 2k3. There is an alternative, but it's complicated. You'd have to create the effect of randomness in every individual enemy troop.
* First, the skill you want to make, change the "Skill Type" to "Switch". Choose a switch that you'll dedicate for this spell.
* Now, in the enemy troop, you'll want a page condition for that switch being turned on.
* In the script below, set a variable to a random number. The range will be however enemies are in the troop. If there are three enemies, set it random from 1-3. If there's five enemies, set it random from 1-5. Basically we're assigning each enemy an imaginary number.
* Then, you'll want a conditional branch based on that variable. If the variable is 1, call a special effect and do to enemy #1 what you want the spell to do. If the variable is 2, do the same with enemy #2 instead. And so forth.
* At the end of the script, make sure to turn that switch back off.
Again, you'll have to do this for every troop in the game. Or at least, the troops that you can encounter while you have this skill.
* First, the skill you want to make, change the "Skill Type" to "Switch". Choose a switch that you'll dedicate for this spell.
* Now, in the enemy troop, you'll want a page condition for that switch being turned on.
* In the script below, set a variable to a random number. The range will be however enemies are in the troop. If there are three enemies, set it random from 1-3. If there's five enemies, set it random from 1-5. Basically we're assigning each enemy an imaginary number.
* Then, you'll want a conditional branch based on that variable. If the variable is 1, call a special effect and do to enemy #1 what you want the spell to do. If the variable is 2, do the same with enemy #2 instead. And so forth.
* At the end of the script, make sure to turn that switch back off.
Again, you'll have to do this for every troop in the game. Or at least, the troops that you can encounter while you have this skill.
How do you "call a special effect"
"Show Animation"
It shows the animation and hits a random enemy (Yay!) but it just shows the animation and doesn't do any damage (Wow using rpg maker 2003 makes me so much more thankful for the conveniences rpg maker vx ace has)
All the skill does is turn on the switch, so you have to remove the targeted enemy's health, yourself.
Does this method take defeated enemies into account?
Nope. You have to use conditionals to ask if the monster is alive when the skill is used. If not, reroll to another, if it is, deal damage. And you have to do it for every monster group, as said. There is no easy way to implement a random target or more than 1-times attack skill in 2k3.
Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-a-skill-hit-a-random-enemy.40341/