Rivals of Aether

Rivals of Aether

Remilia Scarlet
Zwataketa  [developer] 3 Nov, 2019 @ 10:44am
HOW TO: Grazing Mechanic
UPDATE: Managed to get make it so that Remilia no longer bounces when grazing an attack. Now grazing is more accurate to the source material! The code has been updated accordingly.

UPDATE 2: I've altered the code in got_hit.gml to remove hitstop and keep the player going in the same direction while grazing no matter what, so now grazing happens smoothly, like in the Touhou fighters. I'd say, short of adding visual fx and making it so the projectiles act like they haven't hit the character, the mechanic is now 1 to 1 with the Touhou games.

For those who want to implement Remilia's grazing mechanic onto their own characters (specifically Touhou characters), here is how you do it for dashing:
1. In init.gml, create two variables for 'grazing' and 'grazecounter'. Set 'grazing' to false and 'grazecounter' to 0:
//Grazing variables
grazing = false;
grazecounter = 0;

2. In update.gml, set 'grazing' to be true and 'grazecounter' to be 5 on starting a dash, then start ticking 'grazecounter' down when doing anything else other than dashing. When 'grazecounter' reaches 0 'grazing' should be made false:
// Grazing code
if(state == PS_DASH || state == PS_DASH_START){
grazing = true;
grazecounter = 5;
}
else{
if grazecounter > 0{
grazecounter--;
}
else{
grazing = false;
}
}
if(grazing && !free){
vsp = 0;
}

3. In got_hit.gml, set the vsp (vspeed), orig_knock (knockback), hitstop, and damage to zero if the character is hit while 'grazing' is true. Set the spr_dir to -1 if left_down is true, otherwise set it to 1. Then set the state to PS_DASH:
if (enemy_hitboxID.type == 2)
{
//Grazing code here
if(grazing){
orig_knock = 0; // this sets knockback to zero
take_damage(player, hit_player, enemy_hitboxID.damage * -1); //this recovers any damage taken from the projectile
state = PS_DASH;
if(left_down){ // this if statement ensures that you will never be turned around while grazing
spr_dir = -1;
}else{
spr_dir = 1;
}
vsp = 0; // this prevents the player from bouncing
grazecounter = 30;
hitstop = 0; // this removes hitstun, making grazing happen smoothly
// play graze sound
sound_play(sound_get("graze"));
}
}
(the sound effect for grazing can be found in Remilia's character files.)
(If your character does not have "got_hit.gml", you will need to create it)

If done properly, your character should be able to graze projectiles while dashing, just like Remilia. I hope you enjoy this feature!

============================================

Thank you to Emong and Nackles42 for helping me create this mechanic.
Last edited by Zwataketa; 24 Dec, 2020 @ 1:10pm
< >
Showing 1-2 of 2 comments
Jaysa, etc. 3 Nov, 2019 @ 11:47am 
Ok, now that's pretty clever. Thanks for posting this guide here! Definitely going to implement this into my own mod as well.

(And I love seeing the progression of the Touhou fandom on here and how this game is getting more Soku inspiration every day).

Reminds me of that Touhou Hisoutensoku 2 mod. One of the biggest issues was that there weren't enough character slots so they had to overlay characters over each other (Flandre over Remilia, Yuuka over Okuu, etc).

One of the biggest advantages to having them ported over to Rivals is that there's literally unlimited custom character slots. I'm really hoping to see this game develop into the MUGEN of Smash Bros, that would be really cool.
LysisLyrics 3 Nov, 2019 @ 2:03pm 
Ooooo a graze mechanic, that's quite nice actually. Would be really cool to see all the Soku characters on the Rival's workshop with this mechanic and then have a whole tournament with them.

Since so much Touhou characters are well-known because of their unique projectiles, you pretty much need the graze mechanic from the fighting games to prevent matches from being too spammy and campy. So glad to see this mechanic being implemented in quite a few characters alreay!
< >
Showing 1-2 of 2 comments
Per page: 1530 50