• 🏆 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!

random picker

Status
Not open for further replies.
Level 5
Joined
Nov 6, 2008
Messages
150
hi me again
still suck
i have think on all what i have learn (form the good people on hiveworkshop) about the trigger editor now this is a random picking system the computer choise the hero you will gonna be how can i do that if you understand....
rember i give reps if you can help me(=
(plzz not use scripts or jass i cant understand them)
 
Level 5
Joined
Feb 5, 2008
Messages
109
So here is a basic trigger picking a random hero for each computer player.

You need three variables for it:
"UnitType" (unit type array)
"UnitGroup" (unit group)
"Point" (point)

The trigger checks each player whether he is a computer and if so, a random hero is created at the player's altar.

  • Computer Hero Pick
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to Computer
            • Then - Actions
              • Set UnitType[1] = Hero 1
              • Set UnitType[2] = Hero 2
              • Set UnitType[3] = Hero 3
              • Set UnitType[4] = Hero 4
              • Set UnitGroup = (Units owned by (Player((Integer A))) of type Altar)
              • Set Point = (Position of (Random unit from UnitGroup))
              • Unit - Create 1 UnitType[(Random integer number between 1 and 4)] for (Player((Integer A))) at Point facing Vorgabe Buildings default facing degrees
              • Custom script: call RemoveLocation( udg_Point )
              • Custom script: call DestroyGroup( udg_UnitGroup )
            • Else - Actions
There are certain things you can do about this trigger, such as preventing players from getting the same hero.

Happy mapping. =)

[edit]
Sorry for that "Gleich" thing, I forgot to translate that.
 
Last edited:
Level 5
Joined
Nov 6, 2008
Messages
150
can you do that witout the script?
Edit where can i find the ((Player((Integer A))) controller) Gleich Computer Conditions?
 
Level 12
Joined
Feb 13, 2009
Messages
386
What's the point to ask in scripts section if you don't want scripts?

can you do that witout the script?
No.

Happy mapping. =)

P.S. OK, let me explain you. There's no magic tool (sadly) which can just convert your thoughts to the games. To do so you need to tell the game what do you want from it, and the only way to do it is to write a trigger on warcraft editor scripts or in jass. There's nothing else you can do really.
 
Level 9
Joined
May 30, 2008
Messages
430
first post from 2 days :angry: becouse this one is awsome.
Becouse of the fact that u not say nothing specific i will type one fast :xxd:
  • Melee Initialization
    • Events
      • Your Event
    • Conditions
    • Actions
      • Set Random = (Random integer number between 1 and 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 1
        • Then - Actions
          • Unit - Create 1 Paladin for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 2
        • Then - Actions
          • Unit - Create 1 Archmage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 3
        • Then - Actions
          • Unit - Create 1 Mountain King for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 4
        • Then - Actions
          • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 5
        • Then - Actions
          • Unit - Create 1 Blademaster for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        • Else - Actions
Random is variable (intiger)
 
Level 5
Joined
Nov 6, 2008
Messages
150
ty will i try(=
edit: When i try this that don't work that i need is a when the game begin so will you got a random hero
 
Last edited:
Level 9
Joined
May 30, 2008
Messages
430
First of all the trigger is working (you can see it for your self) and second why u are saying that is not working when is working. Between the triggers in the map and those in my post have nothing diferent
 

Attachments

  • WORK WORK.w3x
    16.1 KB · Views: 34
Don't use onix_noobs's trigger, use Triax's trigger - it's MUCH better. And yes you can do it without the scripts (Deon misunderstood you), but it will leak (make the game lag a bit more every time the trigger is run) if you don't include the scripts. The only thing those scripts are there for is to stop the game lagging if the trigger is run a lot. Look here for more information about leaks and how to prevent them.
 
Level 9
Joined
May 30, 2008
Messages
430
Hallo this not work that whole time take the same

are u Ok ? do u need video clip to see that this is working properly? But never mind your incompetence of making all random is not my problem when u even don't know that "math - random number" is picking diferent number every time. And mister water what is wrong with my trigger he can't manage to make it work (it's the most simple in the world) what we have to talk about costum scripts and variables
 
Level 9
Joined
May 30, 2008
Messages
430
Between loop and if then else don't have diference unless you will create 100+ units at same time (but in this case you will ask some one to make it jass to be alot faster)

btw what PC do u have pentium 2? or maybe 1? this is warcraft not crysis or silent assassin. And please stop talking becouse u have to say somthing talk only when u have somthing to say (i see 4 more ppls like you in this forum and soon sh17s in the threads and i will take short break again (like 3-4 months like last time becouse of the large amount of bullsh17s in the threads) :slp:
 
Level 7
Joined
Oct 14, 2008
Messages
340
Between loop and if then else don't have diference unless you will create 100+ units at same time (but in this case you will ask some one to make it jass to be alot faster)

btw what PC do u have pentium 2? or maybe 1? this is warcraft not crysis or silent assassin. And please stop talking becouse u have to say somthing talk only when u have somthing to say (i see 4 more ppls like you in this forum and soon sh17s in the threads and i will take short break again (like 3-4 months like last time becouse of the large amount of bullsh17s in the threads) :slp:

Woah there! Hey now!
Take it easy man.
 
Level 5
Joined
Nov 6, 2008
Messages
150
can you post the trigger that leak a litter this is only a map for me so dont think about this leak
 
Between loop and if then else don't have diference unless you will create 100+ units at same time (but in this case you will ask some one to make it jass to be alot faster)

btw what PC do u have pentium 2? or maybe 1? this is warcraft not crysis or silent assassin. And please stop talking becouse u have to say somthing talk only when u have somthing to say (i see 4 more ppls like you in this forum and soon sh17s in the threads and i will take short break again (like 3-4 months like last time becouse of the large amount of bullsh17s in the threads) :slp:
Sorry if you're getting mad at me. I'm just saying, if you have a lot of inefficient triggers in your map you're gonna end up with lag, no matter how good your PC is. And just for your information I have a Pentium Dual Core 3.4 gHz - not the best, but probably better than yours.

Anyway, don't get mad at people because they don't like how you do things :D

can you post the trigger that leak a litter this is only a map for me so dont think about this leak
You should care about leaks, because if you don't, you'll end up getting major lag problems...
 
Level 5
Joined
Nov 6, 2008
Messages
150
im not mad but i hate to drop a protek
but that sould i do rigth now and try
again when i know some more about scripts
 
Status
Not open for further replies.
Top