Discuss Scratch

letmethinkforaminute
Scratcher
100+ posts

Total

I’m making a clicker game and I want to make a total, I don’t know how though. Pls halp
deck26
Scratcher
1000+ posts

Total

Please give more detail. Total of what?
letmethinkforaminute
Scratcher
100+ posts

Total

deck26 wrote:

Please give more detail. Total of what?
Amount of points
deck26
Scratcher
1000+ posts

Total

So when you get a new point you increase the total by 1

change [total v] by (1)
letmethinkforaminute
Scratcher
100+ posts

Total

deck26 wrote:

So when you get a new point you increase the total by 1

change [total v] by (1)
But some upgrades give 10 at a time so that wouldn’t work for anything except clicking
deck26
Scratcher
1000+ posts

Total

So you use a variable

change [total v] by (currentchange)

letmethinkforaminute
Scratcher
100+ posts

Total

deck26 wrote:

So you use a variable

change [total v] by (currentchange)

I did that as well it went haywire and change it by the amount every second not something
letmethinkforaminute
Scratcher
100+ posts

Total

https://scratch.mit.edu/projects/571506788/editor/ That’s the project if you click on sprite 1 you should find the code you gave me
deck26
Scratcher
1000+ posts

Total

If you're trying to use cloud variables you need to allow 0.1 seconds between updates, even to different variables. So updating a cloud variable in a forever loop without any delay is always going to be problem. Same goes for setting two cloud variables in consecutive blocks. So just looking at Sprite1 shows problems.

Why does Sprite1 check the backdrop in multiple green flag scripts? They all seem to be setting the costume to the named costume that corresponds to the backdrop number so these aren't actually doing anything.

So is Sprite1 the right sprite to be looking at or is it another one? Giving your sprites meaningful names would be a lot better than just keeping the default SpriteN names.

So please spend time identifying the sprite and script involved and explain how to see the issue and the symptoms. If it is the cloud variables I referred to you need to address those though.

letmethinkforaminute
Scratcher
100+ posts

Total

deck26 wrote:

If you're trying to use cloud variables you need to allow 0.1 seconds between updates, even to different variables. So updating a cloud variable in a forever loop without any delay is always going to be problem. Same goes for setting two cloud variables in consecutive blocks. So just looking at Sprite1 shows problems.

Why does Sprite1 check the backdrop in multiple green flag scripts? They all seem to be setting the costume to the named costume that corresponds to the backdrop number so these aren't actually doing anything.

So is Sprite1 the right sprite to be looking at or is it another one? Giving your sprites meaningful names would be a lot better than just keeping the default SpriteN names.

So please spend time identifying the sprite and script involved and explain how to see the issue and the symptoms. If it is the cloud variables I referred to you need to address those though.

It is the cloud save variables and the green flag scripts is for the backdrop
deck26
Scratcher
1000+ posts

Total

letmethinkforaminute wrote:

deck26 wrote:

If you're trying to use cloud variables you need to allow 0.1 seconds between updates, even to different variables. So updating a cloud variable in a forever loop without any delay is always going to be problem. Same goes for setting two cloud variables in consecutive blocks. So just looking at Sprite1 shows problems.

Why does Sprite1 check the backdrop in multiple green flag scripts? They all seem to be setting the costume to the named costume that corresponds to the backdrop number so these aren't actually doing anything.

So is Sprite1 the right sprite to be looking at or is it another one? Giving your sprites meaningful names would be a lot better than just keeping the default SpriteN names.

So please spend time identifying the sprite and script involved and explain how to see the issue and the symptoms. If it is the cloud variables I referred to you need to address those though.

It is the cloud save variables and the green flag scripts is for the backdrop
But those scripts just switch the backdrop to the current backdrop - so they do nothing. It's like saying if you're outside go outside and if you're inside go inside. What do you think the scripts are doing?

So you need to modify your scripts to not try to write to the cloud without allowing for that delay. If you don't believe that's the problem try changing to non-cloud variables and you should see it works - or if not you're at least dealing with a simpler problem.
letmethinkforaminute
Scratcher
100+ posts

Total

deck26 wrote:

letmethinkforaminute wrote:

deck26 wrote:

If you're trying to use cloud variables you need to allow 0.1 seconds between updates, even to different variables. So updating a cloud variable in a forever loop without any delay is always going to be problem. Same goes for setting two cloud variables in consecutive blocks. So just looking at Sprite1 shows problems.

Why does Sprite1 check the backdrop in multiple green flag scripts? They all seem to be setting the costume to the named costume that corresponds to the backdrop number so these aren't actually doing anything.

So is Sprite1 the right sprite to be looking at or is it another one? Giving your sprites meaningful names would be a lot better than just keeping the default SpriteN names.

So please spend time identifying the sprite and script involved and explain how to see the issue and the symptoms. If it is the cloud variables I referred to you need to address those though.

It is the cloud save variables and the green flag scripts is for the backdrop
But those scripts just switch the backdrop to the current backdrop - so they do nothing. It's like saying if you're outside go outside and if you're inside go inside. What do you think the scripts are doing?

So you need to modify your scripts to not try to write to the cloud without allowing for that delay. If you don't believe that's the problem try changing to non-cloud variables and you should see it works - or if not you're at least dealing with a simpler problem.
The backdrops scripts were for so people couldn’t cheat by pressing the flag and switching back to backdrop 1 but it didn’t work
letmethinkforaminute
Scratcher
100+ posts

Total

I finally made it work, there’s a slight delay but it works
letmethinkforaminute
Scratcher
100+ posts

Total

letmethinkforaminute wrote:

I finally made it work, there’s a slight delay but it works
Well kind of as the number has to be bigger
deck26
Scratcher
1000+ posts

Total

letmethinkforaminute wrote:

deck26 wrote:

The backdrops scripts were for so people couldn’t cheat by pressing the flag and switching back to backdrop 1 but it didn’t work
No, it wouldn't. The built in variables are just different ways of accessing the information about the current backdrop and are always in sync.

You'd need to have a separate variable keeping track of backdrop number or name and use that to control the backdrop but it shouldn't be necessary and if someone is going to cheat they can cheat that system anyway.
letmethinkforaminute
Scratcher
100+ posts

Total

deck26 wrote:

letmethinkforaminute wrote:

deck26 wrote:

The backdrops scripts were for so people couldn’t cheat by pressing the flag and switching back to backdrop 1 but it didn’t work
No, it wouldn't. The built in variables are just different ways of accessing the information about the current backdrop and are always in sync.

You'd need to have a separate variable keeping track of backdrop number or name and use that to control the backdrop but it shouldn't be necessary and if someone is going to cheat they can cheat that system anyway.
Oh ok

Powered by DjangoBB