AmpedRobot's Forum Posts

  • Really? Maybe I'm doing something wrong. Why the heck would I not see it in the debugger? Screenshot maybe?

    Thank you for replying btw.

    On an unrelated note, how would I pick 4 random non-repeated values out of that list? (NVM, just figured this out! )

  • Hi, all.

    I read what I could find on arrays on the official Construct 2 threads and I still can't figure out why my capx doesn't work. The array doesn't even show in the debugger.

    The simpler ones do, when filled manually with lists.

    I'm trying to fill a 1D array with this list of 96 values:

    20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400 420 440 460 480 500 520 540 560 580 600 620 640 660 680 700 720 740 760 780 800 820 840 860 880 900 920 940 960 980 1000 1020 1040 1060 1080 1100 1120 1140 1160 1180 1200 1220 1240 1260 1280 1300 1320 1340 1360 1380 1400 1420 1440 1460 1480 1500 1520 1540 1560 1580 1600 1620 1640 1660 1680 1700 1720 1740 1760 1780 1800 1820 1840 1860 1880 1900 1920

    Is current supposed to be in there somewhere?

    This is my first attempt to use an array.

    http://www.darksunpictures.com/public/array.capx

  • Hey, guys.

    Quick question, if any1 has the time.

    Is it possible to use a collision mask of an invisible sprite? I mean is this independent of the actual image?

    All I really need is a rectangle for detection, so if the mask would not work, maybe bounding box?

    I haven't attempted to code this yet, but thinking ahead as it would be useful for something else, so setting up the AI now.

  • Yes got it to work perfectly!

    Thanx so much!

    Owe ya.

    On another note the -system-repeat- seems to have trouble with ELSE statements if you're doing a lot of different probabilities, but no problem with OR blocks.

    I may not be understanding the ELSE logic properly, but from what I read it should've been working.

    Eh, doesn't matter.

    OR works.

    Thanks again.

  • Ok, it's absolutely bizarre.

    The 1 line spawns 49 blocks, but it's not what the code is supposed to do because of some built in chance.

    But the 2 lines don't spawn all the way to the edge of the screen (same cloned group) because the code is working as intended, so it's an easy fix.

    I thought the repeat x times (without a loopindex condition to end) was creating an invisible infinite loop, but it's not based on the number of spawned blocks checked with a text variable, just 49.

    So it seems to be a bug, but the code works correctly in the multiple spawn line version, which is what I need.

    If anybody cares, the code started working correctly only after the loopindex, variable resets, and #oflinesspawned were added (now does the same thing for 1 group or 2).

    Otherwise it was counting a non-spawn because of chance as if it didn't happen at all and going to the next possible spawn (the internal loop index in the repeat) was not updating at all.

    This doesn't seem to be explained anywhere in the documentation as far as I can tell.

    -----

    Ok, I got this. Which is a bit ahead of myself

    It's not a bug. The way I had it set-up with the variable checking for whether to execute the repeat or not, it wasn't updating the variable for the condition check because I had the variable incrementation done on only 1 out of 3 possibilities, so it could go up to 49.

    What it fixed it was the variable reset on actual loop index check (it could no longer keep going up to satisfy the condition), thus doing the odds properly.

    I learned a lot

    (Sorry for the multiple posts.)

  • Ok, turns out the sequence thing is easy just by incrementing and making a new variable.

    Also, loopindex needed to be 48 like you said (forgot about the 0 thing).

    So it is spawning 2 lines for me now, but not all the way to the edge of the layout, like it did when I was just using the first spawning group for 1 horizontal line.

    Will play with it to figure it out.

    Thanks so much for the help.

  • "In your condition simply go to System -> compare two values and in the top box just type in loopindex and then set "is equal" and in the bottom box put 48 or 49 depending on your loop starting position. "

    That was very helpful (would've been Mt. Everest for me; believe it or not nothing comes up on You Tube under "Construct 2" and "loop index").

    Unfortunately code is still not working for me. I tried it with group activation and reactivation and just doing the set to variables (manual plugin).

    I guess since I'm reusing and resetting the same variables, I would need to run the groups in sequence? How would I do that? Basically tryin to spawn 2 horizontal lines of blocks in sequence (only once as a first layout).

    Only way I found (by Googling) is as a sub-event, but it will not let me make the whole 2nd group (basically a clone of the first for a new line w/ offsets) a sub-event of the first.

    Also, I don't think the code is working as intended because I still need it to spawn a block at a value of 49 and reset AFTER. I could be wrong.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm having a hell of a time finding loopindex to access. Found a post about some other peeps complaining that loopindex is name of the loop, not intuitive at all in Construct 2? Can't figure out how to code/access the code for this.

  • Ok, let me try the code.

    brb.

    Owe you for the speedy response.

  • Hi, all.

    How would I reset the variables used in a single spawn of some sprites?

    Basically I have

    Repeat 49 times

    System block1_spawn (variable) does not equal 49 - make some blocks using h and y values

    this spawns a horizontal line of blocks for me

    I want to repeat the process/use the group again in another location (since it spawns only once because of the does not equal condition).

    I would need to reset the variables **AFTER*** my block1_spawn variable reaches 49 in this instance.

    I checked videos, tutorials, loopindices, system conditions, Googled it too, but I can't find this anywhere.

    I am very new to programming. Could you provide an actual Construct 2 coding example?

  • Here is the capx.

  • Yup, that's a lot closer.

    Thank you.

    But there is still a noticeable shift.

    I don't think it should be there, even in prototyping software?

    Plus I did another capx a lot closer to a full game with none of these issues and this is a basic Scirra template.

  • Even if you remove the parallax on the bg layer and the player falling, you get this:

    http://www.darksunpictures.com/public/n ... alling.png

    So the player and the blocks are in center quadrant as opposed to top left.

  • Problem Description

    Ashley closed my last thread.

    I'm reposting with capxs, screenshot.

    I don't understand what I'm looking at.

    I would expect at run time for the elements to be in the exact positions of the layout, not all weirdly shifted.

    Attach a Capx

    http://www.darksunpictures.com/public/positioning.capx

    http://www.darksunpictures.com/public/r ... ioning.png

    Description of Capx

    They are your capxs with minimal modifications (layout guide file added) and player shooting).

    Steps to Reproduce Bug

    Open the capx.

    Look at the screenshot.

    Observed Result

    I would expect at run time for the elements to be in the exact positions of the layout, not all weirdly shifted.

    Expected Result

    See above.

    Affected Browsers

    Chrome: YES

    Operating System and Service Pack

    Windows Vista (all service packs)

    Construct 2 Version ID

    ____ Exact version ID of Construct 2 you're using ____

    Current version from download page.

  • How many times did you try it?

    What video card/browser are you using?

    I just noticed Construct 2 is approved for pretty old operating systems.

    What does this mean?

    If you make an exe and a player is using Windows 10, all bets are off?

    That would be horrible.