gamecherry's Recent Forum Activity

  • You could do this:

    global number index =0
    
    +------------------------------+
    | while                        | set index to int(random(5,8))
    +------------------------------+
       +---------------------------+
       | array: value at index <99 | array: set at index to 5
       |                           | stop loop
       +---------------------------+[/code:10wrpefu]
    Basically pick a random index until the value isn't 99 before setting the value.
    

    Wow! Thank you so much R0J0hound. I incorporated that into my code and applied it to picking the 99s, the 5s, and some other things that I had yet to figure out when I posted and it works great. Those 2 lines of code relieved so much stress and Im grateful.

    Thank you R0J0hound and everyone else for taking an interest in helping me.

  • It might be worth asking what are you using the array for ? Ive ran into trouble when I was using the wrong thing for a specific instance.

    Thank you for your interest. I'm trying to populate a map with icons. The icon(s) are a single animation of 6 frames at 0 fps. I need the icons to be placed with a random frame 1-4. Within this map some of the icons need to be set at frame 5 (according to what group I assigned them to.) Some of them need to not exist, which is where the 99 value comes from (values of 99 are not instantiated onto the map.)

    I want to set all X elements to a random number between 0 and 4. Then I want to set some elements to 99. Then I want to set some of them to 5 but not the ones I already to set 99.

    I know, it's convoluted and obtuse.

    I figured the best way to do this is to set up an array to hold the frame numbers for each icon so, I can save their location and frame number when exiting and entering the map.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello and thanks for looking,

    I wasn't sure how to word the topic, apologies for that. I'm trying to assign all the X values in an array to a random number between 0 and 4, which I did using 'For Each X Element--> Set Value At Array.CurX to int(Random(0,5))' This seems to work.

    Now I need to figure out how to set some of them to 99 based on groupings I had set earlier. I.E. 'Array-->Set Value at int(random(2,5)) to 99, Set Value at int(random(5,8)) to 99, etc....' This also seems to work.

    The hurdle has become, how do I now set an element within those same groupings to 5 without changing a value that was previously set to 99?

    If this doesn't make any sense please, let me know and I'll try to clarify. Thank you for your time.

    Admittedly, Im kind of an idiot when it comes to math and math concepts. Here is a graphic depicting what Im trying to do.

  • Ok, so I deleted the Spritefonts from the layout and the problem seems to have fixed itself. I'll need to play with it a little more to confirm it's gone for good or doesnt come back when I recreate another spritefont BUT things are looking up. Thank you BlackHornet for your solution.

  • There are no effects on the layer or in that layout. I am using Spritefonts though.

  • Hello and thanks for looking,

    I opened up C2 to work on this map and it's not the way I left it. Does anyone know what happened or possibly how to fix it? You can see that the outlines are where theyre supposed to be but the graphics themselves have been skewed. When loaded it appears fine.

    When I try to replace the skewed graphics with the same graphic from the Objects list, it too is skewed but so far, only on this layer in the layout. I cant grab the object with the mouse directly but I can grab it via its outline and it moves around in a diagonal motion.

    I loaded up a bunch of previous capx and this problem goes back weeks....I don't know what to do and Im worried I just lost all that work.

    Update: There's some hope....this skewing effect appears to only be happening on one layer in one layout. I cant simply copy and paste or send to layer, as either way the effect continues...BUT I can create a new layer and re-create the map via the Objects panel. Its a little bit of work but far less work than recreating almost 3 weeks of dev'ing. Fingers crossed it works.

    Thanks for your time.

  • Thank you RBuster and blackhornet for the replies.

    RBuster, I wanted to specifically thank you for not only leading me to an answer but by going above and beyond and creating a capx that was both simple and elegant. Being able to see what was going on helped immensely and I was able to apply it to my code with little trouble.

    Thanks so much.

  • Hello and thanks for looking.

    How would I go about assigning a random number to several items without repeating a number?

    Thanks for your time.

  • zenox98

    Wow, that's almost exactly what I wanted. Too bad there are virtually no game making actions involved....yet. I'm hoping the dev continues work on it. It's a great demo but could be an amazing tool.

    Thanks for the heads up.

  • Gigatron

    This is really nice. I was asking in the forum for a way to implement Code-in-Complete's js code based on Lou's Pseudo 3D Page and someone pointed me to this plug-in. You did an amazing job getting it into C2. It plays virtually identical to Gordon's original code.

    Are you still working on this? If so, are you going to be adding actions for actual game making?

    Thanks for your time. Stay awesome.

  • Hello all. Im trying to make an Outrun type of game and am having difficulties. I found a great tuorial on coding such a game but it's written in js and, admittedly, I'm a hack and have no idea what Im really looking at. Does anyone here know how to translate this to work in C2? Or what the basic concepts are? Thanks for your time.

    http://codeincomplete.com/posts/2012/6/23/javascript_racer_v1_straight/

  • Thanks, Chrisinfinger. I think that's the solution.

gamecherry's avatar

gamecherry

Member since 12 Mar, 2012

None one is following gamecherry yet!

Connect with gamecherry

Trophy Case

  • 12-Year Club

Progress

12/44
How to earn trophies