Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom moves Reference chart #39

Open
HuntertheWhale opened this issue Dec 17, 2017 · 18 comments
Open

Custom moves Reference chart #39

HuntertheWhale opened this issue Dec 17, 2017 · 18 comments

Comments

@HuntertheWhale
Copy link

Now i am not saying you have to, but it would be nice if at lest someone online made a reference chart on how to program in the moves. I would't even care if it was just a png of a helpful chart, cause all I know how to do is copy-paste the moves.

@ghost
Copy link

ghost commented Mar 10, 2018

I could make a reference chart :).

@ghost
Copy link

ghost commented Mar 10, 2018

I'll comment it below this.

@HuntertheWhale
Copy link
Author

HuntertheWhale commented Mar 11, 2018 via email

@HuntertheWhale
Copy link
Author

HuntertheWhale commented Mar 11, 2018 via email

@HuntertheWhale
Copy link
Author

HuntertheWhale commented Mar 24, 2018 via email

@HuntertheWhale
Copy link
Author

HuntertheWhale commented Apr 5, 2018 via email

@HuntertheWhale
Copy link
Author

HuntertheWhale commented Apr 5, 2018 via email

@Jcw87
Copy link
Owner

Jcw87 commented Apr 7, 2018

I'm tired of getting messages about this, so here's a quick rundown:

The basic concept that attacks started as was a "timeline" of actions that would be performed. I decided I could quickly implement this with csv files, with the first column being a time delay (in seconds), the second being a function name (action to perform, like trigger a gaster blaster), and any additional columns would be arguments to the function.

// Data types
// X - horizontal position in game window. 0 is left side, 640 is right side.
// Y - vertical position in game  window. 0 is top side, 480 is bottom side.
// Direction - integer from 0 to 3. 0 is east, each increment is 90° clockwise
// Speed - pixels per second. Multiply an original Undertale value with 30 (fps) to get its equivalent here. 
// Color - 0 for white, 1 for blue. Other colors (such as orange) may or may not be added in the future.
// Time - seconds
// Angle - degrees
// b - boolean, but its actually just an integer 0 or 1

function BoneH(X, Y, Width, Direction, Speed, Color) {} // Create a horizontal bone
function BoneV(X, Y, Height, Direction, Speed, Color) {} // Create a vertical bone
function BoneHRepeat(StartX, StartY, Width, Direction, Speed, Count, Spacing) {} // Create many horizontal bones.
function BoneVRepeat(StartX, StartY, Height, Direction, Speed, Count, Spacing) {} // Create many vertical bones.
function SineBones(Count, Spacing, Speed, Height) {} // Created out of laziness, probably shouldn't use.
function BoneStab(Direction, Distance, WarnTime, StayTime) {} // Wall of bones pops out of the side of the combat zone
function GasterBlaster(Size, X, Y, EndX, EndY, EndAngle, SpinTime, BlastTime) {} // Creates a gaster blaster, moves it into position, and fires.
function Platform(X, Y, Width, Direction, Speed, bReverse) {} // Create a platform. bReverse makes it change direction.
function PlatformRepeat(StartX, StartY, Width, Direction, Speed, Count, Spacing) {} // Create many platforms.
function HeartMode(mode) {} // 0 is red, 1 is blue
function HeartTeleport(X, Y) {} // Instantly move the heart.
function HeartMaxFallSpeed(maxspeed) {} // Sets the max fall speed, Useful for varying speeds of the slam attack.
function SansSlam(Direction) {} // Slams the heart against the combat zone.
function SansSlamDamage(bEnabled) {} // Enables/Disables slam damage.
function CombatZoneSpeed(speed) {} // Set speed of combat zone resize. Only used in the final attack.
function CombatZoneResize(left, top, right, bottom, finishaction) {} // Resize the combat zone to the new bounds, and execute finishaction when it is done.
function CombatZoneResizeInstant(left, top, right, bottom) {} // Instantly resize the combat zone
function SansAnimation(name) {} // Perform one of the multi-sprite animations ("Idle", "HeadBob", and "Tired")
function SansBody(name) {} // Show one of the full body animations ("HandUp", "HandDown", "HandLeft", "HandRight")
function SansTorso(name) {} // Show one of the torso animations ("Default", "Shrug")
function SansHead(name) {} // Show one of the head animations ("Default", "LookLeft", "Wink", "ClosedEyes", "NoEyes", "BlueEye", "Tired1", "Tired2")
function SansSweat(level) {} // How much sweat sans should show (0 - 3)
function SansX(X) {} // Move sans to a horizontal position
function SansRepeat() {} // Make sans scroll across the screen
function SansEndRepeat() {} // Stop sans from scrolling
function SansText(text) {} // Sans speech bubble (only really short text!)
function BlackScreen(bEnabled) {} // Show or remove black screen. Also removes projectiles from the combat zone
function Sound(name) {} // play any of the sounds (example: "Flash")
function Music(name) {} // play music (only "mus_zz_megalovania" works)
function TLPause() {} // Pause the timeline.
function TLResume() {} // Resume the timeline. Is only useful when "scheduled" by some other action (like CombatZoneResize)
function EndAttack() {} // Ends the attack, allowing the game to continue. This MUST be called, or the attack will never end.

