All random Trigger help

Craigimus

New Member
Reaction score
0
straight to business :p

29 heroes with possibility of having 30 heroes

player types -random

gives random hero between the 29 - 30

and doesnt let them -random again to get 2 heroes

one hero per player.



Also allrandom mode (after clicking a dialog button)

doing the same as above but without the -random bit


I've set all the heroes in an array
[1] ------ [29]

i just need the trigger to stop people getting the same heroes and repeating to get more then one hero.


Thanks in advance.
 

Samael88

Evil always finds a way
Reaction score
181
gives random hero between the 29 - 30

You would need to set the random number 1 to 29:confused: That is if you are current only getting the last unit
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
So the 30th hero is a hidden hero? Your wording is kinda confusing...
 

Craigimus

New Member
Reaction score
0
i hvae 29 heroes made but i might be making a 30th hero im undecided.

forget about the hero number i need help with the triggering xD lol
 

Craigimus

New Member
Reaction score
0
This is the triggers i tried but whenever i click the dialog to start the random hero game error's and closes.

Any ideas what is causing this ?


Code:
Events
    Map initialization
Conditions
Actions
    Set AllHeroes = 29
    Set HeroesLeft = 29
    Set RandomHero[1] = Dragon Knight
    Set RandomHero[2] = Jaina
    Set RandomHero[3] = Blood Mage
    Set RandomHero[4] = Larodar
    Set RandomHero[5] = Muradin Bronzebeard
    Set RandomHero[6] = Sylvanas Windrunner
    Set RandomHero[7] = Blademaster
    Set RandomHero[8] = Far Seer
    Set RandomHero[9] = Tauren Chieftain
    Set RandomHero[10] = Shadow Hunter
    Set RandomHero[11] = Blademaster of Blackrock Clan
    Set RandomHero[12] = Tree
    Set RandomHero[13] = Lich
    Set RandomHero[14] = Dreadlord
    Set RandomHero[15] = Crypt Lord
    Set RandomHero[16] = Tichondrius
    Set RandomHero[17] = Sylvanas
    Set RandomHero[18] = Priestess of the Moon
    Set RandomHero[19] = Warden
    Set RandomHero[20] = Ghost
    Set RandomHero[21] = Illidan
    Set RandomHero[22] = Furion
    Set RandomHero[23] = Illidan (Evil)
    Set RandomHero[24] = Dark Ranger
    Set RandomHero[25] = Beastmaster
    Set RandomHero[26] = Pandaren Brewmaster
    Set RandomHero[27] = Pit Lord
    Set RandomHero[28] = Sith Lord
    Set RandomHero[29] = Tichondrius
     Do Multiple ActionsFor each (Integer A) from 1 to 29, do (Actions)
        Loop - Actions
            Set SingleHeroes[(Integer A)] = (Integer A)


Code:
Setting AllRandom
    Events
        Dialog - A dialog button is clicked for Setting_Dialog
    Conditions
        (Clicked dialog button) Equal to (==) Setting_AllRandom
    Actions
         Do Multiple ActionsFor each (Integer A) from 1 to 29, do (Actions)
            Loop - Actions
                 Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Player((Integer A))) slot status) Equal to (==) Is playing
                        ((Player((Integer A))) controller) Equal to (==) User
                    Then - Actions
                        Set AllHeroes = (Random integer number between 1 and HeroesLeft)
                        Unit - Create 1 RandomHero[SingleHeroes[AllHeroes]] for (Player((Integer A))) at (Position of Icy Treasure Box 0033 <gen>) facing Default building facing (270.0) degrees
                        Set SingleHeroes[AllHeroes] = HeroesLeft
                        Set HeroesLeft = (HeroesLeft - 1)
                    Else - Actions




This one is if i used the command -random

im not sure what to put after taht one xD




Code:
Random Hero
    Events
        Player - Player 1 (Red) types a chat message containing -random as An exact match
        Player - Player 2 (Blue) types a chat message containing -random as An exact match
        Player - Player 3 (Teal) types a chat message containing -random as An exact match
        Player - Player 4 (Purple) types a chat message containing -random as An exact match
        Player - Player 5 (Yellow) types a chat message containing -random as An exact match
        Player - Player 6 (Orange) types a chat message containing -random as An exact match
        Player - Player 7 (Green) types a chat message containing -random as An exact match
        Player - Player 8 (Pink) types a chat message containing -random as An exact match
    Conditions
    Actions
 

emilemil1

New Member
Reaction score
20
ok i dont have editor available so i will try to make it simple without writing code :)

at initialization you put each unit in an array like you have done

