Any way to make a clone of an instance? Or rerun their instance creation code?

Discussion in 'Programming' started by jannycorp Inc, Sep 12, 2019.

  1. jannycorp Inc

    jannycorp Inc Member

    Joined:
    Jul 4, 2019
    Posts:
    5
    I'm trying to make respawnable enemies for a Mega Man game. I have some unique properties stored in some of their instance creation code that is required to execute for the enemies to run correctly.
    The problem I'm trying to solve is just to reset each enemy with their "post-instance creation code" status.

    I know there's no way to do an event_perform or similar of the instance creation code, so I thought to deactivate all the enemies on their first step event, and then make a deactivated clone copy of them since they have now ran their creation code. I thought instance_copy could do this but I am unsure if it's possible.
    Then, once the original enemy has been destroyed, it would make a copy of the copied enemy to use as a "respawned" enemy.
     
  2. jannycorp Inc

    jannycorp Inc Member

    Joined:
    Jul 4, 2019
    Posts:
    5
    Oh nevermind, turns out I should have tried finishing my idea before posting here. From my short testing this seems to work, but if there are any oversights or a better way I'd appreciate if you could let me know. upload_2019-9-11_21-8-14.png
    upload_2019-9-11_21-8-39.png
     

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