The RPG Maker Resource Kit

Other Game Creation => Program Troubleshooting => Topic started by: gafmar on August 26, 2007, 03:59:48 AM

Title: active battle system..
Post by: gafmar on August 26, 2007, 03:59:48 AM
I am a new guy using rpgmkr XP and I was wondering if it is possible to have an active battle system just like the legend of zelda . I only need one character to run around , pick up crap, and stab stuff.
Title: Re: active battle system..
Post by: Falcon on August 26, 2007, 04:33:17 AM
Script Database, Mr. Mo's ABS.

Look in the script database before you post a topic like this in the future.
Title: Re: active battle system..
Post by: blueXx on August 26, 2007, 06:33:56 AM
I haven't been around and now you guys solve abs with scripts instead of madly hard work?   :tpg:
well I don't know how great this new script is but you can solve this via events.
the easiest way are common events which will be triggered by buttons.
now assuming you got a sword thingy weapon you would condition the tile in front of your hero thing (if hero is headed east and tile is hero's X  +1 is filled by enemy1 then enemy1 variable - damage... and the same with Y, else if... enemy2 then... so on, a GIGANTIC common event)
this is also where you set your enemy defenses, after the if you calculate damage.
so assuming our hero got 10 str and we want enemy to take 4 damage because he is hot it can look like:
Damage = herostr - 6(that will be our solid defense)
since the hero got 10, enemy will take 4 damage, but that's boring isn't it?
we want the damage to be a little more random so next we call another common event, or otherwise copypaste the next lines all over

Tempdamage = damage + random [1,10]
Damagereduction = random [1,10]
Damage = Tempdamage - Damagereduction (so now you can do the damage you would have done +9 or -9 at best and worse cases)
but we don't want to heal the enemy... so...
If Damage =< 0 then
 Damage = 1

you can set it to 0 as well, but most games make you do 1 damage if you fail to pwn the defenses of something.

now let's add another little thing.

Critvariable = Heroluck (or agi or whatever you want, you can make a variable and don't have to depend on the game's basic stats) / 10
Tempcrit = random [1,10]
Crit = critvariable + tempcrit
IF crit >= 5 then
 Crit(button thingy) = true
Else
 Crit = flase

If crit = True then
 Damage = Damage * 2

now we go back to the main common event and we deal the damage to the event.
and since we are already there we can add a nice explosion so we add that on the tile next to us, where we found mr event1 hiding, there will be a little explosion thingy graphic, that's easy to do.
we take damage out of the event's life like that : Event1hp = Event1hp - damage

and now we go to the event it self, we will have a line there
If event1hp <= 0 then
 Erase event thingy.

now if you had a ranged weapon you would have to condition many many many more tiles, which would be a bit more complicated.
remember to throw away everything you can into common events in order not to fill up too much any of them, it will be easier for you.
for the events to attack you will want to have conditions with them so that on collusion with the hero they will attempt to do damage or wait 3 seconds then attempt or something crazy like that.

It's a lot of hard work, and I haven't rmxped in a while so i am not certain I am accurate but it's by far more fun to do than just using a script and well, it's a lot easier to change.
Title: Re: active battle system..
Post by: Kokowam on August 26, 2007, 12:20:37 PM
There's a good tutorial on evented ABSes on .org
Title: Re: active battle system..
Post by: Falcon on August 26, 2007, 02:43:45 PM
Script > Events always. Events are inferior to Mr. Mo's great 1000+ lines of code.
Title: Re: active battle system..
Post by: blueXx on August 26, 2007, 06:45:17 PM
scripts <<<< events.
why? because anything a script can do an event can do better, sooner or later you'll wanna edit the script too!
no I won't? yes you will yes you will!

well to put it simple, you can add stats, effects, crazy explosions, you name it - with the events.
can you do that with the script? probably, but you will need to edit the script, do you know ruby? even if you do, most of the people do not.
if that is the case most people would be a lot happier with a crazy event system, and that's just what I do.
Title: Re: active battle system..
Post by: Falcon on August 26, 2007, 09:35:27 PM
Scripts always beat events, of course, you need to use Ruby. Simply because events just get turned in to ruby code by the interpreter, you can do everything events do in scripts. And clearly, you don't know scripting well, or you'd understand :P

Oh, and can events make Scenes? Change the battle system? (well, for an ABS they can of course.) Besides, if you know scripting, it's basically the same as editing an event.

Perhaps we should make a seperate topic for this :P
Title: Re: active battle system..
Post by: modern algebra on August 26, 2007, 10:00:48 PM
Yeah, scripts have a lot more power than events.

Though, BlueXx is correct in saying that it is better to give an eventing solution to someone who cannot script then it is to give a script, because with events, most RM users can customize things.

And it is possible to make some scenes with events, and same with battle systems, but it's very repetetive and annoying, in general. I would've been happy if they just made it so that variables could be arrays. That would increase the functionality of eventing by a whole lot. Though, if that were the case, I may never have switched to events.

As it is though, I prefer scripting because it is much faster to write a script then it is to write an event system, and it is more powerful and can do more. However, I do think it better to give eventing solutions where they are reasonable. Of course, if the person asking is bad at events too, then well, they lose.
Title: Re: active battle system..
Post by: Zeriab on August 27, 2007, 02:28:26 PM
For your enjoyment: http://rmrk.net/index.php/topic,20552.0.html

@gafmar: Did you get your answer?