then for the allrandom you repeat this for all players that are playing and that are not computers: (for each integer A from 1 to X do actions)

-----

set integer = random number between 1 and (number of heroes)

if (your hero array [integer] is equal to (chosen) then -randomize it again-

XXXrepeat this a couple of times (maybe 100 times) to make sure that nobody will get the same hero as someone elseXXX

create unit of type (your hero array [integer]) at (starting position) for player number of (integer A)

set (your hero array [integer]) = (chosen)

-----

then for the -random trigger you do exacly the same but without repeating it for every single player like you would do in a allrandom trigger

you will need a unit type that counts as a (chosen) unit so that one wont be picked again by the trigger. If you want to be really sure that the player got a hero you could do:

-----

set group = units owned by player [integer A] matching (matching unit is a hero equal to true)

if number of units in group is equal to 0 then do

set player = player with player number [integer A]

run (trigger that does exacly like a -random trigger but with (triggering player) replaced with [player]

call DestroyGroup (udg_group)

-----

Since i dont have a editor in front of me i cant test it sry :) but im pretty sure it works

EDIT: or you can make one of each hero type in a region owned by neutral passive and then make the trigger pick a unit in the region and create a unit of that type for the player, then remove that unit from the region

that would actually be alot easyer but you may not want to have a box of units on you map :) for the looks
 

Craigimus

New Member
Reaction score
0
Since i have a box where all the heroes i have are there i think using that last part would be good but i dont quite understand how to trigger it up xD

Setting AllRandom
Events
Dialog - A dialog button is clicked for Setting_Dialog
Conditions
(Clicked dialog button) Equal to (==) Setting_AllRandom
Actions


then what would it be ?


Random Hero
Events
Player - Player 1 (Red) types a chat message containing -random as An exact match
Player - Player 2 (Blue) types a chat message containing -random as An exact match
Player - Player 3 (Teal) types a chat message containing -random as An exact match
Player - Player 4 (Purple) types a chat message containing -random as An exact match
Player - Player 5 (Yellow) types a chat message containing -random as An exact match
Player - Player 6 (Orange) types a chat message containing -random as An exact match
Player - Player 7 (Green) types a chat message containing -random as An exact match
Player - Player 8 (Pink) types a chat message containing -random as An exact match
Conditions
Actions

And i need the trigger part for that one as well


and i need to cancel each trigger so each player can only use -random once and if they are choosing a hero tat they cant double click 2 heroes to recieve 2 heroes.
 

Craigimus

New Member
Reaction score
0
ok ive encountered another problem :S

i have a trigger set out to give random heroes from the region and remove them as well

but the heroes randomly given are the same hero each time :S
how do i change it so the heroes change each time. ? :S
 

13lade619

is now a game developer :)
Reaction score
399
when a user rolls a number already chosen, random again.
add the past rolls to some condition..

i.e.

last user had 5 as random.
next user also had 5, roll again until the rolled number is not 5.

so... if the 4th user..

random != x
random != y
random != z

x,y,z being the last randomed numbers.
 

Craigimus

New Member
Reaction score
0
nonono

each player recieves a different hero

but each time i restart the game i recieve the same hero like each player as the same hero as from the previous game.


Setting AllRandom
Events
Dialog - A dialog button is clicked for Setting_Dialog
Conditions
(Clicked dialog button) Equal to (==) Setting_AllRandom
Actions
Unit - Move (Random unit from (Units in Heros <gen>)) instantly to (Center of Red <gen>)


that trigger gives me the same hero each time i restart the map .....
 

dragonhord

Knowledge is true opinion. - Plato
Reaction score
82
In your triggers you can just set an array... I.E. an integer array... Lets say you call it RandomVar... Make sure it's an array. When you do -ar set your RandomVar[Player(Integer A)] = RandomVar[Player(Integer A)] + 1... Then in your random trigger just add a condition that says RandomVar[Player Number of Triggering Player] = 0... If I get what you mean... That way no one can -random... And in order to prevent people getting the same hero... I believe the DotA Template, even though it's old, features something of that nature... You could always check that out... And just so you know... When you are in world editor and you click "Test Map" anything that uses random integers will roll the same number no matter what... It's only on actual games that you get a random number... Which is probably why you get the same hero no matter what...
 

Craigimus

New Member
Reaction score
0
Ahhh okies so if i create local game with map it will be different each time xD

no wonder lols my bad =]
 

DrEvil

FCRI Associate!
Reaction score
111
Hey if you want a quick AR system why not check out mine ?

Easy to configure , Hero , If they are playing , where to spawn .

BTW - Its in jass , but its not that hard if you edit what you need to edit

All-Random System
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top