AmpedRobot's Forum Posts

  • So for frame 1 cycling, frame=1?

  • Ok, lemme test.

    That would simplify my life quite a bit.

  • Would there be a way of grouping many different sprites on screen for comparison purposes?

    I just discovered the "pick all instances" and "is on screen".

    So how to use that for say 5 different ship/sprite types on screen and then pick a random instance out of all that?

    Is that possible?

  • Thank you, ROJO.

    You are the master, as always.

    That is a very neat way of programming.

    I haven't seen it before.

    Nice!!!

    Thanks again.

  • Yup, the Else fixed it for the 4 spawn (think i hit reload 15 times to test), but not for the 10 max spawn version or 7 for that matter (probably values larger than 4 for the spawned ships).

    http://www.darksunpictures.com/public/LARGERCAPX2.zip

  • I'm not clear what the issue is. In the initial capx you wanted to create multiple sprites and have each one have a different frame. The solutions you got so far seem to correct that.

    Your Larger capx just creates four different sprites. I can't tell from your descriptions how you want it to want it to work. and in what way the result not correct.

    Oh, hi, ROJO.

    Yeah, I threw a lot in there, but that's all easily programmable by me.

    Basically, in the larger capx I posted, the only difference is the spawned ships do not have static positions, but variable horizontal positions based on an array which picks some random non-repeating values out of a larger array and sorts them in ascending order and THERE the engine wash does not alternate. I just want it to alternate and I need the 4 frames. So no idea why that's happening. It only works sporadically right now, so gotta hit the F5 key a few times to reload to see it.

    So basically I need:

    spawned ship 1 starts at frame 0

    spawned ship 2 starts at frame 1

    spawned ship 3 starts at frame 2

    spawned ship 4 starts at frame 3

    spawned ship 5 starts at frame 0 (need to change the random values in there to 5 to see that)

    spawned ship 6 starts at frame 1

    etc etc depending on spawn size

    ---

    and maybe an alternate version if this proves complex

    so

    spawned ship 1 starts at frame 1

    spawned ship 2 starts at frame 2

    etc etc

  • Hey, maybe we could swap e-mails?

  • Well, i have 2 PM's in my Outbox, for almost 2 days now.

    Oh, hey man.

    Yeah, didn't get anything. Ok, no worries I'll wait!

    I noticed that too. I have a few sitting for 6 days now. Weird!

  • Ashley Alright, if nobody has any ideas I'll have to do this the old fashioned way with multiple animations, but that will really waste memory, reduce performance, and the quality of the game.

    I think something this simple as set animation frame should really be working on something like this.

  • Also, on the 2nd array below the 1st my dream list would involve that ship starting with an alternate engine wash versus the 1st ship in the array above.

    99Instances2Go I tried adapting your code for the multiship, different position version even though I don't really understand what it's doing.

    Why do you have the Cycle local variable as %4 of 40 in there or 1.6? It doesn't even show up in the debugger, I guess same as all local variables.

    Is skip essential there or just for placement?

  • Wait, I just reread what you said.

    Are you saying this is some sort of an optical illusion depending on how many ships you have?

    Because I did want to do varying numbers of ships, between 4 and 7 for the random spawn I believe, maybe less for mobile due to performance issues and everything else I have in there.

    So the solution would have to be individual based on how many different ships you spawned?

    Full max spawn per array would be 10.

    And full spawn per screen would involve 2 arrays of 10, so... ? (just 1 array below another)

    Are you saying these animations, when you have a spawned row are processed RIGHT to LEFT?

  • Hi, thank you very much.

    That is a very interesting way of doing that.

    Could you per chance look at the larger capx because the issue is still there and I can't figure out why?

    I thought it was a sort issue, so I sorted the array, but it still works only sporadically for alternating the engine wash.

    http://www.darksunpictures.com/public/LARGERCAPX.zip

    (please ignore pm just realized these sit in outbox for a while)

  • Thank you so much for answering on a Sunday.

    I guess I went crazy there for a sec!

    But you're right it should be 4.

    This works for multiple ship types too.

    This helped me figure out why it was sporadic.

    The array which rips out the random values out of the larger array does not do so in sequence, so the ships do no appear in sequence.

    Don't suppose you know how to sort a1-dim array in C2, so the values appear from lowest to highest? Or plug them into a new array sorted?

    0 1 2 3

    63 64 65 66

    Had no idea this would be this complicated for such a simple thing :p

    ---

    Uhm, actually it's not a sort issue.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey, guys.

    Can anybody help with this capx?

    Not sure what I'm doing wrong.

    The 2 frame version seems flawless, meaning the engine wash will always alternate no matter how many times you hit F5/reload on Chrome, but the 4 frame version seems broken.

    I had this set up w/ actual assets on much more complex arrays and it would work sporadically, the engine wash would not always alternate.

    Not sure why.

    As an example, this capx is always broken - the 3rd and 4th ship to the right have same engine wash/do not alternate.

    http://www.darksunpictures.com/public/testupload.zip

    I think I wasted way too much time on this, but I tried it a lot of different ways and not sure why it either works sporadically or not at all.

    The sporadic version basically picked X random positions out of a larger array for spawns and sometimes it would alternate flawlessly, sometimes be weirdly messed up in places (no alternation, typically by 2's).

    ---

    Just updated the capx. Thought it was broken, but no, just needs to be unzipped to load.

  • I'm having a devil of a time with this.

    Not sure why it isn't working.

    All I'm trying to do is create 2 different objects as a test and have them play from 2 different frames.

    All I'm doing is:

    Trigger once-> Set animation frame 0

    ->Create object A (which already has the default animation)

    Trigger once-> Set animation frame 1

    ->Create object B (which already has the default animation)

    (tried it w/ sub-events too)

    Basically I have an engine animation for ships and want the animations to play from alternate frames for each alternate spawn, so they don't look exactly the same.

    And nothing is working.

    I checked the Scirra manual and like 5 or 6 Google posts - no help.

    Also tried it with instance variables, but it didn't work.

    I solved this before by doing alternate animations for each frame, but that gets pretty tedious when you have a lot of sprites/animations.

    Shouldn't there be an easy way to do this?

    What's the proper/working way to use "set animation frame" to have objects play the default animation from different frames when they spawn?

    --

    Apparently you set the frame after creating the object!