• 0

    posted a message on Unit revive overrides properties

    Thanks, that was it.

    Posted in: Data
  • 0

    posted a message on Unit revive overrides properties

    Hello,

     

    first of all, im quite new to the Galaxy editor, so excuse me if this is a totaly stupid question, but i was not able to find any solution.

     

    Im currently developing a map with a hero system (like MOBAs) where whenever the hero dies he gets respawned after a short delay.

    For my hero i created a new unit based on Zeratul, as well as a new actor based on the Zeratul actor as well. I modified the Zeratul Unit slightly, I removed the Cloaked unit flag and added the permanently cloaked ability. To enable the respawn after a delay I also set the Death Time to -1.

    I've also set the Enabled While Dead behavior flag for permanently cloaked.

     

    Now everything works fine after the initial creation of the unit and when it dies, it gets respawned. But then Zeratul does not have permanently cloaked anymore, but is still cloaked, as if the cloaked flag was set. Furthermore, when the unit dies again i get the same error as i would if Death Time was 0 (default for Zertul, which i changed).

    When i disable the delay for respawn, it can respawn multiple times(as it should with Death Time 0).

     

    So for me it seems like i've got the original Zeratul back after respawn.

     

    Does anyone of you know how to change this to have the same unit after respawn?

     

    With best regards,

    Warfley

     

    PS:

    The error Window is as Screenshot attached.

     

    My revival code is for the Hero Dies trigger (simplified):

    void RespawnPlayer(int p) {
      unit Hero = Players[p].Hero;
      int PID = Players[p].PID;
      point Spawn = PlayerStartLocation(PID);
    
      UnitRevive(Hero);
      UnitSetPosition(Hero, Spawn,  true);
      UnitControlGroupClear(PID, 1);
      UnitControlGroupAddUnit(PID, 1, Hero);
      libNtve_gf_SwooshCamera(PID, 45.0, 45.0, Spawn, 0);
    }
    
    bool OnHeroDied(bool testConds, bool runActions) {
      int Player = EventPlayer();
      point Spawn = PlayerStartLocation(Player);
      if (!runActions) {
          return true;
      }
      TimerStart(Players[Player-1].RespawnTimer, 10.0, false, c_timeReal);
      libNtve_gf_WaitForTimer(Players[Player-1].RespawnTimer, 0, false);
      RespawnPlayer(Player-1);
      return true;
    }

     

    Posted in: Data
  • To post a comment, please or register a new account.