Rivals of Aether

Rivals of Aether

[LEGACY] Abyss Rune Buddy
此主题已被锁定
Supersonic  [开发者] 2019 年 12 月 3 日 上午 11:48
For Developers: Implementing Rune Support



Hello character developer! If you're looking at this discussion, you're either interested in adding rune support to your character, or you're going to look at the block of code you need to paste and call it disgusting. Either way, here's how you do it:

First thing's first, you need to paste the following code into your draw_hud.gml! Make one now if you don't already have it, and paste the following at the END of the file:
//abyss gui code ab_hud_x = temp_x; ab_hud_y = temp_y; //this is for the outdated warning message if ("depNotice" not in self) depNotice = 0; if (abyssEnabled && (menuActive || timerActive)) abyssDraw(); #define abyssDraw /// abyssDraw() /// draws text and images the player recieved from the abyss buddy. if ("abyss_drawArray" in self && ds_list_valid(abyss_drawArray)) { if (ds_list_size(abyss_drawArray) > 0) { for (var _i = 0; _i < ds_list_size(abyss_drawArray);_i++) { var _text = abyss_drawArray[| _i]; if draw_get_halign() != _text[6] { draw_set_halign(_text[6]); } switch (_text[0]) { case 0: draw_debug_text(floor(_text[1]),floor(_text[2]),string(_text[3])); break; case 1: draw_sprite_ext(_text[3],_text[5],_text[1],_text[2],1,1,0,_text[4],1); break; case 2: draw_text_plus(floor(_text[1]),floor(_text[2]),string(_text[3]),floor(_text[5]),floor(_text[4])); break; case 3: if draw_get_font() != 1 draw_set_font(1); draw_text_ext_color(floor(_text[1]),floor(_text[2]),string(_text[3]),16,floor(_text[5]),_text[4],_text[4],_text[4],_text[4], 1); break; default: break; } } } //finished drawing, so clear the table for the next frame. ds_list_clear(abyss_drawArray); } //return draw_calls; #define draw_text_plus /// draw_text_plus(x, y, text, font, color = c_white) /// draws outlined text in any in-game font. var x = argument[0], y = argument[1], text = argument[2], font = argument[3]; var color = argument_count > 4 ? argument[4] : c_white; if draw_get_font() != font { draw_set_font(font); } draw_text_color(x+2,y,text,c_black,c_black,c_black,c_black,1); draw_text_color(x-2,y,text,c_black,c_black,c_black,c_black,1); draw_text_color(x,y-2,text,c_black,c_black,c_black,c_black,1); draw_text_color(x,y+2,text,c_black,c_black,c_black,c_black,1); draw_text_color(x+2,y-2,text,c_black,c_black,c_black,c_black,1); draw_text_color(x-2,y-2,text,c_black,c_black,c_black,c_black,1); draw_text_color(x+2,y+2,text,c_black,c_black,c_black,c_black,1); draw_text_color(x-2,y+2,text,c_black,c_black,c_black,c_black,1); draw_text_color(x,y,text,color,color,color,color,1);
You won't need to do anything else with this block of code, it will already work on its own, but it is integral that this code is present.

Then, at the beginning of init.gml, add the following block of code:
//this var makes f5 not break the buddy if developing with more than one //workshop character or buddy in the match //abyss_devmode = true; // abyssEnabled = false; enum runes {A = 1,B = 2,C = 3,D = 4,E = 5,F = 6,G = 7,H = 8,I = 9,J = 10,K = 11,L = 12,M = 13,N = 14,O = 15} runeA = false; runeB = false; runeC = false; runeD = false; runeE = false; runeF = false; runeG = false; runeH = false; runeI = false; runeJ = false; runeK = false; runeL = false; runeM = false; runeN = false; runeO = false; runesUpdated = false; ab_hud_x = 0; ab_hud_y = 0; //abyssMods[1 to 15] = [type, description]; //types are: -1 - disabled // 0 - object mod: Modifies a static object left behind after an attack. // 1 - ranged mod: Modifies a projectile attack. // 2 - hit mod: Modifies a direct physical interaction with an opponent. // 3 - ability boost: Powers up a character attribute or action. abyssMods = array_create(16,[-1,"Not Implemented."]); //example rune definition: //abyssMods[@ runes.A] = [3,"Ground speed is faster."]; //abyss init code over

You'll be defining all of your rune's descriptions and types here.

To define a rune, you have to create the following line of code, taken from the example:
abyssMods[@ runes.A] = [3,"Ground speed is faster."];
This sets rune A to the type 3, which is an ability boost, and gives it the description "Ground speed is faster."

If a rune is not defined, it will be greyed out and unequippable.

If you'd like to be more accurate to the game when making rune descriptions, be sure to capitalize move names!
For example, NSpecial would be NSPECIAL, and Dash Attack would be DASH ATTACK.


Now for the fun part. To check if a rune is active in another gml file, simply check for runeA, replacing A with the desired letter. Letters A through O are usable, though you probably already knew. Depending on the type of rune, you should also check for the variable runesUpdated.
runesUpdated is only true when a player's rune loadout gets pushed, then it returns to false.


Example usage, in update.gml:
if runesUpdated { //attribute changes and things that don't have to run every frame go in here if runeA { //this will run when runes are updated and //runeA is enabled. walk_speed = 4; dash_speed = 8.5; initial_dash_speed = 8.5; } else { //this will run when runes are updated and //runeA is disabled. walk_speed = 3; dash_speed = 7.5; initial_dash_speed = 7; } }

You can look at Hime Daisho's code to see full rune implementation programmed by me.


That should be all the information you need to get rune support up and running on your character! By all means, contact me on Discord ( Supersonic#9999 ) if you're having issues with implementation.
最后由 Supersonic 编辑于; 2020 年 1 月 4 日 上午 3:59