AM_Games's Forum Posts

  • Hi senecaa

    to pick a random number you can use the code "round(random(0,3))"

    This will pick a random float between 0 and 3 and round it up to an integer (whole number).

    To round it down instead use "floor(random(0,3))". This will floor the number, essentially rounding it down.

    So, to make this work with your application, you could do something like:

    Global Variable XXXX
    Event - every 0.25 seconds & XXXX /= to 0 -> Set variable XXXX to "Round(Random(0,3))"     (This will set the variable 4 times per second)
    event - if XXXX == 1  -> SLIDER.SetPosition to (whatever your X/Y position 1 needs to be)
    event - if XXXX == 2  -> SLIDER.SetPosition to (whatever your X/Y position 2 needs to be)
    event - if XXXX == 3  -> SLIDER.SetPosition to (whatever your X/Y position 3 needs to be)
    
    event - Keypress SPACE -> Set Variable XXXX to 0 (this will stop the slider moving)
    [/code:3nnjazec]
    and then the rest of your events afterwards to control things like the message popup and restart the game.
    
    hope that helps.
  • Milupa5

    To easily change the colour of a sprite on the fly then use the effect "SetColor" or "Adjust HSL".

    If your sprite is black and white/Greyscale, SetColor lets you apply a blanket colour to it.

    If your sprite already has some colour in it, use "Adjust HSL" to modify the existing colour.

    You can modify the parameters for these effects through the event systems.

    These effects are expensive on mobile but should be fine if you don't overuse them.

  • Turaco

    Personally I work with Power of 2 sizes (16x16, 32x32, 256x256) etc and scale them in engine.

    This is a throwback from my days working with Unreal engine though, as it was more efficient to do it that way in the past.

    There's a decent article here on why P02 is best.

    https://www.katsbits.com/tutorials/text ... of-two.php

    Basically, using Power of 2 images speeds up loading and can solve a lot of performance problems due to the way 'most' games engines handle textures and how they're loaded into system memory

  • Sounds like you need to add in a secondary check to your script.

    Without seeing it I can't be 100% sure but from what you have said It seems the easiest way would be to add some more global variables and use them like booleans (true/false checks).

    When you run your character creation function, add in a check to see if your new variable is = to 0, if it is, then run the creation script.

    So, when you spawn a character you'd then have something like an "On Sprite Created" check and then set the secondary variable from 0 to 1 (for True) so that you're only spawning that character once.

  • Just thought i'd mention (totally offtopic) - I really like the mech design at the bottom of that shot you posted!

    Reminds me of the walker robots from the 80's Robocop movie

  • To generate random numbers in a variable you can use the Set Variable command and instead of putting a number in use the code "Random(START,END)".

    So presuming you want random numbers between 0 and 5, you would use

    Random(0,5)[/code:rejosrjp]
    However, this will generate any random float between 0 and 5, so it allows for things like 0.1, 1.5, 2.3, etc.
    to combat this you can add an additional parameter in.
    [code:rejosrjp]round(random(0,5))[/code:rejosrjp]
    this will round the float up to a whole number.
    0.4 becomes 1. 
    1.5 becomes 2.
    2.3 becomes 3.
    If you want to round the number down you can use:
    [code:rejosrjp]floor(random(0,5))[/code:rejosrjp]
    This will floor the number.
    0.4 becomes 0.
    1.5 becomes 1.
    2.3 becomes 2.
    In order to check if there is any repeats, you could store the generated number in a separate variable and then run a check after each number generation to see if it exists, if it does, then re-run the generation code.
    
    As an example, this is how you would set a text box to a random array value.
    [img="https://s27.postimg.org/48owzty9f/random.png"]
    
    Hope that helps.
  • Hello folks,

    I understand Web Storage is now Deprecated.

    So, I need to move the save/load system over to LocalStorage.

    Currently to save values i'm basically going:

    var int XXXX
    System -> Set Webstorage.LocalValue("XXXX")[/code:2qp5cg3q]
    To load that value, I'm doing the reverse.
    [code:2qp5cg3q]
    System -> Set XXXX to Webstorage.LocalValue("XXXX)[/code:2qp5cg3q]
    This works fine within browsers but presumably not for a desktop export with Node.
    
    I've checked over the LocalStorage knowledgebase article and it all looks roughly the same.
    
    Anything I need to be aware of before making the switch?
    
    Also, Where do the files for localstorage get written to, somewhere in AppData?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • After reading your thread TheRealDannyyy I would say that's exactly what it is!

    Guess there isn't a whole lot to do about it other than remember to save frequently in different files

  • This looks excellent! Normally i do bools with a global using 0 or 1 but nice to have a true/false and not pollute the event sheets.

    Whats the deal with using this as part of a commercial release?

  • Hello folks,

    Not really a bug or anything properly reproduceable however i'm having some issues with project files corrupting when the editor has been open for a long time or a lot of single file saves have been done.

    Basically, if C2 has been open for 4+ hours and a lot of iterative saves have been created I seem to be having some corruption issues, as per below screenshot.

    You'll notice from the file size and timestamps it's not saving the data to the single file yet all items are still accessible in c2.

    On close of c2 and re-open to try and load the file it throws a corruption error. This happens across 2 PCs so pretty sure it's not a HDD corruption issue, just seems to be when the editor has been open for a long time and has created multiple previews & saves.

    Any ideas?

  • never had any problems with Cocoon JS compiles on android platform.

    Performance is related to a lot of things though, from memory CocoonJS doesnt handle WEBGL effects very well but really the things that'll kill performance on mobile are large sprite sizes (512x512 and above) and events that happen often (on tick or quicker than every 0.1 seconds).

    Probably someone more knowledgeable will be able to offer advice on the other compilers though.

    Currently slogging through GTA V on xbox one. Bought it in the sale last week because GTA Online is meant to be amazing, frankly i'm a bit disappointed with it. Single player is great though!

  • What attracted me (well, the company I used to work for) to C2 in the first place was it's ability to build games for Ouya and quickly export to android & windows platforms for testing. This simply isn't a feature i've come across in any other game engine.

    Personally, what I would want as an evolution to the Construct family is being able to package and export an APK from within C3, maybe even sign it too so it's ready to go instead of having to mess around with .BAT files to generate keys and run files through CocoonJS. For creating a desktop game, why not have a 'wizard' creator where you can select splash screens and game icon before compiling too and the backend does all the hard work?

    Anyway, my point is that 10 years ago games design, creation and publishing was prohibitively expensive and difficult. If Construct is aiming to be the "games engine for everyone" then the focus should be on making it as easy as possible to get your content out there to as many people as possible.

  • Hello folks,

    Been a while since I've been here so here goes:

    I used to work for a games company, we had a publisher, so basically we made games in house, passed them onto the publisher and the publisher just sorted distribution on steam/mobile/whatever.

    What i'm getting at is: i've got 5 published titles under my belt but i've never even been in the same room as a publisher.

    Jump forward to today:

    I've been out of the games industry for about 2.5 years now and work in Sales instead since the pay is better and more stable.

    Essentially i've got a prototype and 2/3 of a game with 'mostly' final art that I want to put out there and earn something on the side.

    The Question:

    At what point do I approach a publisher?

    I've been looking at going through Team 17 (a uk Indie publisher) but should I approach them with a finished product or start looking for a meeting now?

    It' seems much easier to self publish now with steam greenlight etc however it seems expected that you'll offer aftersales support etc and be involved in the community if you go that route and well, i've no intention of leaving my day job so there's no realistic way i'd manage that (hence looking for a publisher instead).

    Any advice appreciated.

    cheers,

    Matt

  • I do! Licence is through the business but not linked to my account

    News to me if you can kick out to Android without one