ome6a1717's Recent Forum Activity

  • I'm trying to spawn objects on my NPC family and I can't get the actions to work. This is what I'm using:

    For Each Object

    "Compare 2 values: Object.Pin.PinUID = NPC(family).UID"

    ______action_______ "set value of NPC.Variable to Object.Variable"

    Is it because I'm using a family?

    Any help would be appreciated. Thanks.

  • Thanks for capx, GT88, but it still had the same issue when you add a global variable.

    I've figured another way to do it spawning a sprite on each enemy and setting the variable when the player overlaps it instead of using a distance command. Thanks, guys!

  • My capx has gotten a little too large to share, unfortunately. I've searched every event sheet for the variable, and this is really the only place it is affected. If I use the same exact lines of code but switch the NPC family (in the distance event) for a single sprite, it works perfectly fine.

  • Sorry - that's a typo. It is actually distance(Player.X, Player.Y, NPCS.X, NPCS.Y)

  • I'm trying to use a family for my npcs to simplify certain events, and I'm having trouble figuring out a way to do this line of code:

    For each NPCS (family)

    • distance(Sprite1 & Sprite2) < 100
    • - (action) - - Set Variable to 1
    • distance(Sprite1 & Sprite2) > or = 100
    • Trigger Once While True
    • - (action) - - Set Variable to 0

    So if there are multiple NPCS on the screen, it's always calculating that the player is > 100 pixels away from at least one of them, so the variable is always set to 0.

    If I switch the family for any sprite, it works fine (for obvious reasons). Is this something you can't do with a family?

  • Thanks, Ashley! So it would be okay if I chopped the environment images up into little pieces and used other sprites for environment objects (ie trees, rocks, etc.)?

  • Does Construct 2 only render what is on the screen, or is it rendering everything off-screen, as well?

    The reason I ask is I'm working on an rpg/adventure game that we're preparing art for, and I really want to stay away from tileset art and have more "varied" and less square-like environments.

    If it does render everything, what is the best way to do this?

  • Fortunately, I figured out a different way to do it using the Bullet behavior.

    I set an event "If Bullet speed > 0, change speed to Sprite.Bullet.Speed-5 every tick" to create a fake "lerp" effect.

    I am still curious if there is a proper math equation to calculate Coin.TargetX & Coin.TargetY based on the angle between the object and you if anyone knows of one.

  • Hey Vee,

    That's how I'm trying to do it currently, but I'm having trouble figuring out how to calculate Coin.TargetX & Coin.TargetY.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would, but I want to do it with the lerp effect so as it moves away, it progressively gets slower.

  • I'm trying to figure out a way to lerp an object in the opposite direction of the player a couple hundred pixels, but can't seem to figure out if it's possible.

    Currently I've created instance variables on the lerping sprite as SpriteX & SpriteY, and also an AngleToPlayer isntance variable as angle(Player.X, Player.Y, Sprite.X, Sprite.Y), but I can't figure out how to set the spritex & y instance variables -/+ 200 pixels based on the characters position.

    In lamen's terms, I'm trying to make it so when you kill an enemy, a coin spawns on them and slowly moves away from your current position stopping in 100-200 pixels.

    Any help would be greatly appreciated.

    Thanks!

  • UPDATE:

    Got it working. My issue was trying to load "Array" instead of WebStorage.LocalValue("Array").

    Thanks Xavier and Vee!

ome6a1717's avatar

ome6a1717

Member since 12 Feb, 2013

Twitter
ome6a1717 has 3 followers

Trophy Case

  • 11-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies