I'm using the "Pearl" action battle system (with heavy modifications), and it uses event move-routes as part of its enemy behavior.
In any case, the current enemy's Automatic "move route" looks sorta like this:
Move Toward Player
Move Toward Player
script: use item 69
The "skip if cannot move" and "repeat" boxes are checked.
While this works excellently in real time, I don't want real-time. I've put in another script that only lets events' autonomous movement go forward if the user is moving, which makes the enemy movement more roguelike. It also makes for extremely easy battles.
I wish it were doable within the event's Autonomous Move Route on the event page, but no conditions are allowed there. Thus, I'll need to do a script.
I'd like to have a script that does something like this:
selfx = this event's x
selfy = this event's y
charx = character's x
chary = character's y
If ( ((selfx-charx)(selfy-chary)) ) == 0 && (abs((selfx-charx)+(selfy-chary)) == 1 )
then
script:useitem 69 #(this is an already defined movement action)
else
ROUTE_MOVE_TOWARD #(or, do you use movement number 10 instead of the function name?)
end
This would cause the enemy to move towards you if not orthagonal to you, but once orthagonally alligned, would cause it to use the attack function.
How do I accomplish this in Ruby? How do I call the individual events' x and y values? I'd like the script to be contained inside (or called as a common event) by events, so locality would be nice. Am I going to have to build pre-defined move routes and store them above this part of the script? If so, how do I do that?
Thanks for any help in advance!
In any case, the current enemy's Automatic "move route" looks sorta like this:
Move Toward Player
Move Toward Player
script: use item 69
The "skip if cannot move" and "repeat" boxes are checked.
While this works excellently in real time, I don't want real-time. I've put in another script that only lets events' autonomous movement go forward if the user is moving, which makes the enemy movement more roguelike. It also makes for extremely easy battles.
I wish it were doable within the event's Autonomous Move Route on the event page, but no conditions are allowed there. Thus, I'll need to do a script.
I'd like to have a script that does something like this:
selfx = this event's x
selfy = this event's y
charx = character's x
chary = character's y
If ( ((selfx-charx)(selfy-chary)) ) == 0 && (abs((selfx-charx)+(selfy-chary)) == 1 )
then
script:useitem 69 #(this is an already defined movement action)
else
ROUTE_MOVE_TOWARD #(or, do you use movement number 10 instead of the function name?)
end
This would cause the enemy to move towards you if not orthagonal to you, but once orthagonally alligned, would cause it to use the attack function.
How do I accomplish this in Ruby? How do I call the individual events' x and y values? I'd like the script to be contained inside (or called as a common event) by events, so locality would be nice. Am I going to have to build pre-defined move routes and store them above this part of the script? If so, how do I do that?
Thanks for any help in advance!