Discuss Scratch
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
Hi! Im trying to make an FNF engine for other players to mod off of but currently while trying to set up an accuracy system it stumped me, when I try making it, it has a bias for the block on top. Here is my code:
https://i.ibb.co/c6GGSmD/Screenshot-2022-07-17-213911.png
https://i.ibb.co/dW6W3dj/Screenshot-2022-07-17-213712.png
https://i.ibb.co/fr0PnWf/coding-1.png
https://i.ibb.co/c6GGSmD/Screenshot-2022-07-17-213911.png
https://i.ibb.co/dW6W3dj/Screenshot-2022-07-17-213712.png
https://i.ibb.co/fr0PnWf/coding-1.png
- Mr_Woomy
-
Scratcher
500+ posts
FNF Accuracy system
Hi! Im trying to make an FNF engine for other players to mod off of but currently while trying to set up an accuracy system it stumped me, when I try making it, it has a bias for the block on top. Here is my code:I’m also making a fnf engine lol!
https://i.ibb.co/c6GGSmD/Screenshot-2022-07-17-213911.png
https://i.ibb.co/dW6W3dj/Screenshot-2022-07-17-213712.png
https://i.ibb.co/fr0PnWf/coding-1.png
If you want me to, i can help if you’d like
I have my own (different to other games) accuracy which detects how much notes you hit compared how much spawned
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
define ?Scoring
forever
if <[ ?] contains (round (y position)) ?> then
set [ arrowInSlots] to [1]
if <(hit) = [1]> then
broadcast [ favorBlueKid]
broadcast [ ?]
end
end
end
define AccuracySystem
sickScoring
goodScoring
badScoring
when green flag clicked
forever
if <key [ ? Arrow] pressed?> then
if <(arrowInSlots) = [1]> then
set [ hit] to [1]
broadcast [ favourBlueKid]
switch costume to [ ?]
play sound [ recording #?] until done
set [ hit] to [0]
else
set [ hit] to [1]
broadcast [ favourEnemy]
broadcast [ ew]
switch costume to [ ?]
play sound [ recording #?] until done
set [ hit] to [0]
end
end
end
end
Last edited by FlameLive (July 18, 2022 04:34:08)
- cIoudyness
-
Scratcher
500+ posts
FNF Accuracy system
at this point it’s probably just worth dropping the turbowarp link
here’s another way to check a note accuracy that you as a great coder could implement however you wanted:
(warning that I know nothing about fnf this is just what seems like an ok coding idea)
here’s another way to check a note accuracy that you as a great coder could implement however you wanted:
(warning that I know nothing about fnf this is just what seems like an ok coding idea)
set [note y v] to [69] // item ( ) of a note list would be a better input but yknow
set [difference v] to ([abs v] of ((note y) - (y position)))
if <(difference) < (10)> then
if <(difference) < (5)> then
hmm kinda good :: sound
else
meh :: operators
end
else
ur bad :: sensing
end
Last edited by cIoudyness (July 18, 2022 04:34:47)
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
define AccuracySystemit has a bias for sick scoring, if i put good scoring at top it bias for it
sickScoring
goodScoring
badScoring
- Mr_Woomy
-
Scratcher
500+ posts
FNF Accuracy system
at this point it’s probably just worth dropping the turbowarp linkAnother way could be using a “this sprite only” note y then for the clone could be setting note y to y forever or just using y position block
here’s another way to check a note accuracy that you as a great coder could implement however you wanted:
(warning that I know nothing about fnf this is just what seems like an ok coding idea)set [note y v] to [69] // item ( ) of a note list would be a better input but yknow
set [difference v] to ([abs v] of ((note y) - (y position)))
if <(difference) < (10)> then
if <(difference) < (5)> then
hmm kinda good :: sound
else
meh :: operators
end
else
ur bad :: sensing
end
Nvm completely forgot what the code does
Last edited by Mr_Woomy (July 18, 2022 04:37:08)
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
Forgot to mention but the first two pieces of code are placed inside the arrow and the last piece of code is placed within the blue haired kiddefine ?Scoring
forever
if <[ ?] contains (round (y position)) ?> then
set [ arrowInSlots] to [1]
if <(hit) = [1]> then
broadcast [ favorBlueKid]
broadcast [ ?]
end
end
enddefine AccuracySystem
sickScoring
goodScoring
badScoringwhen green flag clicked
forever
if <key [ ? Arrow] pressed?> then
if <(arrowInSlots) = [1]> then
set [ hit] to [1]
broadcast [ favourBlueKid]
switch costume to [ ?]
play sound [ recording #?] until done
set [ hit] to [0]
else
set [ hit] to [1]
broadcast [ favourEnemy]
broadcast [ ew]
switch costume to [ ?]
play sound [ recording #?] until done
set [ hit] to [0]
end
end
end
end
- abcde1234qwe
-
Scratcher
500+ posts
FNF Accuracy system
Honestly, I think you can just use a distance block.
if <> then//Your code that detects if a key is pressed or if it's out of the screen.
if <(distance to [note v]) < [amount]> then
perfect::grey
else
if <(distance to [note v]) < [amount]> then
good::grey
else
if <(distance to [note v]) < [amount]> then
ok::grey
else
. . .//etc
end
end
end
end
Last edited by abcde1234qwe (July 18, 2022 05:01:22)
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
Ok nevermind I just fixed my code and it works wonders
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
https://turbowarp.org/715201933?size=640x360 Heres the final product! thanks for the help.
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
Honestly, I think you can just use a distance block.See, heres the thing, if it was as easy as distance blocks I would've done it but since its a clone based system where the slots for arrows are cloned and so are the arrows I can't use distance blocksif <> then//Your code that detects if a key is pressed or if it's out of the screen.
if <(distance to [note v]) < [amount]> then
perfect::grey
else
if <(distance to [note v]) < [amount]> then
good::grey
else
if <(distance to [note v]) < [amount]> then
ok::grey
else
. . .//etc
end
end
end
end
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
https://turbowarp.org/715201933?size=640x360 Heres the final product! thanks for the help.nevermind, the system is extremely janky and barely works
- cIoudyness
-
Scratcher
500+ posts
FNF Accuracy system
exactly so use my wonderful code!!Honestly, I think you can just use a distance block.See, heres the thing, if it was as easy as distance blocks I would've done it but since its a clone based system where the slots for arrows are cloned and so are the arrows I can't use distance blocksif <> then//Your code that detects if a key is pressed or if it's out of the screen.
if <(distance to [note v]) < [amount]> then
perfect::grey
else
if <(distance to [note v]) < [amount]> then
good::grey
else
if <(distance to [note v]) < [amount]> then
ok::grey
else
. . .//etc
end
end
end
end
lists can hold the note y positions and from there I’m basically finding distances. I’m far too lazy to implement it myself but obviously you’re an awesome enough coder and have already gotten this far so
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
Same issue occouredexactly so use my wonderful code!!Honestly, I think you can just use a distance block.See, heres the thing, if it was as easy as distance blocks I would've done it but since its a clone based system where the slots for arrows are cloned and so are the arrows I can't use distance blocksif <> then//Your code that detects if a key is pressed or if it's out of the screen.
if <(distance to [note v]) < [amount]> then
perfect::grey
else
if <(distance to [note v]) < [amount]> then
good::grey
else
if <(distance to [note v]) < [amount]> then
ok::grey
else
. . .//etc
end
end
end
end
lists can hold the note y positions and from there I’m basically finding distances. I’m far too lazy to implement it myself but obviously you’re an awesome enough coder and have already gotten this far so
- FlameLive
-
Scratcher
17 posts
FNF Accuracy system
My issue is the score indicators are blasting multiple times when it should be once per click of a buttonSame issue occouredexactly so use my wonderful code!!Honestly, I think you can just use a distance block.See, heres the thing, if it was as easy as distance blocks I would've done it but since its a clone based system where the slots for arrows are cloned and so are the arrows I can't use distance blocksif <> then//Your code that detects if a key is pressed or if it's out of the screen.
if <(distance to [note v]) < [amount]> then
perfect::grey
else
if <(distance to [note v]) < [amount]> then
good::grey
else
if <(distance to [note v]) < [amount]> then
ok::grey
else
. . .//etc
end
end
end
end
lists can hold the note y positions and from there I’m basically finding distances. I’m far too lazy to implement it myself but obviously you’re an awesome enough coder and have already gotten this far so
- abcde1234qwe
-
Scratcher
500+ posts
FNF Accuracy system
See, heres the thing, if it was as easy as distance blocks I would've done it but since its a clone based system where the slots for arrows are cloned and so are the arrows I can't use distance blocksI didn't see the code so didn't know they were clones, my bad.
I was thinking you could use lists.
Note: This has not been tested.
(Column 1 :: list)//For all sprites.
(Column 2 :: list)//For all sprites.
(Column 3 :: list)//For all sprites.
(Column 4 :: list)//For all sprites.
(clone?)//For this sprite only in the player arrow sprite.
(clone #)//For this sprite only in the player arrow sprite.
(largest y pos)//For this sprite only in the arrow slot hold sprite.
(index)//For this sprite only in the arrow slot hold sprite.
when green flag clicked//In the player arrow sprite.
set [clone # v] to [0]
set [clone? v] to [false]
Add Items To List::more blocks//Run without screen refresh.
. . .//Other code.
define Add Items To List
delete all of [Column 1 v]::list
delete all of [Column 2 v]::list
delete all of [Column 3 v]::list
delete all of [Column 4 v]::list
repeat (300)
add [-999] to [Column 1 v]
add [-999] to [Column 2 v]
add [-999] to [Column 3 v]
add [-999] to [Column 4 v]
end
define Create Arrow (Arrow Type) <Long Note?>
change [clone # v] by (1)//In the player arrow sprite.
//Make the below for the other columns.
when I start as a clone//In the player arrow sprite.
set [clone? v] to [true]
. . .//Other code.
replace item (clone #) of [Column 1 v] with [-999]//Add this before deleting the clone.
delete this clone
if <key [left arrow v] pressed?> then//Wherever it detects if a key is pressed.
broadcast [Add Column 1 Pos v]
end
when I receive [Add Column 1 Pos v]//In the player arrow sprite.
if <(clone?) = [true]> then//Detects if it's a clone.
replace item (clone #) of [Column 1 v] with (y position)
else
wait (0) secs
broadcast [Check Position Column 1 v]
end
when I receive [Check Position Column 1 v]
set [largest y pos v] to [-9999]
set [index v] to [0]
repeat (length of [Column 1 v] :: list)
change [index v] by (1)
if <(item (index) of [Column 1 v] :: list)> (largest y pos)> then
set [largest y pos v] to (item (index) of [Column 1 v] :: list)
end
end
if <> then
accuracy code goes here::grey
else
Last edited by abcde1234qwe (July 19, 2022 04:27:05)
- meme9_tud
-
Scratcher
1 post
FNF Accuracy system
use notes hitted - misses / notes hitted x 100
Last edited by meme9_tud (Oct. 17, 2022 14:04:55)