• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

I need Revival System like BattleShips

Status
Not open for further replies.
Level 7
Joined
Jul 20, 2009
Messages
295
I tried doing it myself, but the Timer action just wouldn't work, it only works for player 1 and the rest just show blank space instead of time.

I need the revival system to show timer when a hero dies, and that the timer is shown for allies only. If hero dies, a grave appears. Or, I just really need a working timer, if you can provide me with this I'd be grateful. There are 2 Teams and 10 players.

Thanks.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
i dont think you can make a countdown timer for spcefic players only.

i think you need to use something else than that.

this is what i suggest BUT the wait time will bug up if more than one hero die at same time i think. so change that to something else then.
  • respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • -------- RSPAWN TIME HERE --------
      • Set revive_time[(Player number of (Owner of (Dying unit)))] = 10.00
      • -------- --------
      • Set Dying_hero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
      • Set Loc[(Player number of (Owner of (Dying unit)))] = (Position of (Dying unit))
      • -------- MSG HERE --------
      • Game - Display to (Player group((Owner of (Dying unit)))) for 5.00 seconds the text: Your hero will be r...
      • Wait revive_time[(Player number of (Owner of (Dying unit)))] seconds
      • Hero - Instantly revive Dying_hero[(Player number of (Owner of (Dying unit)))] at Loc[(Player number of (Owner of (Dying unit)))], Show revival graphics
      • Custom script: call RemoveLocation(udg_Loc)
 
Level 7
Joined
Jul 20, 2009
Messages
295
I have this done, but the only problem I'm having is with the Timer... >.<
If what you said is true that it's impossible to create countdown for each player, then how did battleships' map maker do it? Or, how does even X Hero Siege have many Timers running all at the same time... The timer only runs a countdown when player 1's hero dies, others are just blank, why?? Even if player 1's hero timer expires and another player's hero dies, a timer window appears but still blank...

May someone help me out please?
 
Level 7
Joined
Jul 20, 2009
Messages
295
I did search and found a thread similar to what I'm asking, though was too lazy to read in other people's threads.

Edit: Still, not the way I want it to be, 1 question, have you played BattleShips?
If so, you'd know what type of revive system I want. =/
 
Last edited:
Level 7
Joined
Jul 20, 2009
Messages
295
Hmm, I guess you're right, yeah, do you mind doing the "Show Alliance" thing please. Also, creating a unit in the position of the dead hero, and is removed after the hero is revived. Make it any unit you want, I'll change it when imported into my map.

Thanks alot in advance. :D
 
