Actor destroys itself regardless of magnitude

I'm trying to get projectile attacks to destroy themeselves after say 150 distance from actor. I made the projectile have its slef magnitude be (selfx-playerx, selfy-playery).

When I put a condition for it to destroy itself if >150, it just destroys itself as soon as it appears for a millisecond, not even traveling 5 pixels. If I try anything else, it stays alive and actually lives long enough to loop around the map multiple times.

I'm trying to avoid using an actor outside the map that destroys any projectiles unless I can't find any solution that has the actor destroy itself either after a set distance or after a set a mount of time. If I go by time, do I have to do some special booleans tied to time before using it as a condition or would the raw game.time suffice? I kind of tried to use raw game.time but couldn't get it to work, only getting similar results in that the actor destroys itself automatically no matter what the >t is.

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @Franto it really is difficult to know what's going on without more info, but I'll suggest one thing: make sure that the self magnitude is constrained, i.e use a Constrain Attribute behaviour to the magnitude and use this figure as the condition when > 150.

    Other than that, I can't think what else it would be.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • FrantoFranto Member Posts: 779
    edited January 2014
    Hi, Gyro, thanks for them tips.

    Yeah, when in doubt, not the programs fault, turns out that the constrain attributes I had put on the player actor yesterday where missing since the game crashing before I saved up to that point. So although I had constrain attributes on the projectile itself, and the game attribute for player x and y where there, the actor themeselves had no constrain attributes, which led to the projectiles reading the scenes own xy instead of the actors. Didn't realize this till I had a text display behavior on the projectile show the numbers.

    Anyways, even after that, I had a new problem with the distance number being higher the greater the altitude on the map.

    But managed to fix it by removing the Y distance from the equation, since the actor counts shooting up as X distance anyway when they rotate. Text display pertaining to attributes on actors were really invaluable when trying to solve these things.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Excellent it all worked out for you, @Franto. Onwards and upwards, as they say. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.