Sheep Tag New and improved, Help please

F

fratleyslaye

Guest
Code:
Untitled Trigger 001
    Events
        Map initialization
    Conditions
    Actions
        Set Random_number = (Random integer number between 1 and 12)
        If ((Player(Random_number)) Not equal to (Random player from Wolves)) then do (Player Group - Add (Player(Random_number)) to Wolves) else do (Do nothing)
        Set wolves_count = (Number of players in Wolves)
        If (wolves_count Not equal to 4) then do (Trigger - Run (This trigger) (ignoring conditions)) else do (Do nothing)

It isn't working correctly =( And is it possible to remove the lightning strikes? I guess when i placed one, i had it on terrain huge and it placed them ALLL over my map, i didnt even realise until after i had saved it a few times, my fault i guess, but any way to take them out?? Id rather not reset whole map.

Sooda, I'll try to give help/ideas to your map in any way, you have helped me out so much ;)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> If ((Player(Random_number)) Not equal to (Random player from Wolves))

You would have to be very lucky for this condition to work.
Because even if the player is already in "Wolves", some random player of that group most likely isn't the selected one...

There is a test, under "boolean", that says "Player in Player-Group".


Or, assuming you already have a player group variable that holds all the players:

For each Integer A from 1 to 4, do
- Set Player = Random player from PlayerGroupVariable
- Player group - Add Player to Wolves
- Player group - Remove Player from PlayerGroupVariable


> And is it possible to remove the lightning strikes?

What lightning strikes?

The doodad version?
Just open the doodad palette, select them and press "delete".

Or, select one, then menu: Edit / Select all special,
which will select all of them at once, on the entire map,
then press "delete".
 

Sooda

Diversity enchants
Reaction score
318
> It isn't working correctly =(
Exactly what isn' t working correctly ? Will it store 4 random players ? If you want to know who are sheeps do this:
Code:
wolves spawn
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        [B]For each (Integer A) from 1 to 12, do (Player Group - Add (Player((Integer A))) to Sheeps)
        Player Group - Pick every player in Wolves and do (Player Group - Remove (Picked player) from Sheeps)[/B]
        Player Group - Pick every player in Wolves and do (Unit - Create 1 Farm for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees)
        Player Group - Pick every player in [B]Sheeps[/B] and do (Unit - Create 1 Farm for (Picked player) at [B](Center of Region 000 <gen>)[/B] facing Default building facing degrees)
Integer A can be found from Function: Conversion- Convert Player Index to Player > Function: For Loop Integer A
"Sheeps" is emty player-group variable.
@AceHart
> If ((Player(Random_number)) Not equal to (Random player from Wolves))

You would have to be very lucky for this condition to work.
Because even if the player is already in "Wolves", some random player of that group most likely isn't the selected one...
(Random player from Wolves) should compare that player with all players in that player group, I' m sure of it. Random in this case means:
Compared player not equal to 1st player in player-group.
Compared player not equal to 2nd player in player-group.
Compared player not equal to 3rd player in player-group.
Compared player not equal to 4th player in player-group.
Compared player not equal to k player in player-group.
Compared player not equal to 12th player in player-group (If there is so many them but here are only 1 to 4 players max).
Then add player to that player-group otherwise do nothing
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> (Random player from Wolves) should compare that player with all players in that player group.

Why would it? :p

"Random player from Wolves" is just that, a random player of that group...

But, there is, under boolean, a condition that says "Player in player group".
 
F

fratleyslaye

Guest
Code:
Untitled Trigger 001
    Events
        Map initialization
    Conditions
    Actions
        Set Random_number = (Random integer number between 1 and 12)
        If ((Player(Random_number)) Not equal to (Random player from Wolves)) then do (Player Group - Add (Player(Random_number)) to Wolves) else do (Do nothing)
        Set wolves_count = (Number of players in Wolves)
        If (wolves_count Not equal to 4) then do (Trigger - Run (This trigger) (ignoring conditions)) else do (Do nothing)


