Skip to content

Throwing off some shade

Compare
Choose a tag to compare
@RhenaudTheLukark RhenaudTheLukark released this 05 Jul 21:40
· 15 commits to master since this release

So I heard people around these parts have been waiting to use shaders and stuff in CYF.
It's a thing many people asked for for a very long time now, but it's something we can't really add easily in a Unity project...
...nah, just joking. Give a huge thanks to @TheEternalShine and @WD200019 for their hard work!

IMPORTANT NOTE: If you're upgrading from v0.6.4, please copy the new Default AND Mods folders over your current ones.

Scroll to the bottom for downloads.

Major Changes:

Shaders
  • The big new feature of this version is shaders! You can use shaders created in Unity ShaderLab and apply them to any sprite object in your mod, even the entire screen itself! Full details and explanation are in the documentation. (thanks go to @TheEternalShine on GitHub/Discord for this feature!)
The Discord Object
  • Discord now has rich presence integration with CYF! This can be toggled in CYF's Options menu. It will display various things like what mod and encounter you are playing, how long you have been playing, as well as messages for in the Overworld. And the status properties can be modified with Lua! (thanks go to CMD_God#0490 on Discord for this feature!)
Engine
  • All warning messages that you'd see in the debugger are now hidden by default in retrocompatibility mode, as they were in Unitale
Battle Scene
  • Updated the calculation for if the player can successfully flee from battle. It now follows Undertale - 50% chance to flee on turn 1, + 10% for every turn spent in battle. This was verified accurate by decompiling Undertale's code
Misc. Functions
  • Added the new function EnableDebugger, which can be used to forcefully toggle the debugger's functionality, and force-hide it!
The Player Object
  • Added a fourth argument to Player.Hurt, which can be used to disable sound created by the function. Useful for, say, starting the player's invincibility frames silently
The Audio and NewAudio objects
  • Reverted the changes made to several audio functions in CYF v0.6.4, because new users did not understand how to use it at all. They will display an error screen if an audio file was not loaded successfully. This includes:

    • Audio.LoadFile

    • Audio.PlaySound

    • NewAudio.PlayMusic

    • NewAudio.PlaySound

    • NewAudio.PlayVoice

If you still wish to check if the file was loaded successfully, use the Lua function pcall.

The Text Object
  • Added Text.SetAnchor (NOT Pivot) for simpler use with parenting

  • Added Text.GetLetters(), which generates a table full of sprite objects you can use to manipulate a text object's individual letters!

  • Text objects now call the new Game Event OnTextAdvance when advancing, if possible

Game Events
  • The Game Event BeforeDamageValues now can have an argument which represents the amount of damage the enemy is about to take, but before the damage is applied, unlike in HandleAttack

  • Added the Game Event OnTextAdvance, which is run whenever a text object advances its text, in whatever script it was created in

Sprites & Layers
  • CreateLayer now returns a boolean representing whether the layer was created successfully, instead of erroring
The Misc Object
  • Misc.WindowWidth and Misc.WindowHeight are no longer Windows-only! They can be used to calculate the amount of pixels that are shown inside CYF, including in wide fullscreen, as well as the level of scaling applied to CYF when being drawn to the window.

  • The byte editing mode added in CYF v0.6.4 has been replaced with the most direct solution possible. File.encoding has been removed, as well as the "b" file opening mode. In its place are the new functions File.ReadBytes() and File.WriteBytes()!

The Overworld
  • Added Map.GetName() to the Overworld, used for getting the name of the active map

  • Added Map.GetSaveName(mapName) to the Overworld, used for retrieving the save point text for a given map


Bug Fixes:

