CBS PROBLEM
Posts
Pages:
1
First of all, I'm using Rm2k3.
Now, I'm working on a custom battle system (similar to Shining Force, or Fire Emblem) at the moment and even if its difficult I've got just about everything figured out except this. The problem is, I can't find a way for the enemies (when its there turn of course) to move toward the heroes. Neither of the heroes are the actual hero event, so I can't just use "move toward hero". I know that I can use proximity to help the enemies choose who to move toward, but its actually figuring out how to get them to move towards the heroes in the first place that's bugging me. There doesn't seem to be an option that allows an event to move toward another, unless its the actual player; and since there's going to be multiple heroes, I can't use that function.
Help? ???
Now, I'm working on a custom battle system (similar to Shining Force, or Fire Emblem) at the moment and even if its difficult I've got just about everything figured out except this. The problem is, I can't find a way for the enemies (when its there turn of course) to move toward the heroes. Neither of the heroes are the actual hero event, so I can't just use "move toward hero". I know that I can use proximity to help the enemies choose who to move toward, but its actually figuring out how to get them to move towards the heroes in the first place that's bugging me. There doesn't seem to be an option that allows an event to move toward another, unless its the actual player; and since there's going to be multiple heroes, I can't use that function.
Help? ???
Well.. the quickest way I can think of would be to set the hero to a blank sprite, then teleport him on top of the character you want enemies to approach, then use "move toward hero".
Oh, do all the enemies move at the same time then?
if that's the case, then yeah, you're going to have to make your own path-finding algorithms.
if that's the case, then yeah, you're going to have to make your own path-finding algorithms.
So basically, what you want is to make a tactical battle system?
To make an enemy target any hero, you should "scan" the area close to the enemy for any hero events (i.e. by checking events within within certain x/y range of the enemy, the total amount of cells of difference of any event, et cetra).
at the end you're supposed to have on "target event" chosen by priority and range of the enemy event. you then take the x and y value of the target event, and the x and y value of the hero event and subtract them with each other.
if say "hero event" is (2,3) and "enemy event" is (3,5) and you subtract "hero event" with "enemy event", you're going to get (-1,-2).
now you make a loop and make the enemy move in a direction depending on these variables. if the x is -1 or less, you make him move left once, and add 1 point to the variable, and vice versa and same for the y variable. This goes on until both reach 0 or until his range variable reaches x (0 if you wanna deduct from his range, or the number of whatever his max range if you add).
obviously, it's going to be more complicated than this, when taken unpassable obstacles and lot of other stuff into consideration, but I hope with this you've at least got something to work with, rather than being clueless as to how to make 'em move.
To make an enemy target any hero, you should "scan" the area close to the enemy for any hero events (i.e. by checking events within within certain x/y range of the enemy, the total amount of cells of difference of any event, et cetra).
at the end you're supposed to have on "target event" chosen by priority and range of the enemy event. you then take the x and y value of the target event, and the x and y value of the hero event and subtract them with each other.
if say "hero event" is (2,3) and "enemy event" is (3,5) and you subtract "hero event" with "enemy event", you're going to get (-1,-2).
now you make a loop and make the enemy move in a direction depending on these variables. if the x is -1 or less, you make him move left once, and add 1 point to the variable, and vice versa and same for the y variable. This goes on until both reach 0 or until his range variable reaches x (0 if you wanna deduct from his range, or the number of whatever his max range if you add).
obviously, it's going to be more complicated than this, when taken unpassable obstacles and lot of other stuff into consideration, but I hope with this you've at least got something to work with, rather than being clueless as to how to make 'em move.
Kazesui, I get what you're saying, but its still a bit hard to follow.
I know how to set event coordinates, so that's not a problem. But I'm having trouble understanding the more complicated math side of this right now. I've already got this set up:
- You can choose what hero you want to move at the moment.
- You can move the hero you have chosen, and the other / others don't move.
- When you have a hero selected, and an enemy is one space away (may depend on the hero), you go into a battle encounter (which I'll edit things with that later.)
Basically, now, all I have to work out is movement limitations (making the hero only able to move x spaces from where he / she was selected), and what I've asked in this topic.
Movement limitations should hopefully be easier then the monster movement direction AI, but if anyone wants to help me out with this system in general, that would also be appreciated. If, for whatever reason you do want to help out with this more, please PM me. I'll be sure to credit you if this system is completed.
I know how to set event coordinates, so that's not a problem. But I'm having trouble understanding the more complicated math side of this right now. I've already got this set up:
- You can choose what hero you want to move at the moment.
- You can move the hero you have chosen, and the other / others don't move.
- When you have a hero selected, and an enemy is one space away (may depend on the hero), you go into a battle encounter (which I'll edit things with that later.)
Basically, now, all I have to work out is movement limitations (making the hero only able to move x spaces from where he / she was selected), and what I've asked in this topic.
Movement limitations should hopefully be easier then the monster movement direction AI, but if anyone wants to help me out with this system in general, that would also be appreciated. If, for whatever reason you do want to help out with this more, please PM me. I'll be sure to credit you if this system is completed.
moving the hero is much of the same principle.
you'll of course need to have some kind of cursor and way of choosing the individual hero. once chosen you should simply select another coordinate. then subtract this coordinate with the ones of the hero in question, multiply any coordinates with negative numbers with -1 and add the x and y coordinate. This way you get the total amount of cells needed to reach the destination. if this is above the max range of the hero, play a failure tune or something, and let the player select a new coordinate.
when given in a coordinate within the range of the hero, set the coordinates again, subtract with each other, and move in accordance with the difference as stated in the previous post.
same thing here, bit more complicated than just that, since there's probably going to be unpassable obstacles here as well and other possible problems, but this is more or less the gist of it.
you can probably feel free to pm about other problems or more spesific solutions about this, and depending on my mood and time to spare I'd probably try to answer to the best of my capabillities
you'll of course need to have some kind of cursor and way of choosing the individual hero. once chosen you should simply select another coordinate. then subtract this coordinate with the ones of the hero in question, multiply any coordinates with negative numbers with -1 and add the x and y coordinate. This way you get the total amount of cells needed to reach the destination. if this is above the max range of the hero, play a failure tune or something, and let the player select a new coordinate.
when given in a coordinate within the range of the hero, set the coordinates again, subtract with each other, and move in accordance with the difference as stated in the previous post.
same thing here, bit more complicated than just that, since there's probably going to be unpassable obstacles here as well and other possible problems, but this is more or less the gist of it.
you can probably feel free to pm about other problems or more spesific solutions about this, and depending on my mood and time to spare I'd probably try to answer to the best of my capabillities
Pages:
1














