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.
RMVX sensitive push backs (diagonal pushing)

0 Members and 1 Guest are viewing this topic.

*
Rep: +0/-0Level 68
RMRK Junior
Hello, it's certainly been awhile since I've used RPG Maker and I'm not certain if it's capable of doing what I want it to do..

My project is an a-rpg so obviously pixel-movement is involved or a very low grid base (8X8 is pretty low).  I will be using RPG Maker VX based on the sole reason that rgss has been updated or hidden classes have been released from xp(or so I've heard).

Now the type of ABS I'm trying to do is similar to seiken densetsu 3, the only problem I have is the push back(when you hit the enemy) the enemy moves back depending on where you're standing.  If you're slightly under the enemy it moves diagonal-up, center is directly back, and on top is obviously diagonally-down.  And I even know the math for it! 

Code: [Select]
degree = radtodeg(arctan2(vec1.y - vec2.y, vec2.x - vec1.x));
to keep it simple, or a small script.

Code: [Select]
x1 = argument0;
y1 = argument1;
x2 = argument2;
y2 = argument3;

dt = sqrt(sqr(x2 - x1) + sqr(y2 - y1));
dir = 0;

if (x2 > x1){
   if (y2 > y1){
       dir = ceil(arcsin((y2 - y1)/dt));
   }else{
       dir = ceil(360 - arcsin((x2 - x1)/dt));
   }
}else{
   if (y2 > y1){
       dir = ceil(180 - arcsin((y2 - y1)/dt));
   }else{
       dir = ceil(180 + arcsin((x2 - x1)/dt));
   }
}
return (((arctan2(argument0-argument2,argument1-argument3)* (180/pi))) + 450) mod 360;

The above code is obviously affiliated with game maker, the only reason I'm not using game maker is because of time.  And I prefer ruby over gml to be honest..

Now the only problem I'm seeing is, is how do I actually move the enemy(event) back?  I have tried using a advanced event script, the script function in the set_move_rout and even tried writing a hit detection script(which failed..) 

Anyone got any ideas?..