Engine
  • Fixed engine screen resolution being set to 1x1px fullscreen on first launch on Linux (#66)

  • Properly show an error screen for all XML errors while loading fonts. Up to now, if such an error were encountered, the engine would try to continue battle but with some assets mysteriously not loaded.

  • Fixed the EncounterStarting function still being called, even if an error occured in a monster script and the battle should have ended

Battle scene
  • (tried to) Fix "FIGHT"/"ACT"/"ITEM"/"MERCY" buttons blurring on systems with older graphics cards

  • Fix object buildup when enemies die, or when calling sprite.Dust

  • Fixed the chance for successfully fleeing a battle actually being 33% instead of 50%

  • Fixed bug: creating a projectile with the sprite name "Text" (case sensitive) would cause it to parent to the Debugger, and hide and show with it

  • Fixed dust particles (from sprite.Dust and killing enemies) staying on screen for 1 frame on battle end

  • Fixed the particles from sparing monsters not unloading

Monsters
  • If a monster's font variable points to an invalid font, the default monster font will now be used instead of erroring
The Player
  • Fixed the player being unable to level up naturally to LV 20 at a battle's end, even if they reached 99999 XP

  • You are now finally able to change the player's stats before EncounterStarting with no issues

Camera Movement
  • Fixed the player being offset based on the camera's position whenever a game over screen starts (since CYF v0.6.2)

  • Fixed Misc.StopShake() having no effect (since CYF v0.6.4)

  • Fixed the hitbox debugger displaying the player's hitbox in the wrong location if the camera is moved

Text Commands
  • Fixed the [health:x,y] text command not updating the health bar when used in battle

  • Fix no error screen showing, leading to engine freezes and invisible monster text bubbles, when trying to load an invalid font in some cases

  • Fixed the [lettereffect] text command persisting after a line of text in the Overworld and in battle. It now resets to "none" after every line of text.

  • Fixed [lettereffect] not applying to letters that get skipped over by the player, with the [instant] and [instant:allowcommand] commands, and text.SkipLine()

  • Fixed [lettereffect]'s version of "twitch" taking an absurd 5 seconds (at minimum) for each letter to start twitching, per letter

  • Fixed [name] disappearing entirely instead of displaying the player's name as intended

Text Objects
  • Fixed engine error when calling Text.SkipLine() if script did not contain playerskipdocommand = true (since CYF v0.6.4)

  • Fixed engine error if using Text.GetTextWidth() while the text object is given characters not supported by the font file. Also applies to the automatic line break system in battles and in the Overworld (since CYF v0.6.4)

  • Fixed 0.6.4's system of moving encountertext up 9 pixels continuing to apply in the states ENEMYSELECT, ITEMMENU and MERCYMENU (since CYF v0.6.4)

  • Fixed strange behavior involving Text.Remove() and a resulting engine error

  • Fixed Text.layer throwing an engine error most of the time when read

The Inventory Object
  • The Bisicle now properly gets replaced by a Unisicle on use (thanks go to @heartlessmushroom on Github/Discord for this fix!)

  • Fixed being able to exceed 8 items in the inventory if you actually give it 10 or more items, as opposed to just 9

Sprite Masking
  • Fixed a bug where removing bullets could cause future bullets to be missing their mask components, and error when attempting to use bullet.sprite.Mask (since CYF v0.6.4)

  • Fixed an error screen when trying to use Player.sprite.Mask (since CYF v0.6.4)

The Overworld
  • Fixed a 1-frame error that happens when an event stops moving during the same frame as the map changing (since CYF v0.6.4)

  • Fixed sprite.animationpaused, sprite.currentframe, sprite.currenttime, sprite.totaltime, and sprite.animationspeed being unusable on Overworld event sprites (since CYF v0.6.4)

  • Fixed the player's saved play time carrying over to a new game when the player chooses "Reset" on the continue screen (since CYF v0.6.4)

  • Fixed the Overworld text box being potentially covered up by Screen.SetTone and similar functions, when selecting "Use" on an item in the inventory

  • Fixed strange and buggy collision on the big snowy map in which the player could get stuck (demo: https://i.gyazo.com/e15c89fa9f077b2798fa9e981e870335.mp4)

  • Fixed a bug causing the Overworld's item box UI to display all of its sprites and text only within the 640x480 area at the bottom left corner of any map that has camera scrolling.

  • Fixed animated mugshots remaining active in future text boxes if they hadn't yet stopped their animation (such as by skipping the end of text with [next])

  • Correctly reset [charspacing] and [linespacing] in the Overworld's text box after a sequence of dialogue/text boxes ends

  • Fixed one empty game object at a time building up and staying active after every battle in the Overworld

  • Optimized the internal Lua code used by CYF events to remove a massive if/elseif block (99 conditions) scanned through EVERY time you run a function from a CYF overworld object (like General.Wait and Screen.DispImg)