StijnDijkstra's Recent Forum Activity

  • Oh wow, of course that is the solution. What an oversight on my part, turns out working after midnight is not the best for my brain.

    Thanks a lot!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hey everybody,

    My description is kind of vague, but I will try to explain.

    I have a local-multiplayer game where all characters are controlled via different controls. These controls are stored in their instance variables.

    I have movement and such all worked out, and they function by checking whether a button is currently pressed down. However, the "on button pressed" event which I want to use for attacks functions differently (as expected).

    The issue is that I have multiple characters ("Body" in this case) that all have their own attackKey. When I create an event that listens for an "Body.attackKey" to be pressed, it chooses a random Body and listens only for that specific keypress and only attacks with that specific Body.

    In my movement script I solve this by encapsulating everything in a "For each Body" loop, so that all the references to "Body" reference the same instance. This does not work in this issue because it is a triggered event so it does not work in a loop.

    So to be clear, I want to be using "on key pressed" because I don't want the player to be able to hold the key down to attack automatically.

    I am not really sure how to solve this issue in a non-convoluted way, so I would appreciate any help.

  • Thank you for the quick reply.

    I assumed this would work, but it seems like a very roundabout way of doing things.

    I found some other commentary on this in older forum posts, and I am just wondering why it isn't yet possible to create a template object, as it seems like quite basic functionality.

    Is there any particular reason for not allowing devs to change the Initial Variables?

  • Hey there,

    I have started working with Construct 3 a few days ago. I already have experience with Unity but wanted to try Construct.

    I am attempting to recreate a small local multiplayer game that I made in Unity. However, I am running into issues with creating player objects.

    Specifically, I want the (2-4) players to be able to choose a character and then want to instantiate those characters in the next layout, then I want to be able to identify which player is playing which character (for control purposes). However, I just can't find a proper way to do this.

    For context, in Unity, I did this by creating a static array of player objects and filling it with objects created from prefabs during runtime. That allowed me to just do Array.get(0).simulateControl("left") for example (this is pseudocode just to illustrate my intention).

    One option I thought about was to store the UID of the created character object in an array and then later find the object with that specific UID and execute a simulateControl on that object. However, then I still run into the issue of not being able to set the default values of that object, since the first instance is created at runtime.

    I am just wondering what the proper way to do this in Construct 3 is and if there is functionality that is similar to prefabs.

    Thanks in advance.

StijnDijkstra's avatar

StijnDijkstra

Member since 14 Jun, 2021

None one is following StijnDijkstra yet!

Trophy Case

  • 3-Year Club
  • Email Verified

Progress

4/44
How to earn trophies