Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Slashes Creating Too Many Broadcasts
- WofyWritesHugeRPBios
-
100+ posts
Slashes Creating Too Many Broadcasts
I have been working on another route for this game that occurs when you die more than 11 times and continue to try. A unique attack in this route are weapon slash's that I used from another game I made. For some odd reason, it functions as normal, but after the first 1-2 slashes it starts repeating the broadcast that causes the slash animation as well as the broadcast that causes the warning before the attack appears. I've been looking around, and I can't seem to figure out the cause of this. I have a Local Variable set up to identify if a clone is the original Sprite or a clone that makes sure the clones act out only their clone code and no broadcasts.
- Code_Weegee
-
100+ posts
Slashes Creating Too Many Broadcasts
remember, clones accept broadcasts as though they are individual sprites, so if you send a broadcast to a sprite with a clone, both the sprite and its clone will respond with the same code.
- WofyWritesHugeRPBios
-
100+ posts
Slashes Creating Too Many Broadcasts
remember, clones accept broadcasts as though they are individual sprites, so if you send a broadcast to a sprite with a clone, both the sprite and its clone will respond with the same code.
All clones set the their personal local variable called “AreYouAClone”? To True when they are created. The broadcast that seems to be repeated can only function if the “AreYouAClone” variable is false, so the warnings wouldn’t be creating themselves as a clone. (I made sure it was a Local Variable again before writing this).
- isolato
-
12 posts
Slashes Creating Too Many Broadcasts
Which section of your code isn't working the way you're wanting it to?
- WofyWritesHugeRPBios
-
100+ posts
Slashes Creating Too Many Broadcasts
Which section of your code isn't working the way you're wanting it to?
Sorry for the super late response ;-;
The code in the Projectiles Sprite that is relative to the Slash costume isn’t functioning correctly, this is the full info:
this game that occurs when you die more than 11 times and continue to try. A unique attack in this route are weapon slash's that I used from another game I made. For some odd reason, it functions as normal, but after the first 1-2 slashes it starts repeating the broadcast that causes the slash animation as well as the broadcast that causes the warning before the attack appears. I've been looking around, and I can't seem to figure out the cause of this. I have a Local Variable set up to identify if a clone is the original Sprite or a clone that makes sure the clones act out only their clone code and no broadcasts.I have been working on another route for
- WofyWritesHugeRPBios
-
100+ posts
Slashes Creating Too Many Broadcasts
Bump ;-; (Also I have discovered that the Slash's are compatible with empty projects, so it probably isn't something to do with the Slash code itself, but something interfering with that code. I do have bone code running at the same time in the same sprite, by the way.)
- isolato
-
12 posts
Slashes Creating Too Many Broadcasts
Can you point me in the direction of the code that utilizes the slash animation in your project?
Which sprite holds the code for broadcasting the slashes, which sprite(s) hold the ‘when I receive slash broadcast’ coding?
Which sprite holds the code for broadcasting the slashes, which sprite(s) hold the ‘when I receive slash broadcast’ coding?
- WofyWritesHugeRPBios
-
100+ posts
Slashes Creating Too Many Broadcasts
The “Projectile” sprite holds the code for the Slash’s - It creates the Slash that does damage and tells the “Warning” sprite to flash where it is in order to warn the player. The “Warning” Sprite holds the code for the animation that plays before the slash shows, and the “Projectile” sprite tells itself when to start slashing. As a bonus, when the “SansBody_Sprite” receives the broadcast that tells the “Warning” to appear, it plays a slash animation as well. Can you point me in the direction of the code that utilizes the slash animation in your project?
Which sprite holds the code for broadcasting the slashes, which sprite(s) hold the ‘when I receive slash broadcast’ coding?
- KaaBEL_sk
-
100+ posts
Slashes Creating Too Many Broadcasts
(#10)I can't see the Pojectiles sprite in there, it is likely you updated it meanwhile, but the changelog doesn't say when was the last update.I didn't test the bug case yet though. What's the fastest way to get there?
The “Projectile” sprite holds the code for the Slash’s - It creates the Slash that does damage and tells the “Warning” sprite to flash where it is in order to warn the player. The “Warning” Sprite holds the code for the animation that plays before the slash shows, and the “Projectile” sprite tells itself when to start slashing. As a bonus, when the “SansBody_Sprite” receives the broadcast that tells the “Warning” to appear, it plays a slash animation as well.
Last edited by KaaBEL_sk (Feb. 18, 2025 22:25:34)
- KaaBEL_sk
-
100+ posts
Slashes Creating Too Many Broadcasts
Now I aready lost track of the losses and I am not sure when and how I should expect the slash something (don't even know what that means).
There is no “Projectile” sprite, found only “BlueProjectile”, “ProjectileAttack” and “DebugMode” that isn't mentioned nor documented the littlest which I find a bit iteresting since we are asked to debug the game.
By lurking through the code I found the JUDGMENT_Encounter broadcast setting this sprite only “AreYouClone?” variable of “ProjectileAttack” to False, didn't trace down where everywhere it gets broadcasted, but it's at least SUSpicious code to me.
There is no “Projectile” sprite, found only “BlueProjectile”, “ProjectileAttack” and “DebugMode” that isn't mentioned nor documented the littlest which I find a bit iteresting since we are asked to debug the game.
By lurking through the code I found the JUDGMENT_Encounter broadcast setting this sprite only “AreYouClone?” variable of “ProjectileAttack” to False, didn't trace down where everywhere it gets broadcasted, but it's at least SUSpicious code to me.
- WofyWritesHugeRPBios
-
100+ posts
Slashes Creating Too Many Broadcasts
Now I already lost track of the losses and I am not sure when and how I should expect the slash something (don't even know what that means).
There is no “Projectile” sprite, found only “BlueProjectile”, “ProjectileAttack” and “DebugMode” that isn't mentioned nor documented the littlest which I find a bit interesting since we are asked to debug the game.
By lurking through the code I found the JUDGMENT_Encounter broadcast setting this sprite only “AreYouClone?” variable of “ProjectileAttack” to False, didn't trace down where everywhere it gets broadcasted, but it's at least SUSpicious code to me.
The Suspicious code you mentioned functions as normal, by the way - ProjectileAttack was a variable I made earlier for another glitch to avoid the first attack of the game being set off multiple times, and “AreYouAClone” is a local variable that is set to True when a clone is created and is set to False at the beginning so that the main Sprite isn't counted as a clone.
The “Slash Animation” I mentioned is a flashing Red and Yellow line that ends with a damaging red rectangular chunk appearing where the warning is. The glitch is that the Warning appears where it's supposed to, like normal, but a bunch of the same warnings also appear with it. The “SansSprite_Body” Sprite also performs an animation of switching costumes during the warning.
I'm SO sorry, Scratch must have bugged or something, I didn't get any notifications. . . The quickest way is a scrapped code in the “Black screen” Sprite that sets the deaths to 12 10 times when it receives JUDGEMENT_Encounter (Which is the Broadcast that starts the whole game and hides the Main Menu). I said “Projectile”, but I meant “ProjectileAttack), sorry ;-;. Also, ”DebugMode“ is a variable that sets whether you take dmg or not, I use it while I'm testing something and don't want to have to dodge the attacks, thus Debugging in ”DebugMode“. It's set in the Main Menu through methods that don't really matter in this case. Also, I forgot to say, but the ”BlackScreen“ Sprite broadcasts JUDGEMENT_Encounter when it receives ”GameStartAnim“ from ”Play_MainMenuButton". Sorry for the late reply again ;-;
Last edited by WofyWritesHugeRPBios (Feb. 19, 2025 00:05:08)
- KaaBEL_sk
-
100+ posts
Slashes Creating Too Many Broadcasts
No need for appologies ; ) I am just tryign to have fun with scr… in TurboWarp, it's not our duty. I just found that it works differently then yesterday, are you working directly on the remote project or do you just update when you are done with changes in local .sb3 file on your device?
Btw, I did not get any notification for new posts here either (I just keep refreshing the tab time to time, because my ecperience with scratch notification is that they are useless, a live chat project in scratch, which unfortunately are forbidden is better then scratch site), maybe I could heart and unheart the project as form of ping lol.
Btw, I did not get any notification for new posts here either (I just keep refreshing the tab time to time, because my ecperience with scratch notification is that they are useless, a live chat project in scratch, which unfortunately are forbidden is better then scratch site), maybe I could heart and unheart the project as form of ping lol.
- WofyWritesHugeRPBios
-
100+ posts
Slashes Creating Too Many Broadcasts
with scr… in TurboWarp, it's not our duty. I just found that it works differently then yesterday, are you working directly on the remote project or do you just update when you are done with changes in local .sb3 file on your device?I did make some changes in an attempt to get it working (Which definitely didn't work), though I did a full test run of every route in the game earlier to make sure it didn't bug things out (Which it didn't, yay.) I am working directly on the project, though I do have an unshared project that's the exact same project - I use it to test direct changes to the code, just in case, though I haven't used it in a bit. No need for appologies ; ) I am just tryign to have fun
Btw, I did not get any notification for new posts here either (I just keep refreshing the tab time to time, because my ecperience with scratch notification is that they are useless, a live chat project in scratch, which unfortunately are forbidden is better then scratch site), maybe I could heart and unheart the project as form of ping lol.
Last edited by WofyWritesHugeRPBios (Feb. 19, 2025 14:37:55)
- KaaBEL_sk
-
100+ posts
Slashes Creating Too Many Broadcasts
One important thing, I think applying some more good scratch coding practices would help with many of the issues, two I came across so far:
- Project using many clones should have some clone managment system for at least being able to inspect all of the clones in project, their count and in the best case report error for attempt to create 301st or even handle it without crashing the game.
When I get to slash attacks it starts creating so many clones that the bone attacks don't even appear (even thogh the warnings are displayed). - Thera are many parallel threads (script of connected blocks) I am going to use the terminology from RokCoder's blog about scratch inner workings. All those threads are getting cueued to thread list in a order that the code shows no controll of, that means you things might work for some time, but you are likely break the code with changes to it.
I've found the set AreYOuAClone? this sptite only variable to be set in seprate threads, the bug isn't completely fixed but it seems to be getting there. Those changes are mainly done in sprites “ProjectileAttack” “Warning!”, I shared the project on my alt account: https://scratch-mit-edu.ezproxyberklee.flo.org/projects/476526989/
- WofyWritesHugeRPBios
-
100+ posts
Slashes Creating Too Many Broadcasts
One important thing, I think applying some more good scratch coding practices would help with many of the issues, two I came across so far:
- Project using many clones should have some clone managment system for at least being able to inspect all of the clones in project, their count and in the best case report error for attempt to create 301st or even handle it without crashing the game.
When I get to slash attacks it starts creating so many clones that the bone attacks don't even appear (even thogh the warnings are displayed).- Thera are many parallel threads (script of connected blocks) I am going to use the terminology from RokCoder's blog about scratch inner workings. All those threads are getting cueued to thread list in a order that the code shows no controll of, that means you things might work for some time, but you are likely break the code with changes to it.
I've found the set AreYOuAClone? this sptite only variable to be set in seprate threads, the bug isn't completely fixed but it seems to be getting there. Those changes are mainly done in sprites “ProjectileAttack” “Warning!”, I shared the project on my alt account: https://scratch-mit-edu.ezproxyberklee.flo.org/projects/476526989/
I checked out the Project, and wow, THANKS! Beforehand, my perspective of the issue wasn't completely clear; now it's much easier to see what's actually happening. Using this new information, I “Solved” the issue by creating another ‘Main Sprite’ so to say when the game starts. This other clone has a different “AreYouAClone” Value, being “Slash”, and I put “If AreYouAClone = Slash” into the Slash code. This makes it so that the actual Main Sprite doesn't multi-task hugely, and makes the Slash attacks work. Again, thanks so much for the help on this!
- Discussion Forums
- » Help with Scripts
-
» Slashes Creating Too Many Broadcasts