1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Trouble assigning variables to instances.

Discussion in 'Programming' started by Omninaut, Mar 8, 2018.

  1. Omninaut

    Omninaut Member

    Joined:
    Nov 11, 2016
    Posts:
    4
    (Solved then had new problem with new code)
     
    Last edited: Nov 30, 2018
  2. RollyBug

    RollyBug Member

    Joined:
    Feb 23, 2018
    Posts:
    38
    May sound dumb, but does changing "damage" to "obj_damage" do anything?

    Also, welcome to the forum.
     
  3. Omninaut

    Omninaut Member

    Joined:
    Nov 11, 2016
    Posts:
    4
    Thank you!
    I have tried that, It works but I'm trying to avoid it because the variables have to change per instance. The issue is if multiple enemies attack or the player attacks while something else attacks, there could be multiple instances of the damage object and it changes the variables for all of them. So sometimes it crashes because 2 things are assigning different variables to 2 objects simultaneously. Other times one object wins the tug of war and the damage object ignores the other which results in things like an enemy being attacked twice when the player only attacked once, because the enemies own damage object damaged itself because the player won and the enemies damage creator is now the player. its a clusterf*** haha
     
  4. RollyBug

    RollyBug Member

    Joined:
    Feb 23, 2018
    Posts:
    38
    Come to think of it I misread part of your code. This is definitely an interesting way to go about it. Could you show a pic of the exact error message you get?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice