facecrime's Forum Posts

  • Magistross oh, wow. I'm dizzy just looking at that. thanks!

    I'll need a minute to comprehend what you're even doing there, all that nesting!

  • Hi everyone,

    I have two strings, e.g. A = "apples,banana,orange" and B = "love,ignore,hate"

    I want to ask which number the word "banana" is in A and fetch that substring from B (here: "ignore")

    "Find" seems to give me the number of letters at which my substring begins, whereas "tokenAt" would let me fetch the entire substring, if I had its number.

    Can someone help out with the correct expression?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Gotcha, thanks for elaborating.

    I like that approach.

    Funny to think how much easier all this could be if C2 had simple editable arrays.

    • you can easily swap data - Dictionary1 load from JSON Dictionary2.AsJSON

    dop2000

    Oh, now wait - I missed that bit earlier.

    Do I get you correctly there, each enemy type could have an instance of the same dictionary via their container, hence the state machine can reference the variables/keys - since its from the same dictionary for everyone.

    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?

    Now that would mean rewiring the entire state machine to the dictionary, but it does sound great. If that's what you're saying?

  • dop2000

    And that's the thing, I do have multiple enemy types, all sharing a family, each with a container holding different sets of objects per enemy type.

    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. Plus I'd have to maintain each enemy type's dictionary individually, to eg keep them in identical.

    thanks for talking through this with me though, appreciate the input!

  • hey dop2000! yeah I was afraid so.

    I have enemies that have a rather large set of instance variables that define their behavior and how they go through a shared state machine. those are things like reaction ranges, fire rates, weapon type, etc, based on their archetype.

    To further make them more flexible i want to exchange the full set of instance variables, to basically swap out their entire behavior, like going from ranged to melee combat.

    The way i go about it so far is by swapping the enemy out for a separate object entirely, same enemy with different variable values. But that creates a huge configuration overhead that i'd like to get rid of.

    So i was hoping to just fetch those value sets from some kind of config table; i was looking into dictionaries, but found them unwieldy to set up and maintain for each archetype and all their variations.

    i now wanted to just use empty enemy objects for data storage, that via family would be easy to get set up and update. but not being able to reference them dynamically kinda breaks the concept.

    I've decided to go with a json table, which is at least somewhat convenient to edit and traverse.

    I'd be happy to hear about other ideas though! (Sorry for the long read ...)

  • Please tell me it's possible!

    I'm getting bad vibes when looking at similar posts ...

  • Hi everyone,

    I want use a function to change variables in Object A. The function is supposed to look up the value in Object B. For that I want to compose the variable reference from some strings, but I cant get the syntax right to have the function understand when it's a string and when a reference.

    Hope I'm making myself clear here.

    imgur.com/ZfncmIo

    btw how are images supposed to work now?

  • I'm enjoying the look of this!

    A cool visual style; makes me wonder at the same time if e.g. the enemies are discernably different enough to identify them?

    Does it all take place on the same map? How much playtime does offer?

    The music is a bit droning, i wish it were a bit more dynamic and create some excitement!

  • Looking good!

    How long did it take you? Did you do the graphics yourself?

  • Hi everyone,

    so in a function I want to pick an object A but then set a variable in object B that shares a container with A.

    I only have the UID of A, hence cant pick B directly.

    But I'd expect that when I pick A, the container automatically picks all container objects for me, no? So I should be getting the correct instance of B when i picked A?

    Am i mistaken?

  • Yeah, i did a similar thing, using a tiled background to create a bar of hearts (basically tiling a single heart)

    Depending on the amount of health the texture would grow wider and hence repeat multiple hearts.

    For empty hearts you'd simply have a another black heart texture beneath the red hearts.

    The black texure would reflect the amount of the health max, the red texture that of the current health.

    With the animation approach you'd probably need many variations to cover all the possible numbers full and empty of hearts?

  • you probably missed to add the mouse object to the layout?

    not the most intuitive step, but without that you shouldn't have mouse events available at all

  • Sure, the picking is clear.

    UID and IID both relate to instances of already created objects afaik. But I want to feed my spawn command object types.

    Can I have a single function that spawns various types of objects without using some bloated switch statement?

    Or put differently: can i have a spawn command that is fed by the parameter of a function?

  • Hi everyone,

    Is there a way to give a function an object as parameter in order for the function to execute a couple of actions on said Object?

    Along the lines of:

    call function "spawnEnemy" (heavyGunner)

    Action 1: Spawn param(0)

    Action 2: Rotate param(0)

    Etc...