Code:
Untitled Trigger 002
    Events
        Time - Elapsed game time is 20.00 seconds
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Player Group - Add (Player((Integer A))) to Sheeps)
        Player Group - Pick every player in (All players) and do (Player Group - Remove (Picked player) from Sheeps)
        Player Group - Pick every player in Wolves and do (Unit - Create 1 The wolf for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees)
        Player Group - Pick every player in Sheeps and do (Unit - Create 1 Teh Sheep for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees)

Edit** It seems to randomize the teams, but EVERYONE ends up on one team, wolfs arent against sheep, they are allies.

Okay, the object of the game is to stay alive for the alotted time if you are a sheep, and to kill all sheep if you are a wolf. When a sheep dies, it becomes a spirit in the middle of the map over the circle of power. Attacking the wisp as sheep will make the wisps revive back into sheep. I am trying to set the trigger to have the sheep revive into spirits when they die, would that be as simple as making a trigger of "condition - unit dies(sheep)" and then "action - wisp is created at center of map" and vice versa when the sheep kills the wisp to revive them?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Untitled Trigger 001

Well, yes... we have seen this trigger three times now...


> For each (Integer A) from 1 to 12, do (Player Group - Add (Player((Integer A))) to Sheeps)

This adds players 1 to 12 to "Sheeps", playing or not, just all of them.

> Player Group - Pick every player in (All players) and do (Player Group - Remove (Picked player) from Sheeps)

This removes all players from "Sheeps". We will have an empty player group.

> Player Group - Pick every player in Wolves and do (Unit - Create 1 The wolf for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees)

Assuming there is something in "Wolves", each player gets a "The wolf".

> Player Group - Pick every player in Sheeps and do (Unit - Create 1 Teh Sheep for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees)

Nothing happens here, "Sheeps" doesn't contain any players.
If there were, each one would get a "Teh Sheep".
 

Sim

Forum Administrator
Staff member
Reaction score
534
fratleyslaye said:
Code:
Untitled Trigger 001
    Events
        Map initialization
    Conditions
    Actions
        Set Random_number = (Random integer number between 1 and 12)
        If ((Player(Random_number)) Not equal to (Random player from Wolves)) then do (Player Group - Add (Player(Random_number)) to Wolves) else do (Do nothing)
        Set wolves_count = (Number of players in Wolves)
        If (wolves_count Not equal to 4) then do (Trigger - Run (This trigger) (ignoring conditions)) else do (Do nothing)

This part is actually quite random ;)
It adds a random player that isn't equal to a random player in wolves in wolves. What happens if there are say 3 players in Wolves, and the random player is the 1st one and the number is the 2nd one ?

You will add the 2nd player in Wolves... But he is already in Wolves !

Eventually, you ran this trigger another time, so maybe it will make it work. I also think it will add all the players if it never stops :p But it is becoming very complicated to look if it works or not, while you could have only used ''For Each Integer A...'' actions and add the players you need in Wolves.

Let's say your trigger runs 18 times before it adds all the players in wolves (you got unlucky on the numbers)... That's 17 unneeded triggers running !
 
F

fratleyslaye

Guest
too early but I will try it out in the morning, thanks everyone. . . and shouldnt he be reported for spamming every topic?? :mad:
 

Sim

Forum Administrator
Staff member
Reaction score
534
NiKaNoRoU_Dr said:
Malto's trigger owns!

I just copy-pasted his trigger and told him what was wrong. I did not write any trigger there :rolleyes:

fratleyslaye said:
too early but I will try it out in the morning, thanks everyone. . . and shouldnt he be reported for spamming every topic?? :mad:

NiKaNoRoU_Dr ? Lol.
 
F

fratleyslaye

Guest
Yes, that guy, has posted 30 some odd times in like 30minutes, all stating that someones "owns" or there idea rocks. .

@AceHart When it randoms the teams, it ends up with everyone getting a sheep or a wolf, BUT they tend to be on the same team every time it randoms, sheep popup too but sometimes a player will get shorthanded and not get a unit at all :p

