JordanSantiagoYT / FNF-JS-Engine

JS Engine is basically Psych Engine but with (almost) no botplay lag and NEW features!
Apache License 2.0
42 stars 28 forks source link

Problem with random engine text #495

Closed mihaillov closed 1 month ago

mihaillov commented 1 month ago

Describe your problem here. If you are modding, please try testing your problem in a clean version of the engine instead, this ensures the problem is actually caused by the engine itself. Also, if you're using an older version of JSE, please try the latest action build in the Actions tab or the latest release build. The issue has probably been fixed since that version. Oh yeah, and also be sure to check the pinned 'JS Engine: Known Issues' issue, to double check if your issue hasn't already been found!

i want to modify engine text,to make the random words of playstate(Like og dave and bambi) There is code: var randomThingy:Int = FlxG.random.int(0, 34); var engineName:String = 'stupid'; switch(randomThingy) { case 0: engineName = 'Dave '; case 1: engineName = 'Bambi '; case 2: engineName = 'Tristan '; case 3: engineName = 'Bandu '; case 4: engineName = 'Brobgonal '; case 5: engineName = 'Hortas '; case 6: engineName = 'Eye '; case 7: engineName = 'Corn '; case 8: engineName = 'Sus '; case 9: engineName = 'Bambom '; case 10: engineName = 'Baimer '; case 11: engineName = 'TPTF '; case 12: engineName = 'Manny '; case 13: engineName = 'Joolie '; case 14: engineName = 'Unity '; case 15: engineName = 'Banjex '; case 16: engineName = 'Axniety '; case 17: engineName = 'Pomni '; case 18: engineName = 'Caine '; case 19: engineName = 'Zooble '; case 20: engineName = 'Kinger '; case 21: engineName = 'Jeremy '; case 22: engineName = 'Manbi '; case 23: engineName = 'New R '; case 24: engineName = 'Tank '; case 25: engineName = 'Ami '; case 26: engineName = 'Moscow '; case 27: engineName = 'Shadowhyper '; case 28: engineName = 'Seraf '; case 29: engineName = 'OS '; case 30: engineName = 'Kade '; case 31: engineName = 'DenpaEx '; case 32: engineName = 'Psych '; case 33: engineName = 'Hortas Reborn '; case 34: engineName = 'REDACTED '; }

    if (ClientPrefs.watermarkStyle == 'Vanilla') {
        EngineWatermark = new FlxText(4,FlxG.height * 0.9 + 50,0,"", 16);
        EngineWatermark.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, OUTLINE,FlxColor.BLACK);
        EngineWatermark.scrollFactor.set();
        add(EngineWatermark);
        EngineWatermark.text = SONG.song + " " + CoolUtil.difficultyString() +  | engineName +  " Engine v " + MainMenuState.psychEngineExpungasVersion;
    }
    if (ClientPrefs.watermarkStyle == 'Forever Engine') {
        EngineWatermark = new FlxText(0, FlxG.height - 30, 0, "engineName + Engine v" + MainMenuState.psychEngineExpungasVersion, 16);
        EngineWatermark.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, OUTLINE,FlxColor.BLACK);
        EngineWatermark.updateHitbox();
        EngineWatermark.x = FlxG.width - EngineWatermark.width - 5;
        EngineWatermark.scrollFactor.set();
        add(EngineWatermark);
    }
    if (ClientPrefs.watermarkStyle == 'JS Engine') {
        EngineWatermark = new FlxText(4,FlxG.height * 0.1 - 70,0,"", 15);
        EngineWatermark.setFormat(Paths.font("vcr.ttf"), 18, FlxColor.WHITE, RIGHT, OUTLINE,FlxColor.BLACK);
        EngineWatermark.scrollFactor.set();
        if (ClientPrefs.downScroll) EngineWatermark.y = (FlxG.height * 0.9 + 50);
        add(EngineWatermark);
        EngineWatermark.text = "You are now playing " + SONG.song + " on " + CoolUtil.difficultyString() +  ! (engineName + " Engine v " + MainMenuState.psychEngineExpungasVersion + ")";
    }
    if (ClientPrefs.watermarkStyle == 'Dave Engine') {
        EngineWatermark = new FlxText(4,FlxG.height * 0.9 + 50,0,"", 16);
        EngineWatermark.setFormat(Paths.font("comic.ttf"), 16, FlxColor.WHITE, RIGHT, OUTLINE,FlxColor.BLACK);
        EngineWatermark.scrollFactor.set();
        add(EngineWatermark);
        EngineWatermark.text = SONG.song;
    }

Are you modding a build from source or with Lua?

Source

What is your build target?

Windows x64

Did you edit anything in this build? If so, mention or summarize your changes.

PlayState.hx

mihaillov commented 1 month ago

the error is:source/PlayState.hx:1503: characters 76-77 : Expected expression

moxie-coder commented 1 month ago

the error is:source/PlayState.hx:1503: characters 76-77 : Expected expression

can you show what’s on that line?

mihaillov commented 1 month ago
        EngineWatermark.text = SONG.song + " " + CoolUtil.difficultyString() +  | engineName +  " Engine v " + MainMenuState.psychEngineExpungasVersion;(Engine name is randomized text thingy)
mihaillov commented 1 month ago

huh

moxie-coder commented 1 month ago
      EngineWatermark.text = SONG.song + " " + CoolUtil.difficultyString() +  | engineName +  " Engine v " + MainMenuState.psychEngineExpungasVersion;(Engine name is randomized text thingy)

here I made it better

EngineWatermark.text = '${SONG.song} {CoolUtil.difficultyString()} | $engineName Engine v ${MainMenuState.psychEngineExpungasVersion}';
mihaillov commented 1 month ago

this is works!

moxie-coder commented 1 month ago

great 👍🏻