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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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