"Monster Return"

Frunck

New Member
Reaction score
0
I'm currently working on a rpg, and I was wondering how to make it so that when creeps lose interest in you and run back to thier spawn point, they turn invurnable and get fully healed, then turn vurnable again when they reach thier destination?
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Maybe you can try ordering them to move back after reaching a certain boundary like

Event: A unit leaves region

And then put in the triggers there, Set life to 100%/make invulnerable. And when it reaches the spot where it started, a region, make it vulnerable.

Otherwise, if its possible, find out how far they would chase you and then if they run some distance heal/invulnerable?

I'm not too sure so I'm just giving suggestions.
 

azareus

And you know it.
Reaction score
63
They chase you to their guard distance.
You could make a trigger to find out when they go to the edge of their guard distance, the place they go back, and heal/invulnerable-ise them?
 

Frunck

New Member
Reaction score
0
I'd like to refrain from creating multiple regions for every creep.. I already have a point saved for every creep location through my respawn system. I just don't know how to make it return after getting too far away :<
 

azareus

And you know it.
Reaction score
63
It does that automatically, you just have to set the guard distance (found in gameplay constants) to whatever you want.
 

Frunck

New Member
Reaction score
0
Yeah I changed it, but how do I detect when the creep reaches the limit of it's guard distance?
 

azareus

And you know it.
Reaction score
63
Something like:
Trigger:
  • Back
    • Events
      • Time - Every 0.10 seconds
    • Conditions
    • Actions
      • If/Then/Else Multiple functions
        • If
          • Distance from SpawnedUnit to SpawnPointVar greater than or equal to INSERT GUARD DISTANCE
        • Then
          • Actions
        • Else
          • Actions
 

Frunck

New Member
Reaction score
0
Wouldn't that require preset variables for every creep? And that wouldn't work since fresh creeps respawns when the old dies.
 

millz-

New Member
Reaction score
25
Since you have a point save for every creep, it would be easier to do this. Create a trigger with a periodic timer, every 1-2 seconds, not too fast. Use a loop to loop through all the creeps on your map. Check that the distance between position of the picked unit (in a unit group containing all the creeps), and its corresponding position in your point array is less than the desired range (maybe 1000-1500?), if not, order the creep to move back to its original position in the point array. And do your invulnerable stuffs.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top