BTW. Ill name my triggers, sorry =]
 

Sooda

Diversity enchants
Reaction score
318
@AceHart
Huh ? It' s working btw, just >download< it I uploaded the map with that random trigger. And you will never get 2 units for same player, check it out if you find that it isn' t working correctly then uff... Your again right. I will add fixed trigger for random teams and they will not be allyes( Replacing random from player group with "right one" :eek:
EDIT: Found out Editor will crash if there isn' t inaf players, so I have to add player detection system... it isn' t hard though real to integer when real is 1.5 is 1 Holy cow ! So wrong ! Didn' t they learn math in school ? I think I will overcome that. Already finished ally and "fixed" boolean why I need playing players, btw your game balance ratio is 2 for every one wolf there are two sheeps, I keep it in mind when I finish Playing players detection.
EDIT2: Finished version 2, now it has playing players detection trigger and optional single player mode. To get max out of new improved version try to add computer players or take them fewer. By doing that you can see what is changed. To disable single player mode disable two triggers what are in bold
Code:
Preloading
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Player Group - Add (Picked player) to Playing_players)
        Set Wolves_needed = ((Real((Number of players in Playing_players))) / 2.00)
        [B]If ((Number of players in (All players controlled by a User player)) Equal to 1) then do (Trigger - Turn on Single player mode <gen>) else do (Trigger - Run Random wolve player group <gen> (ignoring conditions))
        If ((Number of players in (All players controlled by a User player)) Equal to 1) then do (Trigger - Turn off wolves spawn <gen>) else do (Do nothing)[/B]
and add this:
Code:
Trigger - Run Random wolve player group <gen> (ignoring conditions)
I will attach map just download it. If you find bugs tell and I try to help :)
EDIT3: Added:
Code:
If (Wolves_needed Less than 1.00) then do (Set Wolves_needed = 1.00) else do (Do nothing)
just in case. If something goes wrong, disable it and maybe it fixes problem.
 
F

fratleyslaye

Guest
Code:
Preloading
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Player Group - Add (Picked player) to Playing_players)
        Set Wolves_needed = ((Real((Number of players in Playing_players))) / 2.00)
        If (Wolves_needed Less than 1.00) then do (Set Wolves_needed = 1.00) else do (Do nothing)
        If ((Number of players in (All players controlled by a User player)) Equal to 1) then do (Trigger - Turn on Single Player Mode <gen>) else do (Trigger - Run Random wolf player group <gen> (ignoring conditions))
        If ((Number of players in (All players controlled by a User player)) Equal to 1) then do (Trigger - Turn off Wolves Spawn <gen>) else do (Do nothing)
        Trigger - Run Random wolf player group <gen> (ignoring conditions)

Code:
Random wolf player group
    Events
    Conditions
    Actions
        Set Random_number = (Random integer number between 1 and 12)
        If ((((Player(Random_number)) is in Wolves) Not equal to True) and (((Player(Random_number)) slot status) Equal to Is playing)) then do (Player Group - Add (Player(Random_number)) to Wolves) else do (Do nothing)
        If ((Integer(Wolves_needed)) Equal to (Number of players in Wolves)) then do (Do nothing) else do (Trigger - Run (This trigger) (ignoring conditions))

Code:
Wolves Spawn
    Events
        Time - Elapsed game time is 20.00 seconds
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Player Group - Add (Player((Integer A))) to Sheeps)
        Player Group - Pick every player in Wolves and do (Player Group - Remove (Picked player) from Sheeps)
        Player Group - Make Wolves treat Wolves as an Ally with shared vision
        Player Group - Make Sheeps treat Sheeps as an Ally with shared vision
        Player Group - Pick every player in Wolves and do (Unit - Create 1 The wolf for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees)
        Player Group - Pick every player in Sheeps and do (Unit - Create 1 Teh Sheep for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees)

