help creating a more effective hero respawn

seansucks

New Member
Reaction score
0
alright, so in my rpg, i want a hero to be spawned after death at the recent most visited town.
i'm sure there's a way i could do this with a variable, when i enter a region it sets the last entered town as a variable. so that when a hero dies they respawn at the last town entered.

but how would i go about doing that exactly?
and i'm worried that if i set something it will set it for every player. i want it to be player specific.
 

wraithseeker

Tired.
Reaction score
122
First, you create a region that surrounds your town and using the event A Unit Enters Region, you set the last spawned town place to that region.

When the hero dies, you revive him at the location set in the global variable.
 

simonake

New Member
Reaction score
72
You have to make a MPI hero respawn.

Create a variable of unit type and array. Name it has you want. i will use 'unit'
Do this for all your players and you can be sure it will work.

Trigger:
  • Respawn
    • Events
      • Unit - A Unit dies
    • Conditions
      • (Triggering unit) is a Hero Equal to True
    • Actions
      • If (Conditions), then (Actions), Else (Actions)
        • If -
          • (Owner of (Triggering unit)) Equal to Player red (1)
        • Then -
          • Set Unit[1] Equal to (Triggering Unit)
          • Wait 5 seconds
          • Unit - Revive Instantly Unit[1]

Do that for all players.
 

Nexor

...
Reaction score
74
it would be easier to simply use the player number of the owner of triggering unit, you dont have to make it for all players
 

Nexor

...
Reaction score
74
You are able to use Trigering unit multiple times in a trigger.
I would make it this way:

Trigger:
  • Revive
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Wait 5.00 seconds
      • Hero - Instantly revive (Triggering unit) at LOCATION[(Player number of (Owner of (Triggering unit)))], Show revival graphics


LOCATION[array] is a point type variable, and you can set it everytime a hero enters a town.
 

seansucks

New Member
Reaction score
0
no no, i get all of those things.
but what i'm asking is if i can create a variable for each player representing the last entered town, and how would i go about doing it.
 

seansucks

New Member
Reaction score
0
yeah. let me try and explain more.
whenever you enter a region in a town. it sets the last_town (variable) as the hero respawn region in that specific town. unfortunately (i haven't tested it out yet) i'm thinking that whenever anyone dies, they'll respawn at that town, which is why i want it player specific.

for example.
a level 20 character in a higher level town dies outside.
and a level 2 character that just started dies outside of the first town.
both will respawn in either of the towns. depending on whoever switched the variable last.

that's my problem.
 

seansucks

New Member
Reaction score
0
bump. still pretty much unanswered.
sorry for double post, but i don't think editing a post brings it to the top.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top