User Information

Th3_C0d3r

Post Count:253
First Seen:12:52:39 AM 24/8/2016
Last Seen:7:27:12 PM 14/12/2018
Starting at newsest posts first

253: Need help making "Death Timer". at 7:27:12 PM 14/12/20183347534

christmas_birth wrote:

I need help making a timer where when it reaches 0 it kills the character
First off, please don't hijack someone else's thread. If you need help create your own. I'm only answering because of its similarity to OP's question by nature

Gavin_DevLord wrote:

…make a timer that kills you if you stand still for too long.
Simply record the last X & Y positions.
set [Old X v] to (x position)
set [Old Y v] to (y position)
And if after a set amount of time the current X & Y equal the old, then excute the “end script”.

Unfortunately, the built-in timer block only counts up so it's going to be more of a count-up timer than a countdown one. Of course you could inverse if you really wanted to.

reset timer//Don't forget this unless you're using another variable to apply the offset
if <((10) - (timer)) < [0]> then//Where 10 means 10sec countdown
Death::grey

Or alternatively, use a variable that decreases itself every second.

-Scratch On!
252: How to sense velocity of mouse? at 3:02:39 AM 5/12/20183336732
Here —> https://scratch.mit.edu/projects/267887030/#player
Hope it proves helpful!

-Scratch On!

GT_Scratch wrote:

I have changed it to your shortened version, but it seems to delete itself after writing a few numbers down. Please could you help with that? (See-project for further details)
You forgot:

set [kount3 v] to [1]
set [Konverter v] to []
repeat (length of (item (1 v) of [Konverter v]))//Change it to this for less mess
set [kount2 v] to [1]//change this to 1 (my bad XD)
repeat until <(letter (kount2) of (Character)) = (letter (kount3) of (item (1 v) of [Konverter v]))>// Refer to ***
change [kount2 v] by [1]
end
if <(length of (kount2)) = [1]> then
set [Konvereter v] to (join (Konvereter) (join [0] (kount2)))// This, you forgot the second join
else
set [Konvereter v] to (join (Konvereter) (kount2))
end
change [kount3 v] by [1]
end

-Scratch On!
Here are some pointers for you since I myself am not sure what the goal of the project is.

First your, “encoder” can be fixed/reduce to:

set [kount3 v] to [1]
set [Konverter v] to []
repeat until <(kount3) > (length of (item (1 v) of [Konverter v]))>
set [kount2 v] to [0]
repeat until <(letter (kount2) of (Character)) = (letter (kount3) of (item (1 v) of [Konverter v]))>// Refer to ***
change [kount2 v] by [1]
end
if <(length of (kount2)) = [1]> then
set [Konvereter v] to (join (Konvereter) (join [0] (kount2)))
else
set [Konvereter v] to (join (Konvereter) (kount2))
end
change [kount3 v] by [1]
end
*** Be careful, if an unknow char. were to be used, it will trap the script in an endless loop

As for your decoder, you have the right method, you just forget to save the decoded text to a variable. You keep, “overwriting” new data to the save var.

-Scratch On!
249: help with sprite and clone movement at 5:51:03 AM 3/12/20183334116
Here's my remix —> https://scratch.mit.edu/projects/267114962/

You were close in have the right idea, but I fix it up for you by compressing repetitive scripts. All you needed was a “Control” game loop or something to manage when movement inputs would affect the sprite or clone. By having TWO main game loops, it's like having two conductors lead an orchestra.

-Scratch On!
248: Cloud Saving at 5:22:17 AM 3/12/20183334108
Here's my old project for people like you —> https://scratch.mit.edu/projects/126750140/#player
This “Save System” can be accomplished 2 ways. Through load&save code system -or- thru cloud vars.
Both compress the essential data into strings. The first gives that raw data to the player, while the latter encodes it for the cloud.

Save & Load code
Pros:
Easy to make (therefore reliable)
Can accommodate an infinite amount of players.
Cons:
Can result in messy long strings of random characters.
Player has to store this “data” somewhere to resume session later
Can be “hacked”

Cloud Saving
Pros:
Everything is stored in the cloud so the player doesn't have to worry about losing progress.
Cannot be “hack” so the data is trustworthy.
Cons:
Hard to make (lots of scripting involved)
Cloud vars. size has recently been reduced to 128chars. so limited storage for players.
Cloud vars. have proven to be buggy causing discrepancies between the wanted and actual value of the var. (Unreliable)

Both methods can easily be searched up to copy. Just remember though, for cloud saving you need to understand encoding due to the fact it can only hold numerical values, not letters.

-Scratch On!
247: Can I make the sprite less blurry? at 8:43:06 PM 28/11/20183327078

lilmonkey777 wrote:

