assigning random buildings to players

sensesxfailx

New Member
Reaction score
0
I am making a carribean risk and i would like to know how i assign the buildings randomly for each player. I would greatly appreciate any help
thank you in advance
 
You could try this:

Code:
Random Buildings
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units of type <Building>) and do (Actions)
            Loop - Actions
                Unit - Change ownership of (Picked unit) to (Random player from (All players matching (((Matching player) slot status) Equal to Is playing))) and Change color

This will leak a unit group and a force, I believe.
 
sorry but i found a problem with it. it is that since its a risk 1 person cannot own a country at start how would i make it so this happens.
 
You mean you can't use Map Init. as the event? Well, eliminate that event, then just run that trigger from another when you want to assign countries, or set it so the elapsed game time is whatever.
 
no no no u got it wrong its a risk so at the start of the game when everyone gets assigned a random country i want to make sure that one person does not own a country at start.
 
That makes absolutely no sense. :confused: Contradictions abound.
 
ok well have u ever played risk devo it would be like that and if u havnt ill try and explain
in the begining they randomly assign bases to people like the trigger you gave me but one thing is that no one person can own a whole country like lets say theres two bases in germany ok and the map starts and gives players random bases i want it so that those two bases in germany cannot be owned by the same person in the begining when the trigger hands out bases
i hope that is explained a little better.
 
Got it. So you're saying it's similar to the original Risk in that several territories make up a continent. Well, that's difficult because each country will have a different number of territories.... I think you would have to do a check to make sure that all of the territories were not owned by the same player. It would be very helpful if you could upload the map so I can see what you have so far.
 
Base is unit right ? Add all one country "base" units to that country unit group variable. Give random "base" units to players, if player gets "base" unit change some boolean to true, for example "playerHasBaseInCountry set true".
It asumes before giving "base" to player check does that boolean is false.
Now when one country is divided change all booleans to false and pick new country "base" unit group and repeat cycle.
As note you chould do integer counter too, when boolean is set to true check dosn' t that integer counter isn' t equal to max playing players number. If it is change counter to 0 and reset all booleans to false and start giving again "base" units. Now there is even some balance in it and it guarantees when all players have already one "base" but there are more "base" units all will get owner.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    It is weird seeing a way more realistic users online number
  • The Helper The Helper:
    Happy Tuesday Night!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:

      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