dop2000's Forum Posts

  • Bump!

  • So you have "myhealth" variable defined on each of the 6 enemies sprites, and "health" variable defined on the family. Is this correct?

    If you have "health" variable on the family, why do you keep "myhealth"?? Just remove it from all family members and only use "health" in all events.

  • I'm too against using triggered events in sub-event.

    But this does look a bug - triggered or not, events under Else should not be executed.

  • , From the description, it's a very cool plugin! But as I understand, for different games results will vary greatly.

    Would you consider making a lite/trial version of it - stripped of most features, and with values for Canvas++ and Custom++ limited to, say 50% and 0%? It will help to understand what level of performance increase I can expect from the full-priced version in my particular game.

  • Every Ads provider allows you to set filters, where you can block unwanted content. Why do you need to edit this in JS code? I think this can easily get your account banned.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Tom, here is a small bug I noticed - "code" tag affects text width in the rest of the message:

  • each enemy type could have an instance of the same dictionary via their container

    No.. Since you have several enemy sprites, you can't add one dictionary object to their containers. You will need several dictionaries (one for each enemy type), and this will only make things more complicated.

    What I suggest is that you don't add the dictionary into enemies' containers. You create one dictionary object "Stats", add an instance variable "Enemy_UID" to it. Then do this:

    On EnemiesFamily created 
     -> Create Stats
     -> Stats set Enemy_UID to EnemiesFamily.UID
    

    And now you have an instance of Stats for each enemy instance, linked by Enemy_UID.

    If you need to access Stats dictionary for any given enemy, you will need to pick Stats instance first using an event like "Stats compare variable Enemy_UID=Orc.UID". It's a bit inconvenient, but as I said, you can create a couple of helper functions for this. For example, you call "GetEnemyStat" function, pass two parameters - Orc.UID and "health" - and it returns health value of this orc.

    .

    I'd load the enemy type's data into it upon spawning, and also swap the data per instance when needed?

    But where would I store and edit the different configurations before loading them into the instances? I would still need an external json file, right?

    Yes, if you need to load some default stats data into every enemy (like base health, damage, speed) you will probably need to create a bunch of JSON strings. Or you can use some other data storage, CSV table for example.

  • Create a sprite MyCheckBox, add an instance boolean variable FullScreen. Add two frames to this sprite, set animation speed to 0.

    Then do this:

    Mouse on clicked MyCheckBox 
     -> MyCheckBox toggle boolean variable FullScreen
     -> MyCheckBox set animation frame to self.FullScreen
    

    Since boolean "true" is 1, and boolean "false" is 0, then the animation frame will be set either to 1 or 0.

  • What do you mean by the "original way"? Are you talking about the "Touch: zooming" template in C3? I just tried it and it works fine for me.

  • Checkbox is a Form Control, and as all form controls it's rendered above the canvas.

    Checkbox is a pretty simple object, you can easily make your own version with a sprite. Add a boolean instance variable, on click change the variable and animation frame. That's it!

  • I was considering dictionaries, but if i want a centralised way of exchanging the enemy configurations - not a massive switch statement with each variable of each type listed - I'll end up in the same situation, wanting to map dynamical references to enemy variables.

    I don't quite understand. Say, you need to swap Orc's configuration with Zombie configuration. You don't need any switch statements, you can do this literally with two simple actions - just re-assign Orc's dictionary to Zombie and Zombie's to Orc.

    Plus I'd have to maintain each enemy type's dictionary individually, to eg keep them in identical.

    I'm not sure if I explained it correctly - you will only need one universal dictionary object for all enemy types. On creation of any "Enemies" family member, you spawn a new Dictionary instance and "attach" it to the enemy instance. You can also create a bunch of helper functions for getting/setting values in the dictionary, for easier management.

  • It's probably because both your mouse on click events are triggered, and the fridge opens and immediately closes. Change them to this:

    Mouse: On Left button Clicked on Fridge
    
     Fridge: Is animation "Closed" playing -> Fridge: Set animation to "Opened" 
     
     Else -> Fridge: Set animation to "Closed" 
  • I would recommend using a dictionary. Hear me out:

    You need to assign each instance of Enemy its own unique instance of dictionary. If you have only one Enemy object, it's super easy - put the dictionary and enemy objects into the same container. If you have multiple Enemy objects in a family, containers will not work. You'll have to "manually" create a dictionary instance and link it with enemy instance, for example using Enemy_UID instance variable.

    .

    Dictionaries have a few advantages over instance variables:

    • they are expandable, add as many keys as you need
    • you can access keys using strings - that's what you want!
    • you can easily swap data - Dictionary1 load from JSON Dictionary2.AsJSON
    • it's easy to save them in local storage
    • etc.