random not unique

exge

New Member
Reaction score
15
for some reason this trigger doesnt give me uinque random heroes...

Code:
hero arr
    Events
        Map initialization
    Conditions
    Actions
        Set hero[1] = Shaman
        Set hero[2] = Lich
        Set hero[3] = Shadow Priest
        Set hero[4] = Teeveseth
        Set hero[5] = Hydromancer
        Set hero[6] = Fire Revenant
        Set hero[7] = Night Assasin
        Set random_count = 7
        For each (Integer A) from 1 to 7, do (Actions)
            Loop - Actions
                Set random_data[(Integer A)] = (Integer A)

Code:
random
    Events
        Player - Player 2 (Blue) types a chat message containing -random as An exact match
    Conditions
    Actions
        Set random_data[random_hero] = random_count
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                random_count Greater than or equal to 1
            Then - Actions
                Set random_hero = (Random integer number between 1 and random_count)
                Unit - Create 1 hero[random_data[random_hero]] for (Triggering player) at ((Triggering player) start location) facing Default building facing (270.0) degrees
                Game - Display to (All enemies of (Triggering player)) the text: (playername[(Player number of (Triggering player))] + ( has randomed  + (Proper name of (Last created unit))))
                Set random_count = (random_count - 1)
                Player Group - Pick every player in (All players) and do (Actions)
                    Loop - Actions
                        Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
            Else - Actions
 
D

deathtomato

Guest
What you mean doesnt give u unique trigger?? Wat does it do....


I'd try makin it simpler

Code:
hero ar
    Events
        Map initialization
    Conditions
    Actions
        Set hero[1] = Shaman
        Set hero[2] = Lich
        Set hero[3] = Shadow Priest
        Set hero[4] = Teeveseth
        Set hero[5] = Hydromancer
        Set hero[6] = Fire Revenant
        Set hero[7] = Night Assasin

Code:
random
    Events
        Player - Player 2 (Blue) types a chat message containing -random as An exact match
    Conditions
    Actions
       Unit - Create 1 hero[random number between 1 and 7] for (Triggering player) at ((Triggering player) start location) facing Default building facing (270.0) degrees
             Player Group - Pick every player in (All players) and do (Actions)
                    Loop - Actions
                        Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
            Else - Actions
Couple more things need adding ofcourse ^^
 

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
exge said:
for some reason this trigger doesnt give me uinque random heroes...

Code:
random
    Events
        Player - [B]Player 2 (Blue)[/B] types a chat message containing -random as An exact match
    Conditions
    Actions
        Set random_data[random_hero] = random_count
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                random_count Greater than or equal to 1
            Then - Actions
                Set random_hero = (Random integer number between 1 and random_count)
                Unit - Create 1 hero[random_data[random_hero]] for (Triggering player) at ((Triggering player) start location) facing Default building facing (270.0) degrees
                Game - Display to (All enemies of (Triggering player)) the text: (playername[(Player number of (Triggering player))] + ( has randomed  + (Proper name of (Last created unit))))
                Set random_count = (random_count - 1)
                Player Group - Pick every player in (All players) and do (Actions)
                    Loop - Actions
                        Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
            Else - Actions

Player 2?
 

exge

New Member
Reaction score
15
yes, me when i test it .. i get heroes fine ... but they somtimes repeat ... and theres the problem cos none of my spells are mui

@Deathtomato > Your version doessnt fix the problem... i need a hero to be taken out of a array when it is randomed ....
 
M

Maximus

Guest
I've ever tasted that. Don't try it at World Edit or the result will be the same.
 

exge

New Member
Reaction score
15
@Maximus using world edit is ok, cos i disabled the fixed random seed ... but i still get repeat heroes !! :banghead: :banghead: :banghead:
 
M

Maximus

Guest
Testing Map at World Editor will give same result. If you play it through other (as long as it isn't Test Map at World Editor) it will work. Trust me.
 

Anything.

New Member
Reaction score
69
Maximus said:
Testing Map at World Editor will give same result. If you play it through other (as long as it isn't Test Map at World Editor) it will work. Trust me.
Naaah. Not if he disables the seeds ;)
 

exge

New Member
Reaction score
15
yes.. i disabled the fixed random seed ... but im still getting repeats .... :banghead:
 

exge

New Member
Reaction score
15
its okay .. im not scolding you ... :p well i did try it out .. heck i even tried it out on bnet with a few friends ... still didnt work ...
 
M

Maximus

Guest
sorry, then. :D
but I just think this is easier:
set Hero[1] = ...
set Hero[2] = ...
set Hero[3] = ...

Then:

For Each player who plays
set Random_Integer = Random integer between 1 - ...
Create 1 Hero[Random_Integer] for (picked player) at TempPoint facing Default...

sorry of anything wrong again :p .
 

exge

New Member
Reaction score
15
it doesnt work, like i said i need it such that Player X selects a hero by random, that hero cant and never will be able to be randomed by any other player
and no .. i dont mean .. disable training/construciton of the unit... cos that will only make it unalbe to buy that unit ...
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
exge said:
Code:
hero arr
    Events
        Map initialization
    Conditions
    Actions
        Set hero[1] = Shaman
        Set hero[2] = Lich
        Set hero[3] = Shadow Priest
        Set hero[4] = Teeveseth
        Set hero[5] = Hydromancer
        Set hero[6] = Fire Revenant
        Set hero[7] = Night Assasin
        Set random_count = 7
        For each (Integer A) from 1 to 7, do (Actions)
            Loop - Actions
                Set random_data[(Integer A)] = (Integer A)

Code:
random
    Events
        Player - Player 2 (Blue) types a chat message containing -random as An exact match
    Conditions
    Actions
        Set random_data[random_hero] = random_count
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                random_count Greater than or equal to 1
            Then - Actions
                Set random_hero = (Random integer number between 1 and random_count)
                Unit - Create 1 hero[random_data[random_hero]] for (Triggering player) at ((Triggering player) start location) facing Default building facing (270.0) degrees
                Game - Display to (All enemies of (Triggering player)) the text: (playername[(Player number of (Triggering player))] + ( has randomed  + (Proper name of (Last created unit))))
                Set random_count = (random_count - 1)
                Player Group - Pick every player in (All players) and do (Actions)
                    Loop - Actions
                        Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
            Else - Actions

I've seen these triggers before... I think phyrex1an posted them. Would you mind posting the original post?
 

exge

New Member
Reaction score
15
its ok .. i fixed it ... ok heres the solution ... its really stupid

change map initialization to time elapsed 1 sec ... :banghead: :banghead: :banghead:
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
exge said:
its ok .. i fixed it ... ok heres the solution ... its really stupid

change map initialization to time elapsed 1 sec ... :banghead: :banghead: :banghead:

Lol :p

Not your fault, I probably would've done the same thing, except for the fact that I almost never use map initialization. You can use time elapsed 0.00 seconds too though.. :)
 
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

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top