wiki/modding/scripting/playstate-scripts/events-notetypes-scripts #33
Replies: 6 comments 4 replies
-
|
Could there be some sort of strumline movement event script? That'd help a lot with the mod I'm working on. |
Beta Was this translation helpful? Give feedback.
-
|
is it possible to play an animation using the notetype thing, but for another character added in using the stage? |
Beta Was this translation helpful? Give feedback.
-
|
I copy and pasted the code for a note type I made myself, but when testing it in-game the second I hit one the game crashes with "Null Object Reference." |
Beta Was this translation helpful? Give feedback.
-
|
I think it would be useful if the info on note types specified a bit more, such as the fact that you can use these functions: |
Beta Was this translation helpful? Give feedback.
-
|
How do i make a custom note that continuously drains the players health when pressed? (Like the poison mushroom notes from Mario's Madness) |
Beta Was this translation helpful? Give feedback.
-
|
since you mentioned mario madness, im going to assume Codename.
The script for a drain note would be:
import flixel.tweens.FlxTween;
var drainAmount:Int = 0.6;
function onNoteCreation(e)
{
if(e.noteType == "your drain note here")
{
e.noteSprite = "game/notes/types/your drain note here";
}
}
function onPlayerHit(e)
{
if(e.noteType == "your drain note here")
{
trace("draining health!");
drainHealth(drainAmount);
trace(health);
}
}
function onPlayerMiss(e)
{
if(e.noteType == "Your drain note here")
{
e.cancel(true);
e.note.strumLine.deleteNote(e.note);
}
}
function drainHealth(amount:Int)
{
health = FlxTween.num(health, drainAmount, 15.0, { ease:
FlxEase.quadOut }, function(val:Float) {
health = val;
});
trace("New Hp Value: " + health);
}
As for how to make the healthbar change colors and the icon go to the
losing one when you press it i dont know that yet. but this is the base
code for a drain note.
…On Sun, Oct 5, 2025 at 2:10 PM Reddragon6880 ***@***.***> wrote:
How do i make a custom note that continuously drains the players health
when pressed? (Like the poison mushroom notes from Mario's Madness)
—
Reply to this email directly, view it on GitHub
<#33 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXWEL55VFHHM7EYJHZLKURT3WFNKJAVCNFSM6AAAAABPZ22IOKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTINJZHAZTMNI>
.
You are receiving this because you commented.Message ID:
<CodenameCrew/codename-website/repo-discussions/33/comments/14598365@
github.com>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
wiki/modding/scripting/playstate-scripts/events-notetypes-scripts
This page explains how to use Events/Notetype Scripts in your mod!
https://codename-engine.com/wiki/modding/scripting/playstate-scripts/events-notetypes-scripts
Beta Was this translation helpful? Give feedback.
All reactions