• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

How to make a duel system?

Status
Not open for further replies.
Nothing like that. I mean a complete minigame that is based on duels. The first 2 units are randomed for duel and then when one of them wins there is next duel and so on.
 
So you're asking someone to create the core system for a minigame of yours? :/
It's actually really simple, but don't expect me to create everything for you because if I do you won't learn a thing and will never be able to create something yourself.

Step 1)

Store all heroes in an arrayed variable.
Player 1 (red)'s hero will be stored in Hero[1]
Player 2 (blue)'s hero will be stored in Hero[2]
Do this for all players.

Step 2)

Set an integer variables to a random value between 1 - (max amount of players).
Loop from 1 to (max amount of players).
If LoopInt == RandInt and Player[LoopInt] is playing and Player[LoopInt] is in Arena == false then
[move hero to arena, turn on any additional triggers if necessary].

Repeat this for the second hero.


Step 3)

If a hero dies and hero is in arena, then move both heroes outside the arena, display stats, add win/loss to the player etc.
Repeat step 2 for the next duel.


This is the basics of how it works.
The triggers speak for themselves, there shouldn't be any trigger here which can cause a lot of problems.

And if your triggers do something weird, use debug messages to see where you went wrong (text messages which display core values, such as RandInt or LoopInt or the unit's name).
 
Status
Not open for further replies.
Back
Top