KAZESUI'S PROFILE
Search
Filter
RM2k3 CBS Targeting Help
You can do these by the help of using pointers.
Make a set of consecutive variables for the enemies (for example variable 51 to 55).
Make an event for each enemy, and at the start of a battle, store the event ID values in the variables from 51 to 55.
Now, use a variable which starts at say value 51. This value should go to 52 if you press the down button. let's say that in variable 52, there's the number 13 which is the ID of one of the enemies. You can make use of this to call an event page from that very enemy by getting that value and then have another variable with the correct page number as a value.
The page could just be like:
variable enemy screen x = this screen relative coordinate x
variable enemy screen y = this screen relative coordinate y
variable enemy screen x = + 16
show picture cursor at enemy screen x, enemey screen y
Now you can easily show which enemy you're targetting. Once an enemy is killed, say enemy with ID 13. you check if variable 51 has the value 13. if not, then you check variable 52 and so on. if you find it at variable 52, you take the value of variable 53 and store it in 52, and the one in variable 54 and store it in 53 and so on. This effectively removes the enemy out of the possible list of targets, so that you can only target living enemies.
If you're unfamiliar with pointers, then I strongly suggest you get familiar with them (tutorial link)
This all probably makes a bit more sense if you understand the use of them.
If or once you have a fair grasp of pointers, I could let you take a look at a CBS I have lying around with the intention of writing a tutorial on it at some point. It's rather WIP, but enemy targetting is fully functional.
Make a set of consecutive variables for the enemies (for example variable 51 to 55).
Make an event for each enemy, and at the start of a battle, store the event ID values in the variables from 51 to 55.
Now, use a variable which starts at say value 51. This value should go to 52 if you press the down button. let's say that in variable 52, there's the number 13 which is the ID of one of the enemies. You can make use of this to call an event page from that very enemy by getting that value and then have another variable with the correct page number as a value.
The page could just be like:
variable enemy screen x = this screen relative coordinate x
variable enemy screen y = this screen relative coordinate y
variable enemy screen x = + 16
show picture cursor at enemy screen x, enemey screen y
Now you can easily show which enemy you're targetting. Once an enemy is killed, say enemy with ID 13. you check if variable 51 has the value 13. if not, then you check variable 52 and so on. if you find it at variable 52, you take the value of variable 53 and store it in 52, and the one in variable 54 and store it in 53 and so on. This effectively removes the enemy out of the possible list of targets, so that you can only target living enemies.
If you're unfamiliar with pointers, then I strongly suggest you get familiar with them (tutorial link)
This all probably makes a bit more sense if you understand the use of them.
If or once you have a fair grasp of pointers, I could let you take a look at a CBS I have lying around with the intention of writing a tutorial on it at some point. It's rather WIP, but enemy targetting is fully functional.
Release Something 11
Being right before my batch of finals, the timing isn't all that good. Luckily I have some tech demo's lying in my folder which I suppose could still be of interest with some minor adjustments, so I can see if I can get something out
Path Finding
Dijkstra's algorithm isn't and shouldn't be used for moving the player/actor if this one has already generated a move field, since the neccessary information for quick path finding should already be contained within this field.
The only actual need for the Dijkstra's algorithm is for the AI, which can't determine as easily where it should go, especially if the player units are far away. The AI would have to be able to think some moves ahead, meaning a normal move field wouldn't work for the AI.
If the AI being fairly stupid isn't a problem, you could do something fairly simple as just making the event move in the direction of the closest player unit. This will cause the enemies to seem retarded and get stuck every now and then, but it will be quick, and interesting games can still be made, with this being an example: link (it's even in german).
The AI in that game is rather stupid, but the game is still somewhat fun to play.
The only actual need for the Dijkstra's algorithm is for the AI, which can't determine as easily where it should go, especially if the player units are far away. The AI would have to be able to think some moves ahead, meaning a normal move field wouldn't work for the AI.
If the AI being fairly stupid isn't a problem, you could do something fairly simple as just making the event move in the direction of the closest player unit. This will cause the enemies to seem retarded and get stuck every now and then, but it will be quick, and interesting games can still be made, with this being an example: link (it's even in german).
The AI in that game is rather stupid, but the game is still somewhat fun to play.
Path Finding
It's not as much a flaw, but rather a consequence, and not just related to your laptop. Having lot of events on a map will affect the performance, and this algorithm is already pretty heavyweight, so there isn't really that much you can do about it. Even in my video showing this system used (link), there's a very noticable lag spike when the AI tries to decide how to move, so this is pretty much expected I'm afraid.
Just about the only thing you can do to avoid a lag spike in such a situation, is to include a 0.0 wait in the dijkstra algorithm. This will remove most lag, but also means that the algorithm will require significantly more time to finish.
So when you're working with a TBS in rm2k3 and you want AI which is able to walk around obstacles to get to the player units, then this is a limit you're most likely going to have to live with. Since TBS's are turn based I'd say this is an somewhat acceptable cost.
When not making a TBS, there are alternatives which can be better, but depends highly on the exact task required.
Just about the only thing you can do to avoid a lag spike in such a situation, is to include a 0.0 wait in the dijkstra algorithm. This will remove most lag, but also means that the algorithm will require significantly more time to finish.
So when you're working with a TBS in rm2k3 and you want AI which is able to walk around obstacles to get to the player units, then this is a limit you're most likely going to have to live with. Since TBS's are turn based I'd say this is an somewhat acceptable cost.
When not making a TBS, there are alternatives which can be better, but depends highly on the exact task required.
Need help eventing a custom-type of attack
What you generally do for "charging" attacks, i.e. ones where you hold down a button for an amount of time is that you make use of key inputting without "wait until pressed" checked running in a loop until the key you're checking isn't held down any more.
Assuming rm2k3, it's also important to do multiple checks before accepting that the key has been released, since it will occasionally claim to have been released on lot of keyboards without it being the case.
Here's a sample project which should fit your description somewhat: Sample (assuming rm2k3).
The top left event handles everything of interest. It first runs on parallel process waiting for confirm key to be pressed, and activates a switch as soon as it does.
This switch triggers the next page which is an auto-start event, and thus stops the enemies from moving. This page sets a "Charge Counter to 0" and then starts iterating through a loop. The charge counter is there for the sake of differentiating between just hitting the confirm key, and holding it down for a longer time.
For each iteration, you increase the charge counter by 1 and do two key input processes. One only checks for the confirm button, while the other only looks for direction buttons. Both have "wait" unchecked.
You then use change the facing according to the variable used for key input of the directions, and you then check if the confirm button is still pressed with the other.
if it isn't, then you do the check a few more times with a 0.0 wait inbetween. If any of the branches say that the key is still pressed, you jump to the top of the event again, if not you check if the button was held down long enough, and execute whatever code you want to happen if yes. Then you turn the switch off and the event will return to page one and wait for key input.
Assuming rm2k3, it's also important to do multiple checks before accepting that the key has been released, since it will occasionally claim to have been released on lot of keyboards without it being the case.
Here's a sample project which should fit your description somewhat: Sample (assuming rm2k3).
The top left event handles everything of interest. It first runs on parallel process waiting for confirm key to be pressed, and activates a switch as soon as it does.
This switch triggers the next page which is an auto-start event, and thus stops the enemies from moving. This page sets a "Charge Counter to 0" and then starts iterating through a loop. The charge counter is there for the sake of differentiating between just hitting the confirm key, and holding it down for a longer time.
For each iteration, you increase the charge counter by 1 and do two key input processes. One only checks for the confirm button, while the other only looks for direction buttons. Both have "wait" unchecked.
You then use change the facing according to the variable used for key input of the directions, and you then check if the confirm button is still pressed with the other.
if it isn't, then you do the check a few more times with a 0.0 wait inbetween. If any of the branches say that the key is still pressed, you jump to the top of the event again, if not you check if the button was held down long enough, and execute whatever code you want to happen if yes. Then you turn the switch off and the event will return to page one and wait for key input.
Guess that game!
Puzzle Tower
Yes it does, doesn't it? And apparently this (less original) concept proved efficient. Which reminds me that I should mention the inspiration in the profile as well, thanks.
How do I stop people editing my game map?
author=Nightowl
On other hand, if for example, I made a CBS which makes the community go OMG then I'd rather molebox the entire project so stupid people won't steal my code.
Keep in mind that if the person is stupid, (s)he is not that likely to be able to make use of the CBS anyway. If that person is able to, then the CBS probably wasn't so OMG anyway.
People who could read the CBS code and make use of it are most likely the kind that could build CBS's on their own, or ones who just wants to learn how to do it.
So it is possible to make enemies have movement after all and make it 3D
If you'd pay attention, you'd notice that the second video, i.e. the one with the 3D, is done in rm2k3, so the only thing you'd find would be event code pendling through tons of pre-rendered panorama/pictures.
Not a very good way to make 3D features in a game I might add.
Not a very good way to make 3D features in a game I might add.
Lunori Demo v1 RELEASED
This demo is an unexpected surprise.
Quite a few bugs in it though.
- Diagonal moment is quite the fun thing. You can move diagonally pretty much whenever you like, including when you're talking (could ruin cut scenes). It also introduces a lot of problems with passability, especially noticeable once you get out of the cave.
- Being poisoned seems to mess up the main menu in terms of dislocating some pictures.
- There's a map in the town which cause a fatal crash a la "tried to reference non existing event".
- It's apparently possible to totally disable the sub menus (not sure specifically what'd cause it though. Maybe dying with sub menu still open or while trying to access it or something.
- The holy statue thingy in the cave will disappear for a tiny while when closing the main menu.
- Talking to the girl at the inn and then choosing not to stay will fail to remove the "talking" picture
Also, it's not quite intuitive that you can jump into the water from a ledge... but not by walking into it from the stairs.
Quite a few bugs in it though.
- Diagonal moment is quite the fun thing. You can move diagonally pretty much whenever you like, including when you're talking (could ruin cut scenes). It also introduces a lot of problems with passability, especially noticeable once you get out of the cave.
- Being poisoned seems to mess up the main menu in terms of dislocating some pictures.
- There's a map in the town which cause a fatal crash a la "tried to reference non existing event".
- It's apparently possible to totally disable the sub menus (not sure specifically what'd cause it though. Maybe dying with sub menu still open or while trying to access it or something.
- The holy statue thingy in the cave will disappear for a tiny while when closing the main menu.
- Talking to the girl at the inn and then choosing not to stay will fail to remove the "talking" picture
Also, it's not quite intuitive that you can jump into the water from a ledge... but not by walking into it from the stairs.













