Hero Revival System Ain't Workin'

D

danhel

Guest
I tried to make something simular to Age of Myths' system. For a player, it looks like this:

Code:
Die Blue
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Dying unit)) Equal to Player 2 (Blue)
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set Dead_Mortal_Hero[1] = (Dying unit)
        Set Mortal_Die_Point[1] = (Position of (Dying unit))
        Unit - Create 1 Spirit (Mortal) for Player 1 (Red) at Mortal_Die_Point[1] facing Default building facing (270.0) degrees
        Unit - Order (Last created unit) to Move To Mortal_Revive_Point
        Wait (((Distance between Mortal_Die_Point[1] and Mortal_Revive_Point) / 375.00) + ((Real((Hero level of Dead_Mortal_Hero[1]))) / 2.00)) seconds
        Hero - Instantly revive Dead_Mortal_Hero[1] at Mortal_Revive_Point, Show revival graphics
        Custom script: call RemoveLocation (udg_Mortal_Die_Point[1])

It doesnt do anything.

I had an other one before, there were 2 wait functions after each other - was messy, thats why i separated them. That one worked... ...sometimes.

It really doesnt do shit, whats the problem? :banghead:
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
>Mortal_Revive_Point

I don't know if it is set in another trigger, but it's not set in this trigger. Also, what's up with the wait? You can do

Wait - Wait until (Distance between (Position of Dead_Mortal_Hero[1]) and Mortal_Revive_Point less than or equal to (1000), checking every 1.00 seconds.

Also, if it's not the revive point that's messed up, it's the wait, or that it's when player 2's unit dies, and it creates a spirit for player 1.

WOOT 999 posts! :)
 
D

danhel

Guest
Thats set in map initialization. The ghost only for the looking, it makes nicer ;P

What is the checking every seconds for? and how to assaign it?:)
 

2evil

New Member
Reaction score
16
umm, under conditions, it says

(Owner of (Dying unit)) Equal to Player 2 (Blue)

i don't know if you have already changed ythis, but it would explain why it doesn't work
 

2evil

New Member
Reaction score
16
it should look like this: (i changed it a little too, so now itll work for every player w/ 1 trigger)

Code:
Untitled Trigger 004
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        For each (Integer A) from 1 to [B](amount of players)[/B], do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Dying unit)) Equal to (Player((Integer A)))
                    Then - Actions
                        Set Dead_Mortal_Hero[(Integer A)] = (Dying unit)
                        Set Mortal_Die_Point[(Integer A)] = (Position of (Dying unit))
                        Unit - Create 1 Spirit (Mortal) for (Player((Integer A))) at Mortal_Die_Point[(Integer A)] facing Default building facing (270.0) degrees
                        Unit - Order (Last created unit) to Move To Mortal_Revive_Point [B](wheres this?)[/B] 
                        Wait (((Distance between Mortal_Die_Point[(Integer A)] and Mortal_Revive_Point) / 375.00) + ((Real((Hero level of Dead_Mortal_Hero[(Integer A)]))) / 2.00)) seconds
                        Hero - Instantly revive Dead_Mortal_Hero[(Integer A)] at Mortal_Revive_Point, Show revival graphics
                        Custom script: call RemoveLocation (udg_Mortal_Die_Point[(Integer A)])
                    Else - Actions
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Instead of that, you could change the ones to (Player number of (Owner of (Dieing unit))), it would probably be more efficient.

>What is the checking every seconds for? and how to assaign it?

That way instead of having that huge long code for wait, it will check every second to see if the spirit unit is close enough to the unit to revive. But now that I know it's just for looks, ignore that...

How you would assign it would be using the Wait - Wait unit Condition function, and then it will automatically check every (However long you put) seconds to see if the condition is true, and until it is.
 
D

danhel

Guest
2evil said:
it should look like this: (i changed it a little too, so now itll work for every player w/ 1 trigger)

