Variables/Triggering Player Difficulties [RESOLVED]

2 Questions, One about variables one about limitations in figuring out who the triggering player is in blocks.

In blocks, I’ve been creating variables and then telling them what they are equal to.

Then I will go to a different block for a different device and none of the variables I created in other blocks are there.

1A) Does this mean that Variables are unique to each device’s block?
1B) Can I use a variable that I created in one device’s block, keep the spelling the same, and use it in another block without having to reassign it value?
1C) I guess what I’m asking is, can the variables talk to each other between different devices blocks?

I’m still working out kinks in trying to steal from other players. I can now steal the amount of an item a player has purchased, but I cannot steal the amount a player has stolen from others. When I’m in blocks I have no way of knowing which player was the triggering player, so I can’t update the property with their correct amount of the resource they stole. (The resource being stolen is not what the game score is based on.)

Here is the item granter block I have. The top portion is correctly functional and allows stealing of bananas that a player has purchased.

The bottom part is me trying to figure out how to take the value that was just stolen and assign it as the property value of stolen bananas to the triggering player.

image

2 Likes

Okay, as far as I know, variables are unique to the block. However, you can set a property to a variable and transport the value that way.

2 Likes

No, variables are only for one block. Properties are for every block. What you can do is set a variable to a property, make it act as a property, and set the property equal to a variable.

3 Likes

Wow. We said the same thing lol

2 Likes

Also, you can save the value of the property when a button is pressed, like I showed you, and give a player exactly that many item by using a item granters special blocks. If you need a better explanation, let me know.

1 Like

Birds of a feather think alike.

2 Likes

You birds are lucky you have sayings ;-;

2 Likes

ummm… dragons breathe the same heat of fire? idk

4 Likes

Well, aren’t both birds and dragons descended form dinosaurs?

5 Likes

Yeah, I get what you’re both saying what I don’t get is how it would actually work.

For instance, I have a property created for each team, called Tm 1 stolen, Tm 2 Stolen, etc; however it does not have a value in game because I cannot figure out a way to give it the correct value.

I can give it a value for every time a player steals, but the teams are not getting credited for the quantity they have stolen.

So, if I go in blocks and tell it to set a variable I created called Team 1 stolen, equal to the property Team 1 stolen, both of those have no value. They look at each other and see nothing.

If I use my existing code above and say, okay, take the amount of resource that was just granted and set it equal to Team 2 Stolen, that does not work, because what if it was Team 3 or Team 16 that did the stealing?

I cannot think of a way to use the triggering player options correctly to set the value to where the player who triggered it gets an updated property that holds the amount they just stole.

TeamXStolen should be equal to the amount that TeamYDeposited in the button, which I already showed you how to do. Then, when a second button is pressed, an item granter runs its block, which says to give the triggering player X item, where X is the amount stored.

1 Like

Maybe the wings of enlightment gather in a thunder?

2 Likes

I would say ask the other dragon for advice on sayings, but we need to stay on topic.

2 Likes

Here is the code you showed me earlier, for one of the buttons.

I’m sorry I’m slow on the uptake, I just like to understand how things work. Two of the components in the code are triggering players team number, and the other is triggering player’s score.

In my game the score is not based on the item being stolen, so the score seems obsolete with that in mind. And the team number also seems like it could screw up the code. Wouldn’t that mean that team 18 will always end up stealing more than team 3 because the value of their team number is larger?

No, because this example was coded wrong. Get score of team should be directly connected to triggering players team number, and THAT should be added to amount of bait.
Screenshot 2023-06-26 10.03.58 AM
Screenshot 2023-06-26 10.04.03 AM
(That is just overlap from my scrren not being big enough for one screenshot)

1 Like

@Zypheir, can you tell why this block setup doesn’t work?
image
The first block of code that runs.
image
The second block of code that runs.


The whole build.

1 Like

What is the triggering player’s score? Is it counted in bluefish, knockouts, etc.

1 Like

The amount of fish they have, which is set to 5 for testing purposes.

1 Like

Yo, since you had made a request of not giving up on your maps, and nobody made it - i made it for you, and everyone else. E

1 Like