Funky Koval's Forum Posts

  • Looks like the workaround I posted does not work every time... Seems to be rather random. If you keep switching Families and Family members around, it will eventually allow you to set parameters, however "eventually" can be the next switch or a very long time.

    Also on opening the .cap again, the Effect parameters will not be visible in the Event View - the Action will simply say "ObjectName:", copying and pasting it will result in the copy having the proper text, like "ObjectName:SetParameterToWhatever".

    I'll post under the R2 release thread in Discussion... Perhaps someone involved with coding will chime in - I've looked throught the Effect shader files and the issue seems to lie in Construct.

  • I know this is an old topic, but I've run into the same issue and managed to sort-of find a workaround...

    To make the Effect parameters appear, first create the Action using a Family member instead of the Family. Then, after the Action is created, modify it and replace the Family member with the actual Family. The parameters will not disappear.

  • sendspace.com/file/asz5u9

    As you can see in the .cap, either an Ex or a Cross, belonging to the Terrain family is created and paired to either a Rectangle or a Circle (members of the MapTiles family), based on the 3D_ID private variable.

    The problem is that to perform an action on a given pair, I have to call one of the pair member explicidly, otherwise all of the family members will get affected. Is there any way to rectify this? The disabled event is what I thought would work...

    Thanks in advance.

  • As lucid said, or altrnatively Angle(0,0,Object[Physics].VelocityX,Object[Physics].VelocityY)

  • Put a Spring on the other side of the door, connected to the wall and increase the spring constant (k) whenever you need the door to "lock".

    For checking if the door is locked , you can simply check the value of the constant. A nice side effect is that, at lower values, you'll get an auto-close door.

  • Is the code in the cap yours or are you adapting someone elses example?

    The enemies move constantly because of the events that adjust the speed of the sprites - the RTS behaviour works against that, thus creating a loop.

    Once these are disabled, the enemies stop eventually, but not close to the player - your grid size is set to 60 pixels - as soon as the enemies get within 60 pixels of the cell the player is in they will stop.

    Lower the grid size for more precision, but not to less than the enemy size - if you do, the enemies may stop moving at all due to the way the grid is calculated.

  • sendspace.com/file/xobe0a

    I switched the RTS behaviour from Custom to Avoid "Solid" and made Sprite and Sprite4 have the Solid attribute. Based on the way your game is set up, do not give Solid to the actual character sprites. Since they overlap the red sprites, they won't move, as to RTS, they are in a blocked cell.

  • Ah, I see the issue. I've run into it before...

    It seems that custom obstacles don't work reliably/at all...

    Switch the Pathfinding type to Around "Solid" and give Sprite4 the "Solid" attribute. If you need to toggle the collision, remove the attribute when needed via System actions and regenerate the pathfinding grid.

  • One of the RTS actions should be "Set Object Type To Avoid" - that will make the character avoid the object and its instances. AFAIK, you do not need to refresh the pathfinding grid for it to work.

    You could also alter the RTS behaviour manually based on distance checks to have avoidance, but I prefer the first method - much simpler...

  • I have an effects chain consisting of Distort Normal and NuovoFill.

    The issue appears only if NuovoFill is in Additive or Multiply mode - Raw Color is fine.

    When the NuovoFill color is not modified during runtime, it tints the underlying Distort Normal properly. However, if I change the tint color during runtime, the Distort effect gets shifted according to what particular color I choose.

    For example, if I set NuovoFill to Multiply red (255,0,0), the distortion will be proerly positioned and tinted. However, if I change the color during runtime, even to the same red, the distortion will shift to the left. If it's green, it will shift upwards. It's like the tinting gets multiplied over the original sprite texture, changing the normal map and in turn causing Distort to shift it. The effect is not cumulative, so if I do a color change to red again, it will not shift further.

    I hope this makes sense. Is there any way to rectify this behaviour? Thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you. Yes, this is exactly what I'm after.

    And this method is similar to the alternative one I wrote...

    Now I see that the "precision" problems I had weren't really related to accuracy - unlike you, I was calculating the distance without regard to the "Player" heading, which was throwing my results off.

    Again, thank you.

  • I'm trying to create a system, where a bunch of equally-spaced "Line" sprites keep their distance to a "Player" sprite and constantly face it, except when the "Player" moves forward/backward relative to its heading - then the distance will increase/decrease.

    I have a system working, using 0,0 as a reference point by which all the distance data is calculated... Problem is it only works in the 0-90 degrees range of "Player" angle.

    I believe that I need to flip the reference point horizontaly/verticaly/both based on the "Player" angle, but as to how eludes me.

    Here's a zipped .cap file is anyone would be willing to help out - much appreciated.

    The data for the "Line" spacing and the maximum distance a "Line" can be at before being put back at the beginning of the sequence is inside the Data text object as a private variable. Each "Line" also has a Distance variable which stores the distance for the current loop, for final position calculation.

    sendspace.com/file/c2el80

    As a footnote, I had a second system for achieving the same result which used a delta of previous and current "Player" positions to calculate the distance change, but I ran into precision problems - so I hope to use this approach, with your input.

    Thanks.

  • R0J0hound

    Yup, understood, but this is similar to what I have and am trying to avoid - multiple SetArray sequences with the only difference being the object referenced.

    The UID option might work though, iterating through Family members, but using the UID as the object identifier to pick up the data.

    Thanks.

    Jayjay and Yann

    Noted, thanks. I've ran into a similar issue - i needed to calculate the point of intersection of a line and an elipse centered on each of my object instances...

    No crashes, but it halved my framerate when dealing with only a hundred or so objects.

    lucid

    I didn't know about this shortcut - thanks.

  • Thanks for the reply.

    Yes, I'm aware of how functions work. What I have are multiple objects with multiple instances - that's why I thought of this kind of substitution. Using families does not help - in fact, it crashes Construct randomly...

    In general, I find families quite finnicky for more "complex" operations - I mainly use them to assign private vars to many objects...

  • In my .cap, I have a lot of objects whose properties I need to store in a array, something like Set Array(1) to ObjectA.X.

    Right now for each object, I have a long list of these and the only difference is the object they reference.

    What I'm trying to do, without luck, is to call a single function which picks these parameters and to change the object called using function parameters. Something like:

    Function: Add Parameter "ObjectA"

    Call Function "Properties"

    On Function "Properties"

    Set Array(1) Function.Param(1).X

    Set Array(2) Function.Param(1).Y

    So that Function.Param(1).X becomes ObjectA.X

    I'm guessing there a problem with the syntax, but I can't figure it out.

    Help would be most appreciated.