Try converting it to bitmap mode, fixed it for me.
Please consider the date of the original post as they are no longer looking for replies.
Sorry, right now I lack the time to properly investigate your project. Nevertheless, from the looks of things, it seems the part giving you trouble is updating the background stamps. Rather than messing around with stamps, I would recommend you to use clones instead. Here's one of my old project with a similar scroller engine. Take a look in the “Background” sprite. I labeled each clones position as 1 is there and 0 is not. It's a 2x2 so it's as simple as it gets.

As I said I lack time, so there might be an easy fix I didn't see.

-Scratch On!
245: Duplicate letter word glitch. at 6:01:26 AM 28/11/20183326391

TemTheTemmie_ wrote:

this was fixed, check h((is)er) main project, (s)he said (s)hes working on it, please dont reply to fixed topics.

Nowhere is there, “evidence” of OP or project itself, for that matter, saying it was, “fixed”. Besides, the topic is only what, 1 day old so it doesn't qualify as necroposting. I just provided a reasonable solution base off of what I understood about astroglider661 goal and your script. So I, “fixed” your script so it can now be problem-free to avoid any potential hiccups.
244: local variables at 11:22:21 PM 27/11/20183326091
Sharing the project always helps and prevents any & all confusion or guesswork.

Is this a cross-section or birds-eye-view type scroller? Did you set the Clone's ID var. to “this sprite only”? Scratch 2.0 from what I know has a maximum of 300 clones so a limit isn't the reason. Until you share it, it'll be pretty pointless to guess anymore.
243: Duplicate letter word glitch. at 10:30:46 PM 27/11/20183326018
Here —> https://scratch.mit.edu/projects/265624385/#player
Funny enough I took part of the script I created to help someone else. First of all there is a lot of redundant (removed by moderator - please keep it polite) scripting that can easily be taken out. Your best bet is to start from scratch and come up with a more efficient method as of this kind of project shouldn't lag at all.

-Scratch On!
242: need help with lists at 9:56:25 PM 27/11/20183325985
Here's a simplified Version of the script thanks to, “hack blocks”—> https://scratch.mit.edu/projects/265614954/
Just copy the script to your backpack

-Scratch On!
241: Weird animations... at 6:06:40 AM 25/11/20183323138
In your Ralsei script you have…

define Animate
set size to (60)%
switch costume to [Ralsei in battle-0 v]//Take this out
if <(costume #) = [5]> then
switch costume to [Ralsei in battle-0 v]
else
next costume
end
wait (0.04) secs

That one “switch costume” block at the top is affectively reseting the animation over and over. Resulting in what appears to be a frozen sprite.

-Scratch On!
Here, I recently answered a similar question to yours —> https://scratch.mit.edu/discuss/post/3317033/ (Click the link to the remix project. Unfortunately this demo-project didn't have a strafing (waking) animation but the scripting is the same nonetheless.)

Or preferable refer to the original project I based it off of —> https://scratch.mit.edu/projects/108361157/#player

-Scratch On!
239: Sprites in front of lists at 10:24:47 PM 24/11/20183322731
What I do in stubborn cases like this is go into editor mode (see inside scripts). Then click and drag that sprite over/on top of the list/var.

-Scratch On!
238: Broken Saves at 9:15:08 PM 22/11/20183320447
From a first glance, it seems your technique is to systematically scan each spot for a certain color. However, your “tiles” are not only different shapes but different colors too. Meaning there is a good possibility for the scanner engine not only to completely miss the tile, but also scanned the wrong part of it (different colored on it).

Fortunately, an easy fix I thought of is to immediately save every position/change to your list. Given that it's an 8 by 16 grid there are 128 spots you'll need in your save list, or 8 rows if you so choose. So label each spot as a number 1-128 (doesn't matter how you number it, just as long as you and the engine make sense of it) and let say the player puts tile type “C” into spot 32, the script should then replace spot 32 in the save list with the value of title “C”

Depending on how you format your save list and how you want your save/load code, you can easily compress it.
Here's my solution…

... :: grey //Start of game loop
set [moving v] to (1)
forever
if <key [space v] pressed?> then
wait until <not <key [space v] pressed?>>
set [moving v] to ((moving) * (-1))
end
if <(moving) = [-1]> then
switch costume to [snail bob shell v]
else
switch costume to [snail bob v]
change x by (1)
end
end

-Scratch On!
Here's a more efficient way to code it. Because right now there are many pointless redundancies.

... :: grey // Start of game loop
forever
if <key [space v] pressed?> then
switch costume to [snail bob shell v]
else
change x by (1)
switch costume to [snail bob v]
end
end

-Scratch On!
You have to share the project first before we can see it to help
234: Cannon balls veering off path at 11:44:10 PM 19/11/20183317773
Here's a remix —> https://scratch.mit.edu/projects/263411139/
Like 04tmoody said,

04tmoody wrote:

The problem is that by decreasing the y-velocity, you are making the x-velocity move more than it should.

So it was causing a gravity-like effect.