Code:
Untitled Trigger 004
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        For each (Integer A) from 1 to [B](amount of players)[/B], do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Dying unit)) Equal to (Player((Integer A)))
                    Then - Actions
                        Set Dead_Mortal_Hero[(Integer A)] = (Dying unit)
                        Set Mortal_Die_Point[(Integer A)] = (Position of (Dying unit))
                        Unit - Create 1 Spirit (Mortal) for (Player((Integer A))) at Mortal_Die_Point[(Integer A)] facing Default building facing (270.0) degrees
                        Unit - Order (Last created unit) to Move To Mortal_Revive_Point [B](wheres this?)[/B] 
                        Wait (((Distance between Mortal_Die_Point[(Integer A)] and Mortal_Revive_Point) / 375.00) + ((Real((Hero level of Dead_Mortal_Hero[(Integer A)]))) / 2.00)) seconds
                        Hero - Instantly revive Dead_Mortal_Hero[(Integer A)] at Mortal_Revive_Point, Show revival graphics
                        Custom script: call RemoveLocation (udg_Mortal_Die_Point[(Integer A)])
                    Else - Actions



This one doesnt work either.

I see how the checking every seconds works. But do i need to set the ghost's level every second? To prevent memory leaks.


And if anyone could spare time to explain the or each integer from blahblah... it must be very good but i cant use it :(
 

Sim

Forum Administrator
Staff member
Reaction score
534
> Mortal_Revive_Point

Just change this lol. It's been already told to you to change it.
 
D

danhel

Guest
Why the stupid hell should i change it? Its FINE, the ghost moves there...
 

Sim

Forum Administrator
Staff member
Reaction score
534
Code:
Revive
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        For each (Integer A) from 1 to (amount of players), do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Dying unit)) Equal to (Player((Integer A)))
                    Then - Actions
                        Set Dead_Mortal_Hero[(Integer A)] = (Dying unit)
                        Set Mortal_Die_Point[(Integer A)] = (Position of (Dying unit))
                        Unit - Create 1 Spirit (Mortal) for (Player((Integer A))) at Mortal_Die_Point[(Integer A)] facing Default building facing (270.0) degrees
                        Unit - Order (Last created unit) to Move To Mortal_Revive_Point (wheres this?) 
                        Wait (((Distance between Mortal_Die_Point[(Integer A)] and Mortal_Revive_Point) / 375.00) + ((Real((Hero level of Dead_Mortal_Hero[(Integer A)]))) / 2.00)) seconds
                        Hero - Instantly revive Dead_Mortal_Hero[(Integer A)] at Mortal_Revive_Point, Show revival graphics
                        Custom script: call RemoveLocation (udg_Mortal_Die_Point[(Integer A)])
                    Else - Actions
                        Do Nothing

You want Blue only to lose his hero, not all. Integer A is completely useless. here's your problem. Sorry for last post I didn't read the one and only post you said it was right. Pardon me.

Look...

Code:
Die Blue
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Dying unit)) Equal to Player 2 (Blue)
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set Dead_Mortal_Hero[1] = (Dying unit)
        Set Mortal_Die_Point[1] = (Position of (Dying unit))
        Unit - Create 1 Spirit (Mortal) for [B]Player 1 (Red)[/B] at Mortal_Die_Point[1] facing Default building facing (270.0) degrees
        Unit - Order (Last created unit) to Move To Mortal_Revive_Point
        Wait (((Distance between Mortal_Die_Point[1] and Mortal_Revive_Point) / 375.00) + ((Real((Hero level of Dead_Mortal_Hero[1]))) / 2.00)) seconds
        Hero - Instantly revive Dead_Mortal_Hero[1] at Mortal_Revive_Point, Show revival graphics
        Custom script: call RemoveLocation (udg_Mortal_Die_Point[1])
Why Player Red ? It's Player Blue that will set the trigger !

Anyways I would suggest you do what Darthfett said all the way along to this point. He is incredibly right. He told you all what I wanted to tell you.

@3evil : In that case, you gotta use Player number of Owner of Dying unit, not For Each Integer A... But again, Darthfett already said everything needed.

Danhel, follow what Darthfett said.
 
D

danhel

Guest
I create the ghost for Red, because red cant move it. Well it can be it wont. if i give it to a player he makes it go anywhere - scouting.

