FNF-CNE-Devs / CodenameEngine

awesome fnf engine :D
Apache License 2.0
248 stars 166 forks source link

Bug Report: Functions stopped working in the middle of making a song #247

Closed PetscopF closed 6 months ago

PetscopF commented 6 months ago

Which target are you using?

[x ] Windows [ ] Linux [ ] Mac

Explain your issue

I was making a song playable in Codename (more specifically, a chart of a remix) and I decided to add some little mechanics, stuff like taking away bits of health when the opponent hits a note as an example. However, after finishing up a bit of a portion of the whole chart, some of the functions just... stopped running. Not even reverting to an updated Codename version or reverting the script itself to an older version seems to help. I'm not even sure if it's the chart itself. This affects just the functions, for example onDadHit; the other parts of the script work just fine. This affects both the chart editor and regular play as well.

Is there something I accidentally changed, or was it something else?

NexIsDumb commented 6 months ago

hm could you send here the script(s) and a video maybe?

PetscopF commented 6 months ago

Sure. The script itself should go in the/any song's scripts folder if it's gonna be tested, as that is how I made it to be:

https://files.catbox.moe/nkkvcx.hx - The script. Github doesn't seem to want to use the code blocks feature properly so I'm sending it through a catbox link. The functions worked before I got a bit into the chart.

The song itself is a remix of All Stars, titled ENDGAME, by Noichi.

https://streamable.com/h076xc

Frakits commented 6 months ago

your script is formatted incorrectly the correct format is:

import funkin.game.PlayState;
import FlxTween;

// trace("PISTACHIO M READY!!");

function update(elapsed) {

    if (curStep == 880) {
        trace("NOW YOU'RE PLAYING WITH POWER.");
        health = 1;
    };

    // ACT 2

    if (curStep >= 912) {
        health -= 0.1 * elapsed;
    }
}

function onDadHit(event) {
    if (curStep <= 912) {
        if (health >= 0.028) event.healthGain = 0.014;
    };
}
PetscopF commented 6 months ago

Ah, looks like it works now. I think I assumed it would just work since it was in the update function, but it looks like it was actually supposed to be outside of it. Thanks 👍