Spread Values

This forum is currently in read-only mode.
  • 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?

  • Nope loopindex, is all you need, but you would need an event to set the variable to loopindex first.

  • 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.

    dl.dropbox.com/u/32409323/nuisancePuyo.cap

  • 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 MMF2

  • It basically the only way I know how to spread ID values.

    youtube.com/watch

    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.

  • 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

    <img src="http://dl.dropbox.com/u/1013446/forumhelp/Capture2.PNG" border="0" />

    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

    <img src="http://dl.dropbox.com/u/1013446/forumhelp/Capture3.PNG" border="0" />

    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?

  • It might be better if I post the mfa file. I'm not that at explaining

    things.

    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.

    <img src="http://dl.dropbox.com/u/32409323/nus00.png" border="0" />

    At a value of 6, it looks like this.

    <img src="http://dl.dropbox.com/u/32409323/nus01.png" border="0" />

    At a value of 12, it looks like this.

    <img src="http://dl.dropbox.com/u/32409323/nus02.png" border="0" />

    At a value of 33, it looks like this.

    <img src="http://dl.dropbox.com/u/32409323/nus03.png" border="0" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 now

  • 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.

    <img src="http://dl.dropbox.com/u/32409323/nus04.png" border="0" />

    The highest hey store is over 20000.

  • 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

  • There aren't suppose more than six. That what the other shapes are for (the star, moon, crown, and comet shaped puyos).

    If you still have the mmf2 example, try setting the value to like 1000 or so.

    If you played Dr Robotnik's Meanbeam Machine, its the same deal. It's engine use from Puyo's engine.

    I can post a video or a screenshot.

    Video

  • I'm not sure if you're asking for more help, but

    any additional icons that represent higher numbers would use the same technique, just replacing the images, and the numbers with the higher numbers they represent

  • I'll try that.

    With more Icons, I could able to keep it from showing more than six?

  • well as long as you have enough icons to reach the numbers you need

    if you don't have em, and you still want to limit to 6, you can either put all of the icons in a family, let's say Red

    then before each of the spawning actions, insert a condition like

    System - Compare - Red.count < 6

    ----do all the spawning conditions and actions

    and you can also clamp the values to keep them from reaching a high enough number that it spawns too many:

    global('nuisancelevel')=clamp(global('nuisancelevel'),0,global('maxamount'))

    also, if there's a pattern the numbers like there's 6 then 30, there would probably be a way to put all of the icon pictures as frames on the same sprite, and use one event, with correct conditions and expressions do do everything. this would require you to be fairly comfortable with math, and also that there be a useful pattern to the amounts each picture represents.

  • So, I was playing with my first attempt and I managed to get them th spawn in sequence and I managed to get them to show based on the value, but there is still a issue.

    dl.dropbox.com/u/32409323/nuisancePuyo.cap

    <img src="smileys/smiley38.gif" border="0" align="middle" /> = Red Puyo

    * = Small Puyo

    <img src="http://dl.dropbox.com/u/32409323/null.png" border="0" />

    30 should = <img src="smileys/smiley38.gif" border="0" align="middle" />, but instead I get <img src="smileys/smiley38.gif" border="0" align="middle" />*****.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)