I would follow his orders... but which one, the (player number of etc, or the wait for condition? I would r ather choose the second one, but i need to know more.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Wait (((Distance between Mortal_Die_Point[1] and Mortal_Revive_Point) / 375.00) + ((Real((Hero level of Dead_Mortal_Hero[1]))) / 2.00)) seconds
Hero - Instantly revive Dead_Mortal_Hero[1] at Mortal_Revive_Point, Show revival graphics

Delete this and instead do : Trigger - Turn On Revive_Wait <gen>
Also, try removing that useless Array inside your Mortal_Die_Point variable.

Code:
Revive_Wait
    Events
        Unit - a Unit comes within 150 of Mortal_Die_Point
    Conditions
        Whatever
    Actions
        Hero - Instantly revive Dead_Mortal_Hero[1] at Mortal_Revive_Point[1], Show revival graphics 
        Trigger - Turn off (This Trigger)
 
D

danhel

Guest
so i need 12 triggers for just the wait? great.
Cant anyone make me a jass type revining stuff, in one window ? :D
 

Sim

Forum Administrator
Staff member
Reaction score
534
Wait before jumping to conclusions and think about it a sec.

What are the roles of arrays do you know ? Packing triggers to have the less of them possible. They can story many informations. Including what ?

YES, player numbers. THis is where you find the utility of it.

Second : you don't need 12 because you said Player 1 (Red) is not a player, so you need 11.

Third : you don't need 11 because with the array I told you to delete you can replace the [1] with [Player number of (Owner of (Dying unit))] and it will hold the 12 (11) players you need.

Just replace (everywhere needed) the variables with array variables using [Player Number of (Owner of (Dying unit))] in the revive trigger and [Player Number of (Owner of (Triggering unit))] in the second trigger that is by me.

Glad I can be of more help...
 
D

danhel

Guest
K i will have time when wake up... but untill... It will work in one trigger, and it will Mui?
Its an AOS map green is not a player either, but i need 12, because there is a Neutral hero, and it can join either teams.

Mortal_Revive_Point is a fucking point, center of a rect, where the ghots go. Surprsing?
You are more rude then me man. Great :D

I would only call jass solution if a single trigger method is non mui.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well you kind of asked anyone around for a solution, completely abandonning what I have done ...

I didn't ask what Revive_point or whatever was, I explained to you why people kept asking "what is mortal_revive_point?"

The words in Caps Lock were the questions of people tryng to help you, and I put it in Caps Lock for you to read, because I did post : "What is Mortal_Revive_Point ?" as 3 other people. And you answered that this part worked (finally).

It is normal I was being rude in last post, it was in reply to you. And when I reread I don't find it rude... Depends on the point of view.

Anyways let's end this.

Try this later, to see if it works. If you have further problems post the trigger here.
 
D

danhel

Guest
Code:
Die Blue Copy
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set Dead_Mortal_Hero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
        Set Mortal_Die_Point[(Player number of (Owner of (Dying unit)))] = (Position of (Dying unit))
        Unit - Create 1 Spirit (Mortal) for Player 1 (Red) at Mortal_Die_Point[(Player number of (Owner of (Dying unit)))] facing Default building facing (270.0) degrees
        Unit - Order (Last created unit) to Move To Mortal_Revive_Point
        Trigger - Turn on wtf2 <gen>

Code:
wtf2
    Events
        Unit - A unit enters Human Revive <gen>
    Conditions
        (Unit-type of (Entering unit)) Equal to Spirit (Mortal)
    Actions
        Hero - Instantly revive Dead_Mortal_Hero[(Player number of (Owner of (Triggering unit)))] at Mortal_Revive_Point, Show revival graphics
        Trigger - Turn off (This trigger)


There wasnt event for unit comes withing the range of point, only unit. But i think it should do the same... Doesnt work.

And if it worked, would it be:
-Mui?
-Causing problems because its an AOS, and it would order the enemy ghosts to mortal revive point too?
 

Sim

Forum Administrator
Staff member
Reaction score
534
There wasnt event for unit comes withing the range of point, only unit. But i think it should do the same... Doesnt work.

you must first Center the region "Human Revive" on Mortal_Die_Point

THEN Turn On the short trigger.

Forgot to add it.
 
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