jwilkins's Recent Forum Activity

  • You need to identify (Pick) specific instances of objects.

    If for instance you wish to pick the pinned cat of a hitbox, you can do so with cat.pin.pinnedUID which returns the UID of the object pinned. Using this with the "Pick by comparison" condition will let you identify specific objects and all subsequent sub events will occur only to that pinned instance of the objects.

  • You can use the container suggestion earlier, but I also don't understand why you wouldn't use the Pin Behavior instead of updating the X,Y every tick? Add the pin behavior to your "fanatico" and then on creation of your hitbox have it create and pin the fanatico to itself.

  • I'm making a platformer with multiple lanes by using Colludium's Platform2 Behavior. This makes collision events a little different.

    When the player jumps or is thrown into the air they need to create a shadow sprite that follows their X position and is destroyed when they land. That stuff is all easy to setup, no real concerns there.

    Where things get difficult is adjusting the Y position of the shadow sprite object based on the highest Y position of any solid object underneath the player.

    Additionally, the Platform2 behavior utilizes collision masking, meaning there are multiple layers of platforms in my game so we also want to ignore the layers not currently in the same "ZLane" as the character casting the shadow.

    Ideally this solution also can account for dozens of these shadows being cast at a time, as I would like the non-player characters to cast them as well (so long as they are on screen of course).

    I've tried a couple approaches to this but nothing has worked to my satisfaction thus far. I really do want shadows in because it helps the player know what lane theyre in and where they can expect to land.

  • Hmm, I think I see what you are doing. I hadn't thought to use the dictionary object, that thing is much easier to organize than arrays, maybe that is the best way to go about this. Thanks for the food for thought!

  • That is very similar to the setup I am looking at relixes. In your case, what do you plan to do for enemies that have no weapon associated with them? This is of course assuming you plan on adding enemies like that.

  • So bear with me here, this is more a question of a best practices, and it's also going to get into the weeds a bit. I'll outline the issue, then outline the options I know of, along with their pro's and con's. Please read the whole post if you have a suggestion.

    I'm making an action RPG. Prototyping is going really well! Because the sprites are very simple 2D pixel art, attack animations utilize paper-dolling techniques where I overlay a weapon sprite animation on top of or underneath the player. This function extends to all humanoid enemies as well. Because I want the player to be able to play as and/or recruit any of the creatures they come across, player objects and enemy objects are functionally the same. This is also helpful for/required for other gameplay elements. Players and enemies are all grouped under the same Family I'll refer to from here as "Character Family".

    So far this has worked really great! Originally I was pinning the weapon sprite to the Character Family sprite, and then storing the information for the attacks (range, frames where collision detection is necessary to register hits, knockback values, etc) inside those weapon sprites.

    Then I hit my snag: This only works for Character Family sprites that use weapons. I have plans for other Character Family sprites (creatures for instance) to not use weapons, and instead call attack animations from their sprite sheet. I can't store all the information for those attacks in an object that they won't have pinned to them.

    Here are the options I have come up with so far:

    1. Store all the instance variables for the weapons inside the Character Family instead, and update them when appropriate. This is going to heavily bloat my Character Family instance variables, so I'd like to avoid it. Right now human players only have 2 attack animations per weapon, but enemies without weapons could potentially have more, which adds up quickly considering how many values each attack needs to store.
    2. Create "dummy" weapon objects for creatures. The brute force method for doing this would be to create invisible dummy weapons for each creature, but I could easily modify this to instead point to one weapon per enemy attack. It's inelegant but it does keep things relatively well organized.
    3. Store attack information in an array. This is the obvious one, but it too has some setbacks I can't get around. Specifically, I am trying to automate as much of this work as possible, and as such having been using families and functions a LOT. But if I want to attach an array to an objects container, I can't do so within a family, so I can't reference it easily (unless I can and I just don't know how).

    Any help here would be appreciated, and I'll try to explain everything else around this better if needed.

  • Having a lot of success implementing this plugin but I did notice 2 errors, the first occurs when you disable then enable the Platform2 behavior:

    Javascript error!
    ReferenceError: inst is not defined
    http://localhost:50000/Platform2_behavior.js, line 1583 (col 5)
    
    This may be a bug in Construct 2 or a third party plugin or behavior - please report it to the developer following the bug report guidelines. Subsequent errors will be logged to the console.[/code:2ypwkcqz]
    
    The second occurred when trying to edit the Collision Mask values of Solid2 objects when those objects are created:
    
    [code:2ypwkcqz]Javascript error!
    ReferenceError: value is not defined
    http://localhost:50000/solid2_behavior.js, line 140 (col 3)
    
    This may be a bug in Construct 2 or a third party plugin or behavior - please report it to the developer following the bug report guidelines. Subsequent errors will be logged to the console.[/code:2ypwkcqz]
    
    Neither are project breaking for me but I wanted to document them here, this plugin is still amazing!
  • Oh my bad, thats not actually my game, I was just using it to explain how the lane mechanic works in it as theyre similar, my game is not nearly at that stage of polish yet.

    I purchased the behavior and am in the process of implementing it now, I'm having some trouble making sense of how to filter the collisions though. Do platform2 objects and solid2 objects only interact with objects of the same collision mask or collission category? I've tried that but it's not filtering them yet. What do I need to be doing to get that work?

    EDIT: I am fairly certain based on the tool tip information provided that objects with the Platform2 behavior are only meant to interact with other Platform2 or Solid2 objects with the same Collision Category or Collision Mask, but this is not happening, all of Platform2 objects interact with all of the Solid2 objects regardless of the category or mask value

  • This looks perfect for my project, currently I am using a modified platform behavior that checks for collisions based on layer, but it's old and I recently ran into a major issue with it where it doesn't appear to take simulated controls from a gamepad.

    I have a couple concerns specific to my game though. The project is a beat-em-up that uses a lane-depth system similar to the game Viking Squad (there is the illusion of depth like most beat em ups, but you are locked to a specific lane rather than free Y movement):

    So I need multiple instances (players and enemies) to only interact with the collisions of their current lane.

    Would this behavior support that?

  • Thanks I will definitely take a look at that.

  • Did not actually know that text in construct2 was handled that way, but I assumed as much regarding the sprites.

    Let me try asking the question this way: If I want to draw a rectangle in my construct project that is then styled through CSS, how would I do that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I know that I can use CSS to style buttons and entry fields. No problems there. But lets say I want to have design elements like squares be styled? Usually I would use a sprite or tile or tileset, but if I want to style them through CSS this isn't really an option from what I understand.

    Additionally, is there anyway I can style text through CSS in construct2?

    Thanks!

jwilkins's avatar

jwilkins

Member since 17 Dec, 2016

None one is following jwilkins yet!

Trophy Case

  • 7-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies