GML [SOLVED] Can Path_Add cause slowdown?

Discussion in 'Programming' started by Dr_Nomz, Dec 6, 2018.

  1. Dr_Nomz

    Dr_Nomz Member

    Joined:
    Oct 31, 2016
    Posts:
    377
    I asked earlier about mp_grid slowdown, but now I'm wondering if this could cause slowdown if the path is "added", and then never deleted. (Or does it delete itself upon the instances destruction?)
     
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    3,243
    Do you think they added this line to the Manual entry for path_add() just for fun, or is there a serious point to be made here?
     
  3. Dr_Nomz

    Dr_Nomz Member

    Joined:
    Oct 31, 2016
    Posts:
    377
    Okay in that case, how about this?
    Code:
    if HP <= 0{
      with(planner){
      path_delete(path);
      instance_destroy();
      }
      instance_destroy()
    }
    The Planner being the object that the zombie follows, which creates the path in the first place.
     
  4. RefresherTowel

    RefresherTowel Member

    Joined:
    Jul 13, 2016
    Posts:
    667
    Yes, if everything in your codeblock is named correctly, that should work fine.
     
    Dr_Nomz likes this.
  5. Dr_Nomz

    Dr_Nomz Member

    Joined:
    Oct 31, 2016
    Posts:
    377
    Alright thanks for all the help guys. :D
     

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