Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Having trouble with Undertale style attacks...
- iwasalone
-
Scratcher
20 posts
Having trouble with Undertale style attacks...
I was making an Undertale type project using randomized attacks, when I ran into one of several problems.The green heart attacks keep spazzing out when they spawn and the flies won't spawn/show. The main fly is supposed to hide, just for reference.
Anyone willing to look though my scripts and help me out for fixing these glitch/coding problems?
Also, can anyone help me make the blue heart jump and be pulled down in gravity just like in Undertale?
Thanks in advance.
P.S. - Will share project upon request. Just tell me.
Anyone willing to look though my scripts and help me out for fixing these glitch/coding problems?
Also, can anyone help me make the blue heart jump and be pulled down in gravity just like in Undertale?
Thanks in advance.

P.S. - Will share project upon request. Just tell me.
Last edited by iwasalone (Jan. 30, 2016 02:02:40)
- The_Blob
-
Scratcher
100+ posts
Having trouble with Undertale style attacks...
ok.
can you please share it
The hearts can be solved like this:

can you please share it

The hearts can be solved like this:
when I receive [-1 heart v]I hope that helps
change y by (up)
glide () secs to x: (bottom) y: (bottom)

- Ataxaos
-
Scratcher
500+ posts
Having trouble with Undertale style attacks...
For the blue heart's gravity script, feel free to backpack my script if it suits your needs.
The project where I have the script is in my signature.
I don't quite get what you're trying to achieve with the green heart, so please share your project for reference!
The project where I have the script is in my signature.

I don't quite get what you're trying to achieve with the green heart, so please share your project for reference!

- iwasalone
-
Scratcher
20 posts
Having trouble with Undertale style attacks...
Ok, will share.
As for the blue heart, I will try that out and tell you if it works.
As for the gravity script, I will try and credit you.
Link: https://scratch.mit.edu/projects/95903660/
As for the blue heart, I will try that out and tell you if it works.
As for the gravity script, I will try and credit you.
Link: https://scratch.mit.edu/projects/95903660/
Last edited by iwasalone (Jan. 30, 2016 11:46:26)
- iwasalone
-
Scratcher
20 posts
Having trouble with Undertale style attacks...
ok.
can you please share it
The hearts can be solved like this:when I receive [-1 heart v]I hope that helps
change y by (up)
glide () secs to x: (bottom) y: (bottom)
Well, the game doesn't use life, just how many times you got hit.
- iwasalone
-
Scratcher
20 posts
Having trouble with Undertale style attacks...
For the blue heart's gravity script, feel free to backpack my script if it suits your needs.
The project where I have the script is in my signature.
I don't quite get what you're trying to achieve with the green heart, so please share your project for reference!
The scripts didn't translate well and I'm not the best at Scratch, so I'll have to peek around at the wiki. Good project though. For the green heart, it's basically supposed to be the Undyne fight at diffrent levels.
- iwasalone
-
Scratcher
20 posts
Having trouble with Undertale style attacks...
@The_Blob
@Ataxaos
Little update:
Got blue heart working- used wiki and going to evolve it.
Blue attacks mostly done
Green attack won't show.
Just thought I'd update you guys.
@Ataxaos
Little update:
Got blue heart working- used wiki and going to evolve it.
Blue attacks mostly done
Green attack won't show.
Just thought I'd update you guys.
Last edited by iwasalone (Feb. 3, 2016 00:11:09)
- Ataxaos
-
Scratcher
500+ posts
Having trouble with Undertale style attacks...
I see your problem with the arrow attacks in green heart mode.
You start your scripts like this:
For example, script one rolls a “2”, so it doesn't execute.
Script two rolls a “2”, so it executes.
Script three rolls a “3”, so it executes.
Script four rolls a “1”, so it doesn't execute.
But script two and three aren't supposed to happen at the same time, so the attacks glitch out.
So to fix this, create a variable for “this sprite only”.
Then, roll a different number before a clone is created each time.
This ensures that the same random number is consistent across all of the clone's scripts.
You start your scripts like this:
when I start as a cloneThis means when a clone is created, every single script rolls a random number of it's own.
if <(pick random (1) to (4)) = [1]> then
end
when I start as a clone
if <(pick random (1) to (4)) = [2]> then
end
when I start as a clone
if <(pick random (1) to (4)) = [3]> then
end
when I start as a clone
if <(pick random (1) to (4)) = [4]> then
end
For example, script one rolls a “2”, so it doesn't execute.
Script two rolls a “2”, so it executes.
Script three rolls a “3”, so it executes.
Script four rolls a “1”, so it doesn't execute.
But script two and three aren't supposed to happen at the same time, so the attacks glitch out.
So to fix this, create a variable for “this sprite only”.
Then, roll a different number before a clone is created each time.
This ensures that the same random number is consistent across all of the clone's scripts.
when green flag clickedIs this clear enough, or do I have to remix to show you what I mean?
forever
set [RNG v] to (pick random () to (10))
create clone of [myself v]
wait (pick random (2) to (3)) secs
end
when I start as a clone
if <(RNG) = [1]> then
//do the same thing for the numbers 2-4
end
Last edited by Ataxaos (Feb. 3, 2016 03:11:44)
- iwasalone
-
Scratcher
20 posts
Having trouble with Undertale style attacks...
I see your problem with the arrow attacks in green heart mode.I think this will be fine, thanks a lot! Plus, you're already credited.
You start your scripts like this:when I start as a cloneThis means when a clone is created, every single script rolls a random number of it's own.
if <(pick random (1) to (4)) = [1]> then
end
when I start as a clone
if <(pick random (1) to (4)) = [2]> then
end
when I start as a clone
if <(pick random (1) to (4)) = [3]> then
end
when I start as a clone
if <(pick random (1) to (4)) = [4]> then
end
For example, script one rolls a “2”, so it doesn't execute.
Script two rolls a “2”, so it executes.
Script three rolls a “3”, so it executes.
Script four rolls a “1”, so it doesn't execute.
But script two and three aren't supposed to happen at the same time, so the attacks glitch out.
So to fix this, create a variable for “this sprite only”.
Then, roll a different number before a clone is created each time.
This ensures that the same random number is consistent across all of the clone's scripts.when green flag clickedIs this clear enough, or do I have to remix to show you what I mean?
forever
set [RNG v] to (pick random () to (10))
create clone of [myself v]
wait (pick random (2) to (3)) secs
end
when I start as a clone
if <(RNG) = [1]> then
//do the same thing for the numbers 2-4
end
- iwasalone
-
Scratcher
20 posts
Having trouble with Undertale style attacks...
Alright, i tried your idea, and it kind of worked. Sometimes the arrows won't show, but I'm trying to work around that. I unshared it so people didn't get much of a taste before the full release.
UPDATE: I made some changes to the script, and added a copy of those RMB ones so it spawns faster depending on Intensity. Have any ideas to make them not only spawn on one side, because that's exactly what it does. Project shared again.
UPDATE: I made some changes to the script, and added a copy of those RMB ones so it spawns faster depending on Intensity. Have any ideas to make them not only spawn on one side, because that's exactly what it does. Project shared again.
Last edited by iwasalone (Feb. 4, 2016 00:44:28)
- nyandoge_QWERTYUIOP
-
Scratcher
16 posts
Having trouble with Undertale style attacks...
hOI iM tEM!!!1!!!!!!!
point towards [ SOUL ]
move (10) steps
if <touching [ SOUL ] ?> then
change [ HP ] by (-1)
delete this clone
end
delete this clone
- nyandoge_QWERTYUIOP
-
Scratcher
16 posts
Having trouble with Undertale style attacks...
NO, Ataxos didn't write that down, actually; I did.


- iwasalone
-
Scratcher
20 posts
Having trouble with Undertale style attacks...
I think I could use a modified version of your script to make it work. Thanks!
- Discussion Forums
- » Help with Scripts
-
» Having trouble with Undertale style attacks...