Level 3
Joined
Feb 12, 2011
Messages
38
This should work

  • Events
  • Unit-A unit dies
  • Conditions
  • ((Dying uni) is a hero) equals true
  • Actions
  • Game- Display to (Player group((Owner of (Dying unit) the text: You will be revived in 40 seconds.
  • Countdown-Timer- Start Timeremaining[(Player number of (Owner of( Dying unit)))] as a one-shot timer that will expire in 40 seconds
  • Countdown-Timer - Create a timer window for (last created timer) with the title (Name of(Owner of(Dying unit)))
  • Set Timeremaining_window[(player number of ( owner of (Dying unit)))] = (last created timer window)
  • Wait 40 game-time seconds
  • Countdown-Timer - Destroy Timeremaining_window[player number of(owner of( dying unit)))]
  • Hero- Instantly revive (triggering unit) at (center of spawn area)
  • Camera- pan camera for (owner of (triggering unit)) to (center of spawn area) over 0 seconds
this is not a perfect solution. You could also save the unit type of the hero in a varable with the array of the player number of the dying hero and revive it in a second trigger that is run when the timer expires. However i know this solution works. Good luck

Timeremaining is a variable for a timer and timeremaining_window is a variable for the timer window. Both ghave an array of as the highest player number of your playable players.

I hope this helps
 
Level 3
Joined
Feb 12, 2011
Messages
38
Well for your second request you could modify it like this:
  • Events
  • Unit-A unit dies
  • Conditions
  • ((Dying uni) is a hero) equals true
  • Actions
  • Unit- Create 1 Grunt for player (Owner of( triggering unit)) at (Position of( Triggering unit) facing ....
  • Set UNIT[Player number of(Owner of (triggering unit))]= (last created unit)
  • Game- Display to (Player group((Owner of (Dying unit) the text: You will be revived in 40 seconds.
  • Countdown-Timer- Start Timeremaining[(Player number of (Owner of( Dying unit)))] as a one-shot timer that will expire in 40 seconds
  • Countdown-Timer - Create a timer window for (last created timer) with the title (Name of(Owner of(Dying unit)))
  • Set Timeremaining_window[(player number of ( owner of (Dying unit)))] = (last created timer window)
  • Wait 40 game-time seconds
  • Countdown-Timer - Destroy Timeremaining_window[player number of(owner of( dying unit)))]
  • Hero- Instantly revive (triggering unit) at (center of spawn area)
  • Unit- Remove (UNIT[Player number of (owner of (triggering unit))] from the game
  • Camera- pan camera for (owner of (triggering unit)) to (center of spawn area) over 0 seconds
in this case UNIT is a variable for a unit with the array of the highest player number of your playable players (for example you have the highest player is player 5 then the highest player number would be 5)

for the show alliance thingy you could put 2 actionsw between the 3rd and 4th action:
  • Set Team 1 = (all allies of player 1(red)) // this should go to init-trigger
  • Set Team 1 = (all enemies of player 1(red)) // this should go to init-trigger as well
  • Player - Pick every player in (Team 1) and do actions
  • Countdown- timer - Show Timeremaining_window[player number of (owner of ( triggering unit))] for picked player
  • Player - Pick every player in (Team 2) and do actions
  • Countdown- timer - Hide Timeremaining_window[player number of (owner of ( triggering unit))] for picked player
 
Level 7
Joined
Jul 20, 2009
Messages
295
I have this kind of triggers you've put, but it just wont show me numbers in the Timer for other players other than player 1.
Here are my triggers:

  • Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • (Unit-type of (Dying unit)) Not equal to Backpack
    • Actions
      • Set Temp_Location = (Position of (Dying unit))
      • Unit - Create 1 Death for (Owner of (Dying unit)) at Temp_Location facing (Facing of (Dying unit)) degrees
      • Set Death_Unit[(Player number of (Owner of (Dying unit)))] = (Last created unit)
      • Game - Display to (Player group((Owner of (Dying unit)))) the text: |cffff000075 Second...
      • Camera - Reset camera for (Owner of (Dying unit)) to standard game-view over 0.00 seconds
      • Countdown Timer - Start Hero_Death[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in 75.00 seconds
      • Countdown Timer - Show Hero_Death_Window[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
      • Unit - Create 1 High Elf (Female) for (Owner of (Dying unit)) at (Center of Region 110 <gen>) facing Default building facing degrees
      • Unit - Add a 75.00 second Generic expiration timer to (Last created unit)
      • Unit - Kill Backpack[(Player number of (Owner of (Dying unit)))]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Has_Pet[(Player number of (Owner of (Dying unit)))] Equal to True
        • Then - Actions
          • Unit - Kill Summon[(Player number of (Owner of (Dying unit)))]
        • Else - Actions
      • Custom script: call RemoveLocation( udg_Temp_Location )
  • Remove Window
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to High Elf (Female)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Dying unit)) is an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero[(Player number of (Owner of (Dying unit)))] is alive) Equal to False
            • Then - Actions
              • Unit - Remove Death_Unit[(Player number of (Owner of (Dying unit)))] from the game
              • Hero - Instantly revive Hero[(Player number of (Owner of (Dying unit)))] at (Center of Team 1 <gen>), Show revival graphics
              • Camera - Pan camera for (Owner of (Dying unit)) to (Center of Team 1 <gen>) over 0.00 seconds
              • Selection - Select Hero[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
              • Set Temp_Location = (Position of Hero[(Player number of (Owner of (Dying unit)))])
              • Hero - Instantly revive Backpack[(Player number of (Owner of (Dying unit)))] at Temp_Location, Hide revival graphics
              • Countdown Timer - Hide Hero_Death_Window[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
              • Dialog - Hide Raise[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
              • Custom script: call RemoveLocation( udg_Temp_Location )
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero[(Player number of (Owner of (Dying unit)))] is alive) Equal to False
            • Then - Actions
              • Unit - Remove Death_Unit[(Player number of (Owner of (Dying unit)))] from the game
              • Hero - Instantly revive Hero[(Player number of (Owner of (Dying unit)))] at (Center of Team 2 <gen>), Show revival graphics
              • Camera - Pan camera for (Owner of (Dying unit)) to (Center of Team 2 <gen>) over 0.00 seconds
              • Selection - Select Hero[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
              • Set Temp_Location = (Position of Hero[(Player number of (Owner of (Dying unit)))])
              • Hero - Instantly revive Backpack[(Player number of (Owner of (Dying unit)))] at Temp_Location, Hide revival graphics
              • Countdown Timer - Hide Hero_Death_Window[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
              • Dialog - Hide Raise[(Player number of (Owner of (Dying unit)))] for (Owner of (Dying unit))
              • Custom script: call RemoveLocation( udg_Temp_Location )
            • Else - Actions
Is there something wrong with my triggers?

Edit: I also attached a ScreenShot of my friend, he screen shot it when we were testing the map, here is how it appears for player 2 (Also, ignore his drawing :p)
 

Attachments

  • screenshot thing.tga
    1.4 MB · Views: 50
Level 3
Joined
Feb 12, 2011
Messages
38
mhh what numbers do u mean?
the time left?

-well perhaps your array is not big enough- id it is only 1 for example then you will not be able to store the info for player 1 because 2 (for player two) would be to huge.
 
Level 3
Joined
Feb 12, 2011
Messages
38
Oh and you forgot to create a timer-window.
You somehow were able to show it but didn't create it.
It should say
Countdown-timer- Create a timer window for (last started timer) with the title: ...
 
Level 3
Joined
Feb 12, 2011
Messages
38
I see... I thought I shouldn't care about No. of arrays... as if they were useless. o.o Yes, all of my variables, if arrayed, are 1, would this cause problems?
it will as i already told you
f.e. if you have players 1 to 5 your array has to be at leat 5! (in order to work for all of them)

If u need more help just pm me! I always like to help others if i can!
I have to go now though
 
Level 3
Joined
Feb 12, 2011
Messages
38
ok I hope it will work then :)

I have to go now. If you have any questions just send me a personal-message. Ill try to help then.
Maybe ill look into this thread again tomorrow or Thursday. Id also look over your triggers if youd like me to. As I said just pm me
 
Status
Not open for further replies.
Top