Spread Values

For questions about using Classic.

Post » Thu Feb 02, 2012 4:46 pm

I'm trying to do spread values.

In MMF2 it

Start of Frame
-Set Spread Value 0 in ID

On Loop "LOOP"
ID of "Sprite" = LoopIndex("LOOP")

In Construct, I wouldn't need the first event, right? instead it would be like this?

+ System: For each Sprite
   + System: On loop "LOOP"
   + NuisancePuyo: Value 'ID' Equal to LoopIndex("LOOP")

Or, I don't need the System: On loop "LOOP" part?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Thu Feb 02, 2012 4:58 pm

Nope loopindex, is all you need, but you would need an event to set the variable to loopindex first.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Thu Feb 02, 2012 5:06 pm

So, just this?

+ System: For each Sprite
   + NuisancePuyo: Value 'ID' Equal to LoopIndex("LOOP")

I have something the call the loop, if that is what you mean?

Doesn't appear to work, unless I did something wrong. Here's the cap.
http://dl.dropbox.com/u/32409323/nuisancePuyo.cap

Azu2012-02-02 17:56:44
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Thu Feb 02, 2012 8:21 pm

More like this:
Start of frame: start loop "LOOP" number of Sprite times

On loop "LOOP": set value 'ID' to LoopIndex("LOOP")

Btw, why do you want to do a spread values? I never needed to do this in construct, only in MMF27Soul2012-02-02 20:22:33
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Thu Feb 02, 2012 10:20 pm

It basically the only way I know how to spread ID values.
http://www.youtube.com/watch?v=07Efts_lDnY

Look at P2's side where the nuisance Puyo stacks up. I'm trying to do that.
I'm trying to do this. It works in MMF2, but MMF2 is well, meh.

I have the MMF2 version if anyone wants to take a look at it.Azu2012-02-03 06:42:46
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Fri Feb 03, 2012 2:26 pm

while I usually go to Twilight Sparkle and the gang to 'spread values' such as friendship and cooperation, I just wanted to point out that you don't even need to have a name for the loopindex expression

unless there's some readability problem, or you're using nested loops like
For 0-10 in "xloop"
--For 0-10 in "yloop"

and I believe it will actually result in returning 0 every time when using the 'For Each Object' condition, since these are not named loops.

also, don't forget there's a 'For Each Object Ordered' condition to do things like

which in this case, for example, would do the For Each going from the leftmost sprite to the rightmost, though you can use any ordering expression, such as the Sprite('ID') pv variable you created.

I'm not sure if this would be useful in your situation, but I suspect it might. Though I must admit, looking at the puyo puyo video doesn't immediately tell me what you're trying to do with the ID's exactly.

If you haven't already gotten everything figured out, or if you don't mind elaborating just to satiate my curiosity - are you assigning them an ID based on which vertical space they'll be above?lucid2012-02-03 14:31:53
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Feb 03, 2012 3:46 pm

It might be better if I post the mfa file. I'm not that at explaining
things.
http://dl.dropbox.com/u/32409323/nus.mfa
Saved in build 251 but Build 248 should work.

The. ID are there to make sure they work right. Meaning they all don't change to the thing.

I'm trying to achieve this effect.

At a value of 3, it looks like this.


At a value of 6, it looks like this.


At a value of 12, it looks like this.


At a value of 33, it looks like this.
Azu2012-02-03 15:49:54
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Fri Feb 03, 2012 4:52 pm

here's how I would do it, not sure if this will apply in your situation. You could actually make a much shorter version with the same technique, but the shorter the cap, the longer the math...
anywho, type a number in the editbox, to watch the thingies do their thing:
puyothing

edit:
accidentally uploaded cap from newer version of construct, if it didn't work before, it should nowlucid2012-02-03 17:31:34
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Feb 03, 2012 6:51 pm

That works perfectly. Just need to find out how to animate them. Thanks for the help!

Edit: Seems to show more that6 of the puyo at higher values, like 100 for an example.


The highest hey store is over 20000.Azu2012-02-03 18:56:00
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Fri Feb 03, 2012 7:20 pm

not sure what you mean:
30+30+30+6+1+1+1+1=100

I think you mean you don't want it to show more than 6 across
in which case, is it just supposed to stack them up? or are there ones that mean more than 30? I've never played the game.

either way, I'd need more information to make it do something else, I was just giving an example of how to represent the numbers in that puyo form
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests