RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Help with making a Battlesystem

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
So i've seen this battlesystem

<a href="http://www.youtube.com/watch?v=lS44GspLncE" target="_blank">http://www.youtube.com/watch?v=lS44GspLncE</a>


And i know it was made using events in rm2k3. I would like to replicate in RMXP, the question is, do i use events or scripts. Can RMXP do this with events? I'm not aware of any commads that let me display text without a window skin that can be changed on the fly to represent health etc. So i figure scriptings the way to go; except i have minimal talent with scripts and im not really confident that i can do somethign like this. So id prefer to do it with events, i think itd be fun to attempt, but the display of health and things that can change would be a huge problem for me. I figured i could just have a variable represent a players health, then have an image representign each digit of the health and changing it based on that, but that seems like a huge pain to complete, is there any easier way to do it with events? or am i stuck requesting a script from someone?


*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
You can use events, but it would be a huge pain to complete, like you've said. Actually, it probably wouldn't be too bad; I would encourage you to attempt it and see if you can gain some steam.

Scripting is probably the easier method, though.

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
Fair enough, thanks :3 So is there anyway to display numbers in RMXP besides usign the way I specified?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Yes - in that case it was probably done using pictures. You could make a number for each digit you need to display, and then you would use an algorithm to interpret a variable and show the correct number on screen, using division and modular arithmetic to derive what each digit is.

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
Indeed, I've been working on implementing just that, I Just use 3 digit numbers, it leads to roughly 29 diffrent conditional branches per 3 digits XD, this whole idea seems to be more of a pain to implement when it could be easily scripted, but i've been slowly working at it and have most of what needs to be done planned out.

*
Rep:
Level 88
Something something events
Project of the Month winner for December 2008
If you're doing the battle system with events, then I have a few tips that might help since I've been doing mine with events as well. Though not sure how much of this applies to RMXP as it does to VX.

For the general battle flow, you'll want to make it so the battle system runs off temp variables. By that I mean, at the start of a battle, you'll probably want to run a event that checks who is in the party (if you have it so you can control different people or multiple people). If it's a solo RPG (only one person the whole game), then this will apply more for the monster side. So let's say the player runs into an enemy. The event will run doing something like "Enemy 1 HP" == "Skeleton HP", "Enemy 2 HP" == "Slime HP". That way when you have the main battle flow stuff going, you only have to worry about Enemy HP 1 and won't have to repeat it. Only reason I say this is because my first evented battle system I made a lot of mistakes to the point I had to copy paste the whole battle system for every monster >>;

Also, not sure if XP does this, but in VX by default the pictures are placed above animations Z depth wise. If it's the same, idk if XP has a script but I know MA has a script for VX, that while it's meant for fixing pictures to the map, it also has a Z-depth function for pictures that lets you draw pictures below the animations.

Again, not sure if XP has a "If key hit" type of function for events, but VX only has the ability in events to check if a key is being "pressed" and it won't check if the player has let go of that key. Though a quick way to simulate a "if key hit" feature is to do something like:



So usually you'll have the loop that waits for input. Once the player hits a key that is valid then you'll jump to the update portion that shows the new pictures. After that then you'd run that little check to see if they are holding the key down still. This way it'll be easier to navigate the menu without it quickly scrolling past the option they wanted. Make sure there is the 1 frame wait though in there or it'll freeze up the game.

Not sure what else I can suggest. I guess I can just show an example:

Spoiler for:
Just to clarify the terms used in my variable/switch naming. Slot 1/2/3 = Person who occupies the first position in the party. EN1/2/3/4/5 = Enemy.

This would be the event that runs when you touch a monster for basic enemy setup. (I have it so the battle takes place on a different map. So you would probably not need any transition stuff)



I have this event run once the player is on the battle map to setup the HUD.


Then finally it'll call the common event I have that is the main battle flow. This is repeated until a victory condition is achieved (or game over).


