Finding values from different objects in a project

tips
values

#1

Tips with finding values

Edit: This trick isn't really relevant anymore with the new update since finding objects is much easier :smiley: I'll leave everything from the trick here at the bottom anyway in case you have an older update.

Now if you want to find values of different objects, all you have to do is scroll.


The Problem (in the older version)

Have you ever had a project with values in different objects and had trouble trying to find them so you can use them?



The Problem (example):


For example, let's say you have a project with a lot of objects and the first one you dragged out is Bear:

You've dragged out a lot of objects in between as part of your project (here the bunch of Text objects represent the heap of objects).

And say now you've just dragged out Banyan last. You would like to add a rule for Bear that makes Bear do this code:
Set Position to X: [Banyan x position], Y: [Banyan y position]

BUT once you've started the rule, you see that it will take forever to go through the values for all the different objects to find Banyan's values.

Pressing the right arrow (above in the picture) until you find Banyan's values would be a little tiring, especially if you have a lot of characters in between Bear and Banyan.

This is because objects are listed in the order they were dragged out. You might have also noticed this is the same with the Whens menu too:


In the picture above, you can see the objects are listed in the order I added them. Bear is first and Banyan is last.

And the problem is when I'm trying to go through the list of values for each character, I have to keep pressing the right arrow until I find Banyan all the way at the very end.

So I'm going to show you a way of getting around the problem with values of different objects! :smiley:


Continuing the discussion from How to make a long game on hopscotch:


Download new Hopscotch update!
How to make a long game on hopscotch
#4

Edit: This is here if you need it.

My tip:

An Answer:

This relies on an important factor which you may have noticed: when you open up the values menu, the first thing that appears is the list of values for your current object.


Here for example, I'm looking at Banyan's rules and when I press the Values menu, it shows Banyan's values first.

This makes things easier for us to use (: Here's the trick I found out myself:

1) Make a new rule for Banyan (which is where I want to get my values from). You'll be deleting this rule though so it's only temporary.



Put When the play button is tapped in the rule, although it doesn't matter too much because you'll be deleting it.


2) Let's create a new ability and call it "Temporary". I called it "Temporary" (that just means for a short while) because we will only be using it for a little while and then we will delete it.

(Tip: you can also just call it "Temp" for short, which is what I often do)




3) So just again, this is the code we want to use:
Set Position to X: [Banyan x position], Y: [Banyan y position]
and we want to put Banyan's x position and y position values inside the Set Position block.

We will do that code here in Banyan's rule instead of Bear's! Why? It's easier because we can pull out Banyan's values more quickly without having to go through all these list of values of other characters.

And we will do it in the Temporary ability. So let's drag out a Set Position block inside the Temporary ability:



And in the values menu you can see that Banyan's values are right there since we are in Banyan's code, so you can see that Banyan's list of values appear first.

And so let's drag out Banyan's x position and y position values into the Set Position block inside the Temporary ability:



4) Now let's exit Banyan's rule and delete it, because we now that we have the block of code we need, we don't need this rule anymore.



5) So now let's go back to Bear's code. Drag out the "Temporary" ability into Bear's rule:


And what you've done is transport the code from Banyan to Bear using an ability!

Now we have the code for Bear that we need, with Banyan's values, we can drag it out of the ability and delete the old code we don't need anymore.



6) Finally, let's get rid of the Temporary ability and delete it (now that we don't need it anymore):

Press and hold down on the Temporary ability to delete it (here is a link to a post on deleting abilities too in case you're not sure on how to delete abilities):


And now we have what we wanted!

We have this code:
Set Position to X: [Banyan x position], Y: [Banyan y position]
and we put the values of Banyan's x position and y position without having to go through all those characters in the Values menu, by transferring the values in an ability instead :smiley:


#5

Extra tip — Another way:

You could also just drag out any block with a space where you can put values, for example an Increase Value block. And then you can drag the values that you want to transfer into that block instead.

For example:

  • Drag out the values you want into the Increase Value block.

  • Then when you go back to the rule of the other character, just drag out the values into the block you want:

A good thing about this is that you can drag out a lot of values and transfer them when you aren't sure what block you want to transfer them into yet.

The only problem is that if you are trying to drag out the transferred values into a "Check If Else" block, it doesn't work unfortunately and it deletes the value.


#6

Any feedback?

Any feedback would be very greatly appreciated! :smiley:

Do you think I should include the problem and answer in one post? I did originally have them both in the one post, but I split it for these reasons:

  • I was afraid that the one post would be too long

  • it makes it easier to find and share the specific answer and not the problem, since you can share the whole post and specific comments as well

  • and it makes it easier for me to find specific parts of the post when I'm editing it

But I can put them back in the one post if you think it's better! It may make it easier having it all in one place.



And also I know some of it might be a bit unclear, so just tell me what I can make clearer :smiley: sorry in advance as well if there are things that don't really follow each other and make sense because I was doing the post in stages.

(I know I shared this trick with @Fishyguitars on Hopscotch and I'm glad you could understand what I was saying, do you think this post is clear to understand or a bit confusing?)

Let me know what you think :smile:


And I would like to say thank you to @Funky_63_Greenland because although he didn't teach me the trick directly, I learned it myself while I was helping out with a project we were working on together :smiley:

I had seen that he somehow got the specific values of an object into the code of another object and I was wondering how he did it :smile: so thank you!


#7

@t1_hopscotch I love the tutorial. I did not know this but earlier in my Hopscotching days I used the ability transport for other reasons. 2 is great and I can't find anything unclear. :smile: Also, I like how you used Skitch. If I had screenshots in my tutorials I would do the same if Skitch works in Windows 10.


#8

Wow! This is a great and easy way to transfer values easier.


#9

I put all my values on the iPad though.


#10

Same! So I don't have to scroll through each character.


#11

Me too! I learned to do that the hard way. :grimacing:


#12

I'm bumping a bunch of t1's topics cause they are so great.