Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Total
- 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
- letmethinkforaminute
- Scratcher
100+ posts
Total
Amount of points Please give more detail. Total of what?
- 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
But some upgrades give 10 at a time so that wouldn’t work for anything except clicking So when you get a new point you increase the total by 1change [total v] by (1)
- letmethinkforaminute
- Scratcher
100+ posts
Total
I did that as well it went haywire and change it by the amount every second not something So you use a variablechange [total v] by (currentchange)
- 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.
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
It is the cloud save variables and the green flag scripts is for the backdrop 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.
- deck26
- Scratcher
1000+ posts
Total
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?It is the cloud save variables and the green flag scripts is for the backdrop 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.
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
The backdrops scripts were for so people couldn’t cheat by pressing the flag and switching back to backdrop 1 but it didn’t workBut 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?It is the cloud save variables and the green flag scripts is for the backdrop 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.
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
I finally made it work, there’s a slight delay but it works
- letmethinkforaminute
- Scratcher
100+ posts
Total
Well kind of as the number has to be bigger I finally made it work, there’s a slight delay but it works
- deck26
- Scratcher
1000+ posts
Total
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. 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
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
Oh okNo, it wouldn't. The built in variables are just different ways of accessing the information about the current backdrop and are always in sync. 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
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.
- Discussion Forums
- » Help with Scripts
- » Total