Z
Zerotech
Guest
I could use some help regarding Random Integer value conditions.
What I've done so far, theorectically speaking, about duel arenas. Based on the coding for Angel Arena maps they use the fixed integer functions so whoever has a highest kills in the team will be picked to participate in the match.
But what if I decided that I don't like that rule and I like to alter it? Based on random integer values so a no. from 1 to 6 for eg. if the no. is 4 for example then player 4 will be picked, but if that player is unavailable then it will continue to randomly pick in a loop until an available hero is playing.
Based on Angel Arena's Highest Kills Priority Coding
And here I've rewritten the code using some modified random integer values
I hope you can understand what I am trying to do, but it didnt equal to the results that I would have liked. And comparing to the Angel Arena coding there are some irregularities that I've observed and I haven't made any clear understandings of it.
My Variables Declared
bDuelArena - Boolean True/False comparison
bMultiArena - Boolean True/False comparison
Team1DuelPos - Point Variable
Team2DuelPos - Point Variable
CameraViewTarget - Point Variable
TeamDuelUnit1 - Unit Variable
TeamDuelUnit2 - Unit Variable
HeroPlayer - Unit Array Variable
No events were added onto my triiger as it was activated via previous Timer trigger event
If someone who have coded their map using Random Integer Values, please share your experiences. Your assistance is appreciated.
What I've done so far, theorectically speaking, about duel arenas. Based on the coding for Angel Arena maps they use the fixed integer functions so whoever has a highest kills in the team will be picked to participate in the match.
But what if I decided that I don't like that rule and I like to alter it? Based on random integer values so a no. from 1 to 6 for eg. if the no. is 4 for example then player 4 will be picked, but if that player is unavailable then it will continue to randomly pick in a loop until an available hero is playing.
Based on Angel Arena's Highest Kills Priority Coding
Code:
Start Duel
Events
Time - Duel expires
Conditions
Actions
Unit - Pause all units
Game - Display to (All players) the text: Two have been chose...
Set bPasued = True
Set bDuel = True
Countdown Timer - Start DuelTime as a One-shot timer that will expire in 120.00 seconds
Sound - Stop music After fading
Wait 3.00 seconds
Player Group - Pick every player in (All players) and do (Camera - Pan camera for (Picked player) to (Center of Duel Arena <gen>) over 1.00 seconds)
For each (Integer A) from 1 to 12, do (Set HeroSavePoints[(Integer A)] = (Position of Heroes[(Integer A)]))
For each (Integer A) from 1 to 12, do (Set HeroSaveDirection[(Integer A)] = (Facing of Heroes[(Integer A)]))
For each (Integer A) from 1 to 12, do (Unit - Move Heroes[(Integer A)] instantly to (Center of HeroDuelSpots[(Integer A)]))
For each (Integer A) from 1 to 12, do (Unit - Make Heroes[(Integer A)] face (Center of Duel Arena <gen>) over 0.00 seconds)
For each (Integer A) from 1 to 12, do (Unit - Make Heroes[(Integer A)] Invulnerable)
Set TempMaxKill = 0
For each (Integer A) from 1 to 6, do (If ((Kills[(Integer A)] Greater than TempMaxKill) and (((Player((Integer A))) slot status) Equal to Is playing)) then do (Set TempMaxKill = Kills[(Integer A)]) else do (Do nothing))
For each (Integer A) from 1 to 6, do (If ((Kills[(Integer A)] Equal to TempMaxKill) and (((Player((Integer A))) slot status) Equal to Is playing)) then do (Set Team1Leader = (Integer A)) else do (Do nothing))
Set Team1LeaderHero = Heroes[Team1Leader]
Unit - Move Team1LeaderHero instantly to (Center of Team One Dueler <gen>)
Unit - Set life of Team1LeaderHero to 100.00%
Unit - Set mana of Team1LeaderHero to 100.00%
Unit - Make Team1LeaderHero Vulnerable
Set TempMaxKill = 0
For each (Integer A) from 7 to 12, do (If ((Kills[(Integer A)] Greater than TempMaxKill) and (((Player((Integer A))) slot status) Equal to Is playing)) then do (Set TempMaxKill = Kills[(Integer A)]) else do (Do nothing))
For each (Integer A) from 7 to 12, do (If ((Kills[(Integer A)] Equal to TempMaxKill) and (((Player((Integer A))) slot status) Equal to Is playing)) then do (Set Team2Leader = (Integer A)) else do (Do nothing))
Set Team2LeaderHero = Heroes[Team2Leader]
Unit - Move Team2LeaderHero instantly to (Center of Team Two Dueler <gen>)
Unit - Set life of Team2LeaderHero to 100.00%
Unit - Set mana of Team2LeaderHero to 100.00%
Unit - Make Team2LeaderHero Vulnerable
Game - Display to (All players) the text: ((Name of (Player(Team1Leader))) + ( Vs + (Name of (Player(Team2Leader)))))
Wait 5.00 seconds
Sound - Play Credits <gen>
Game - Display to (All players) the text: 3!
Wait 1.00 seconds
Game - Display to (All players) the text: 2!
Wait 1.00 seconds
Game - Display to (All players) the text: 1!
Wait 1.00 seconds
Game - Display to (All players) the text: Let battle be joine...
Unit - Unpause Team1LeaderHero
Unit - Unpause Eye of Sauron 0235 <gen>
Unit - Unpause Team2LeaderHero
Unit - Unpause Eye of Sauron 0236 <gen>
And here I've rewritten the code using some modified random integer values
Code:
Activate Duel Arena
Events
Conditions
Actions
Set bDuelArena = True
Set bMultiArena = False
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Player Group - Pick every player in Team1Players and do (Actions)
Loop - Actions
If ((Random integer number between 1 and 6) Equal to 0) then do (Do nothing) else do (Set TeamDuelUnit1 = HeroPlayer[(Integer A)])
Set Team1DuelPos = (Center of Team1 Duel Position <gen>)
Set CameraViewTarget = (Center of Center of Duel Arena <gen>)
Unit - Move TeamDuelUnit1 instantly to Team1DuelPos, facing CameraViewTarget
Custom script: call RemoveLocation(udg_Team1DuelPos)
Custom script: call RemoveLocation(udg_CameraViewTarget)
For each (Integer A) from 7 to 12, do (Actions)
Loop - Actions
Player Group - Pick every player in Team1Players and do (Actions)
Loop - Actions
If ((Random integer number between 7 and 12) Equal to 0) then do (Do nothing) else do (Set TeamDuelUnit2 = HeroPlayer[(Integer A)])
Set Team2DuelPos = (Center of Team2 Duel Position <gen>)
Set CameraViewTarget = (Center of Center of Duel Arena <gen>)
Unit - Move TeamDuelUnit2 instantly to Team2DuelPos, facing CameraViewTarget
Custom script: call RemoveLocation(udg_Team2DuelPos)
Custom script: call RemoveLocation(udg_CameraViewTarget)
Game - Display to (All players) for 5.00 seconds the text: ((Name of TeamDuelUnit1) + ( vs + (Name of TeamDuelUnit2)))
Sound - Play ArrangedTeamInvitation <gen>
Unit - Set life of TeamDuelUnit1 to 100.00%
Unit - Set mana of TeamDuelUnit1 to 100.00%
Unit - Set life of TeamDuelUnit2 to 100.00%
Unit - Set mana of TeamDuelUnit2 to 100.00%
Wait 5.00 seconds
Sound - Set music volume to 100.00%
Sound - Play Credits <gen>
Game - Display to (All players) for 5.00 seconds the text: Duel Arena begins i...
Wait 3.00 seconds
Game - Display to (All players) for 1.00 seconds the text: 3!
Sound - Play BattleNetTick <gen>
Wait 1.00 seconds
Game - Display to (All players) for 1.00 seconds the text: 2!
Sound - Play BattleNetTick <gen>
Wait 1.00 seconds
Game - Display to (All players) for 1.00 seconds the text: 1!
Sound - Play BattleNetTick <gen>
Wait 1.00 seconds
Game - Display to (All players) for 1.00 seconds the text: Duel Arena has begu...
Sound - Play mk_fight <gen>
Unit Group - Pick every unit in (Units in Team1 Duel Position <gen>) and do (Unit - Make (Picked unit) Vulnerable)
Unit Group - Pick every unit in (Units in Team1 Duel Position <gen>) and do (Unit - Unpause (Picked unit))
Unit Group - Pick every unit in (Units in Team2 Duel Position <gen>) and do (Unit - Make (Picked unit) Vulnerable)
Unit Group - Pick every unit in (Units in Team2 Duel Position <gen>) and do (Unit - Unpause (Picked unit))
Countdown Timer - Start bDuelArenaTimer as a One-shot timer that will expire in 180.00 seconds
Countdown Timer - Create a timer window for bDuelArenaTimer with title Battle Arena Countd...
Countdown Timer - Show (Last created timer window)
Trigger - Turn on End Duel Arena <gen>
Trigger - Turn on Duel Arena Timer Expires <gen>
Trigger - Turn off (This trigger)
I hope you can understand what I am trying to do, but it didnt equal to the results that I would have liked. And comparing to the Angel Arena coding there are some irregularities that I've observed and I haven't made any clear understandings of it.
My Variables Declared
bDuelArena - Boolean True/False comparison
bMultiArena - Boolean True/False comparison
Team1DuelPos - Point Variable
Team2DuelPos - Point Variable
CameraViewTarget - Point Variable
TeamDuelUnit1 - Unit Variable
TeamDuelUnit2 - Unit Variable
HeroPlayer - Unit Array Variable
No events were added onto my triiger as it was activated via previous Timer trigger event
If someone who have coded their map using Random Integer Values, please share your experiences. Your assistance is appreciated.