Need help with randomizing!

cheeto515

New Member
Reaction score
1
Okay, I'm making a map with some human players, and one alien. In the beginning you choose a "Marine class" from the bottom left. Then you get teleported to a random area on the map (every game it's diff), and one person is changed into the alien ( but it's random ). Those last two things are what I need help with! I just have no idea how to do that..
 

LordOglog

New Member
Reaction score
16
Code:
Actions
    Set play = (All players)
    Player - Set name of (Random player from play) to Alien
but instead of changing their name do whatever you want doing o them done to them.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
You need to set all the players into a variable and pick a random one out of the player group. I'm just guessing, but you want the alien to hostile against the remaining players and vice versa?

This trigger should pick a random player from 'TmpForce', make the player hostile against the remaining players and vice versa. Lastly, it moves all units of each players into a random spot on the playable map area.

Code:
Random Player
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Set TmpForce = (All players)
        Set TmpPlayer = (Random player from TmpForce)
        Player Group - Remove TmpPlayer from TmpForce
        Player Group - Pick every player in TmpForce and do (Actions)
            Loop - Actions
                Player - Make TmpPlayer treat (Picked player) as an Enemy
                Player - Make (Picked player) treat TmpPlayer as an Enemy
                Set TmpGroup = (Units owned by (Picked player))
                Unit Group - Pick every unit in TmpGroup and do (Actions)
                    Loop - Actions
                        Set TmpPoint = (Random point in (Playable map area))
                        Unit - Move (Picked unit) instantly to TmpPoint
                Custom script:   call RemoveLocation(udg_TmpPoint)
                Custom script:   call DestroyGroup(udg_TmpGroup)
        Custom script:   call DestroyForce(udg_TmpForce)
        Set TmpGroup = (Units owned by TmpPlayer)
        Unit Group - Pick every unit in TmpGroup and do (Actions)
            Loop - Actions
                Set TmpPoint = (Random point in (Playable map area))
                Unit - Move (Picked unit) instantly to TmpPoint
                Custom script:   call RemoveLocation(udg_TmpPoint)
        Custom script:   call DestroyGroup(udg_TmpGroup)
 

Attachments

  • player.w3x
    18.2 KB · Views: 79

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
he meant something else
look if u wanna make the units u can always use this action:
Code:
Action
     Unit - Move (Triggering unit) instantly to (Random point in (Playable map area))
about one of them randomly becomes an alien try this:
Code:
Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
    Loop - Actions
        Set RandomUnit = (Random unit from (Last created unit group))
        Unit - Remove (Triggering unit) from the game
        Unit - Create 1 Footman for (Picked player) at (Random point in (Playable map area)) facing (Position of (Triggering unit))
some1 fix me if i was wrong
 

cheeto515

New Member
Reaction score
1
Hmmmmm. Angel and you Andrew have a sort of mix of what I needed. Angel, your second code fixes a problem, but, creates another one. "Unit - Create 1 Footman for (Picked player) at (Random point in (Playable map area)) facing (Position of (Triggering unit))" This is complicated! grr. In the beginning as I mentioned before, you get to chose a "Class" Ice, Fire, etc. I was going to have an "alien marine" It has the same stats as the class you picked, all that stuff, but a space after the name so people can't tell. The marine would have "Trueform" which turns it into a hydralisk in which case he can then attack other marines as hostiles. The problem, how do I make it, so that if your the alien, it starts you out as the alien, with the correct "Alien Marine" Class/hero??? Seperate Triggers?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top