But this alone isn't enough. Undertale has random numbers and some complicated algorithms behind some attacks. So I tacked on variables, math functions, and flow control and oh no this is a programming language now what have I done?

Any column which has a value starting with '$' will be interpreted as a variable (example: "$MyVariableName"). This includes the delay time in the first column. A ':' and a custom identifier can be used in place of a function name to create a label (example: ":MyLabel").

function SET(VarName, value) {} // Sets a variable to a value
function ADD(VarName, value1, value2) {} // Adds two numbers and stores the result in a variable
function SUB(VarName, value1, value2) {} // I'm going to leave the others to your imagination
function MUL(VarName, value1, value2) {}
function DIV(VarName, value1, value2) {}
function MOD(VarName, value1, value2) {}
function FLOOR(VarName, value) {}
function DEG(VarName, value) {} // Convert radians to degrees
function RAD(VarName, value) {} // Convert degrees to radians
function SIN(VarName, value) {}
function COS(VarName, value) {}
function ANGLE(X1, Y1, X2, Y2) {} // Calculates an angle from point 1 to point 2
function RND(VarName, n) {} // Generates a random integer from 0 to n-1
function JMPABS(line) {} // Jump to a specific line (by number or label)
function JMPREL(offset) {} // Jump to a line number relative to the current one
function JMPZ(line, test) {} // Jump to a line if the test value is 0
function JMPNZ(line, test) {} // Jump to a line if the test value is not 0
function JMPE(line, test1, test2) {} // Jump to a line if the test values are equal
function JMPNE(line, test1, test2) {} // Jump to a line if the test values are not equal
function JMPL(line, test1, test2) {} // Jump to a line if test1 is less than test2
function JMPNL(line, test1, test2) {}
function JMPG(line, test1, test2) {} // Jump to a line if test1 is greater than test2
function JMPNG(line, test1, test2) {}
function GetHeartPos(VarNameX, VarNameY) {} // stores the heart position in variables of your choosing

There's a built-in check to prevent infinite loops from freezing up the game. It counts how many rows it has gone through since the last non-zero wait period. If it gets too high, the attack will be aborted.

There may be more intended functions that I forgot about. I kinda just made shit up as I went along. There are also functions, which, while you are technically able to call them, you really shouldn't.

@HuntertheWhale
Copy link
Author

HuntertheWhale commented Apr 7, 2018 via email

@RepeatGitHub
Copy link

Screen Shot 2019-04-15 at 7 55 43 AM

Is there something I'm missing? I'm trying to have the Gaster Blaster go right above the player.

@Jcw87
Copy link
Owner

Jcw87 commented Apr 16, 2019

This isn't supposed to be a support thread, but you need to remove the '$' from the arguments of GetHeartPos. When it runs, anything that starts with '$' is blindly replaced with the value of the variable. You need to tell the function what variable names to update, not what the current values of those variables are.

@iKNIFEu
Copy link

iKNIFEu commented Apr 14, 2020

@Jcw87 Sorry for disturbance, but how to make the gasterblaster point at Player?

@Jcw87
Copy link
Owner

Jcw87 commented Apr 15, 2020

Again, not a support thread. Grab the heart position using GetHeartPos and plug it in as the EndX and EndY variables for the gaster blaster. There are existing attacks that do exactly this, and they are the reason why GetHeartPos was added.

@iKNIFEu
Copy link

iKNIFEu commented Apr 15, 2020

Oh! I was dumb enough. Thank you for reminding me that EndX and EndY exists :)

@iKNIFEu
Copy link

iKNIFEu commented Apr 18, 2020

@Jcw87 sorry for disturbing you (again). But the blasters point right instead of the player heart.
I mean, the angle should point at the player right?
Or did I do something wrong?

@ChaboCode
Copy link
Contributor

@HuntertheWhale the chicken is in the oven #68

@thelift112
Copy link

@Jcw87 sorry for disturbing you (again). But the blasters point right instead of the player heart. I mean, the angle should point at the player right? Or did I do something wrong?

Did you make sure the angle is right? angle 0 is right angle 90 is down angle 180 is left and angle 270 is up, and 360 is back to right.

@thelift112
Copy link

@Jcw87 sorry for disturbing you (again). But the blasters point right instead of the player heart. I mean, the angle should point at the player right? Or did I do something wrong?

Using the angle function you can do
0,ANGLE,direction,$EndX,$EndY,$HeartX,$HeartY,
0,GasterBlaster,size,X,Y,$EndX,$EndY,$direction,spintime,attacktime
and now it should spawn an blaster looking right at the soul.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants