Hello everyone. I'm working on a tactical fighting hybrid game similar to The Unholy War on PS1. The game makes use of two battle systems. A tactical one which is used on the map of the game, (I am making the tactical battle system with events because ruby makes no sense to me and it would be easier anyway), and when a unit attacks another on the map, the game switches to a fighting game battle system (which I am using the Tales of Battle system with major modifications I made to it).
Having the player move units on the tactical battle system is working well, the only problem I'm having is trying to find a practical way for the enemy AI to detect what player units are closest to its units so it can move its units towards the player units that are closest.
I tried using events to make this happen but it became clear that this was not a practical approach. So then I tried using ForeverZero's area activate script. But that didn't work out either.
So the only other way this detection could be achieved practically seems to be with scripts. But I don't know anything about ruby except for modifying certain things in scripts.
So I was wondering if anyone could help me make this script. Here's basically what I want it to do:
Detect what event with the comment "Priority X" on its active page is closest to a specified event. X would be the priority of which even it wants to find x and y map values to.
For example, say we want to detect which unit is closest to event 1 with a priority of 1. Then the script should search for which unit with comment "priority 1" in its active page is the closest. That way we can detect for only certain types of events. But the number of different priorities should be at least 10 if not infinite.
And when it detects which is closest, it will then store the closest unit's x and y values into game variables which should be user specified in the script.
Finally, to call the script, I would like that to be done within the script command of events. The script line should look something like this:
closest(event, priority). Event should be the map event ID that we are searching for units closest to it, and priority should be the priority number specified in the events that we are searching.
Thanks in advance guys, hopefully you scripting geniuses out there can help me with this.
Having the player move units on the tactical battle system is working well, the only problem I'm having is trying to find a practical way for the enemy AI to detect what player units are closest to its units so it can move its units towards the player units that are closest.
I tried using events to make this happen but it became clear that this was not a practical approach. So then I tried using ForeverZero's area activate script. But that didn't work out either.
So the only other way this detection could be achieved practically seems to be with scripts. But I don't know anything about ruby except for modifying certain things in scripts.
So I was wondering if anyone could help me make this script. Here's basically what I want it to do:
Detect what event with the comment "Priority X" on its active page is closest to a specified event. X would be the priority of which even it wants to find x and y map values to.
For example, say we want to detect which unit is closest to event 1 with a priority of 1. Then the script should search for which unit with comment "priority 1" in its active page is the closest. That way we can detect for only certain types of events. But the number of different priorities should be at least 10 if not infinite.
And when it detects which is closest, it will then store the closest unit's x and y values into game variables which should be user specified in the script.
Finally, to call the script, I would like that to be done within the script command of events. The script line should look something like this:
closest(event, priority). Event should be the map event ID that we are searching for units closest to it, and priority should be the priority number specified in the events that we are searching.
Thanks in advance guys, hopefully you scripting geniuses out there can help me with this.