If you need help with stuff like turn order calcs, (if you're daring) turn order display, or just anything in general when it comes to doing stuff with events just let me know and I'll do my best to help.

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
I've considered most of the temp variable stuff already, i basically have the event you initiate battle from declare four variables which correspond to a common event that assigns values to the monsters "stats". I haven't quite thought of exactly how ill do key presses, but your solution will definitely help :D And i havent even brushed upon the turn order XD that was probably the most horrifying part of the whole battlesystem, i recall when i did one in java and the only thing i couldnt get right half the time was the stupid enemy order. >.< Thank you for your suggestions, I shall defintly consider them when i get off my butt and actually do the stupid thing. Also good luck with your own system : )

*
Rep:
Level 88
Something something events
Project of the Month winner for December 2008
Oh, turn order is actually pretty easy. It's just kinda repetitive stuff since you have to make sure to check all possibilities. Also it depends on how you want to do it. I use a delay system where each action adds +x delay to the character after they attack. Then it checks whoever has the lowest delay. However, the first thing you'll want to do is make sure no one has the same delay. Well, I usually run an initialize delay portion where it checks to see if participants have the same delay values.

Spoiler for:


So it goes through, if 2 participants have the same delay value, a RND happens. If 0 or 1, -1 to the winner's delay. However, whenever someone has matching delays, it also triggers a switch, which I call "Conflict Found".  As long as the "Conflict Found" switch is on, at the end of calling all the initialize delay common events, it'll go back to the top and repeat (turns off switch at the start) until no conflicts are found.

Then it's just choosing what type of turn system you want to use. You can do the input all actions, then have all actions take place. Or, you can have it so you input action once their turn comes around (thus giving fast characters a chance to take more then one turn before the enemy). The first way, you would just run the initialize delay at the start of every turn. After that, check how many are active in battle (able to take an action for the turn round). Then you would run a check to see who's the fastest.

Spoiler for:



If a person is slower, then a switch is turned on that they lose the chance at that turn slot. If it's the person being checked to all others, then it jumps to the end of the check event. This is because while they may be slower then one enemy, they could be faster to another. This is to prevent the wrong person from taking the turn slot. I usually use a variable "Turn Flag" and each character/EN gets a unique number.

Then once the fastest person is found, then have a variable "Action 1" == "Turn Flag". After that, turn on a switch "Character/EN X Already has Turn" is turned on. Then rerun the same check events to find the new fastest person for Action 2. Then keep repeating until you have all actions accounted for with the amount of people active in battle. Though to note, a slight alteration should be made to the Check events.

Spoiler for:


Since I'm not using the input all actions before turn starts type of method, I don't have this in my event. However, you'll want to make sure this check happens. This way, when you recheck for the new fastest character, it will skip the person who took the first action slot so that way they don't get multiple actions. Then once all the turns are figured out, you would just run an event that goes through
If "Action 1" == 1
 Call Common Event: "Hero 1's Action Scene" <-- does animation, damage etc)
Else
 If "Action 1" == 2
  Call Common Event "Hero 2's Action Scene"
 Else


Then let's say Action 4 ends up == 0 (since theoretically there were only 3 actions being taken this round) it'll jump to the end, and go back to input phase.

The other way, there is no need for this since once the fastest person is found, you just have them take their action. Then you would adjust everyone's delay and then repeat. However, both ways after every turn/turn cycle, you'll want to keep checking to see if people have matching delays since there is always a chance for that happening mid fight.

I hope that helps. I hope I was able to explain it well enough since half the time it sounds right in my head, then I may of accidentally left something out.  :V

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
It sounds fine :P Thanks :3 I had the idea of using an algorithim involving the respective agi of the characters, then making an action pool (somewhat) then every attack skill or defend would eliminate the action pool >.< Once again, many thanks for your input, now to get off my ass and do the flocking system :3 As ironic as it is, if you ever need help thinking up ideas or discussing things, drop me a pm or something and we can put our respective minds together :P