Code:
Single Player Mode
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Player Group - Pick every player in (All players controlled by a User player) and do (Player Group - Add (Picked player) to Wolves)
        Player Group - Make Wolves treat Wolves as an Ally with shared vision
        Player Group - Pick every player in Wolves and do (Unit - Create 1 The wolf for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees)
        Set single_player = (Owner of (Last created unit))
        If ((Player number of single_player) Less than or equal to 3) then do (For each (Integer A) from 1 to 2, do (Unit - Create 1 Teh Sheep for (Player((Player number of single_player))) at (Center of (Playable map area)) facing Default building facing degrees)) else do (Do nothing)
        If ((Player number of single_player) Greater than or equal to 9) then do (For each (Integer A) from 1 to 2, do (Unit - Create 1 The wolf for (Player((Player number of single_player))) at (Center of (Playable map area)) facing Default building facing degrees)) else do (Do nothing)
        Player Group - Pick every player in (All players controlled by a Computer player) and do (Player Group - Add (Picked player) to Sheeps)
        Player Group - Make Sheeps treat Sheeps as an Ally with shared vision
        Game - Display to (All players) the text: (Single player modes is enabled for + (Name of single_player))

I'm not sure if I did something wrong, they look the same to me but I end up getting like 10 sheep and 2 wolfs all the time, instead of 8 sheep and 4 wolfs like it is supposed to be. They still also spawn when nothing is in the spot; for example, me and 4 friends tested it, that is 5 people and 12 units still appeared.
 

Sooda

Diversity enchants
Reaction score
318
Still I think I found some bugs what I am going to fix,but this is mine black :banghead: -
Code:
        If ((Number of players in (All players controlled by a User player)) Equal to 1) then do (Trigger - Turn on Single Player Mode <gen>) else do (Trigger - Run Random wolf player group <gen> (ignoring conditions))
        If ((Number of players in (All players controlled by a User player)) Equal to 1) then do (Trigger - Turn off Wolves Spawn <gen>) else do (Do nothing)
        [B]Trigger - Run Random wolf player group <gen> (ignoring conditions)[/B]
You don' t need action in bold beacause If/ Then/ Else does what they need to do. When you are playing more than 1 human player you don' t need action in bold delete it.
About single player mode fix this:
Code:
If ((Player number of Single_player) Less than or equal to 3) then do (For each (Integer A) from 1 to 2, do (Unit - Create 1 Farm for (Player(((Player number of Single_player) [B]+ (Integer A)[/B]))) at (Center of Region 000 <gen>) facing Default building facing degrees)) else do (Do nothing)
If ((Player number of Single_player) Greater than or equal to 9) then do (For each (Integer A) from 1 to 2, do (Unit - Create 1 Farm for (Player(((Player number of Single_player) [B]- (Integer A)[/B]))) at (Center of Region 000 <gen>) facing Default building facing degrees)) else do (Do nothing)
And is Single Player Mode <gen> grey ? so it can' t run by itself. Now I did new working one ( It should be now perfect)
Team random v3
 

Attachments

  • Randomize Teams v3 (wolves).w3x
    22 KB · Views: 182
F

fratleyslaye

Guest
mmm so what if i only want to play this as multi player, and do u mean delete the bold actions from both of your posts or just the one you stated now?
 

Sooda

Diversity enchants
Reaction score
318
Now I am confusing you :eek: when you downloaded v3 there are everything fixed. If you have v2 then yes disable in bold or delete these actions, I suggest to just dl v3. Sry for so much bug fixes.
 
F

fratleyslaye

Guest
Yes, your confusing me a bit :p But it's all fine because you are the one who has truly been helping me =] Promise your name will be going into my map in credits or as a units name or in the loading screen or even in the terrain(up to you if you would like to choose)

Ill try dling v3 =] thanks for everything
 
F

fratleyslaye

Guest
Its working BUT when teams get randomed, some people are allies with wolfs, and gold is no longer distributed correctly. First it was 150gold to all sheep 30 seconds into the game or something like that. Wolfs were getting it, and some sheep were.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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