dop2000's Forum Posts

  • How is it different from what I suggested? You first create a "database" of states either with constants or a dictionary or some other data storage method.

    Then in the layout editor you initialize your instances with state code names - "STATE_RUN", "STATE_IDLE" etc.

    And then in runtime you lookup actual values for each state code in the dictionary or from constants using a bunch of "if" events.

    .

    Or do you mean you want to select values for object's instance variable from the list, rather than type them?

  • I don't understand what you are trying to achieve.

    You have a gazillion of actions like "Bullet set angle of motion to Bad.angle+N", but your Bad.angle is always 0, because it doesn't rotate. So when you add 80 or 90 degrees to it, the bullet flies down, as it supposed to.

    If you want to aim at the player, you need to set angle of motion to angle(Bad.x, Bad.y, Player.x, Player.y)

    Or, since you have "Set angle=Yes" setting on your bullet, you can simply use "Bullet set angle towards position Player.x, Player.y"

  • You can create a bunch of events like this:

    If Character.State="STATE_RUN" -> Character set State to STATE_RUN

    Unfortunately, there is no other way to access variables by their string name.

    .

    Also instead of the constant variables, you can use a dictionary:

    Key="STATE_RUN", value="run"

    KEY="STATE_IDLE", value="idle"

    Character Set animation to StatesDictionary.Get(Character.State)

  • Construct 3 r104 on Windows 10 laptop with touch screen.

  • Your code is pretty messy.. Why didn't you use any of the suggestions from your previous post?!

    Anyway, here is my version, hope it helps:

    dropbox.com/s/a8oi9mxwmzo2g5c/rampancy_dop.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just check if this blue area is already overlapping an existing turret (inverted condition).

    Blue area is NOT overlapping turret -> Spawn new turret

  • 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.

  • 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.