random colors

  • Thread starter Thread starter darkassaisin
  • Start date Start date
D

darkassaisin

Guest
on my map i want to make i so there are 3 circles of powers each which a name of a color and i want to make it so when a units steps in the right circle they get something but what i don't know is how to make the circle i want it to be random so its no always the same color
 
heres a well ok mode to do it...
create a circle of power, copy it to u got as much as needed and change the colour the circle of power has to a different per circle u have copyed

create a variable array (unit-type) (ill call it UT in the trigger below)

trigger1
--event--
time elpsed 0.1 seconds

--actions--
set UT[1]=circle of power (red)
set UT[2]=circle of power (blue)
set UT[3]=circle of power (green)
set UT[4]=circle of power (yellow)

trigger2
--events--
time elapsed 0.2 seconds

--actions--
create 1 UT[random intigner between 1 and 4] at (whatever place u want it) facing default building
 
i get how to make it random in the first trigger but i don't understand what u r doing in the second trigger it looks like ur making a unit or something when i m making it the winnig circle of power be different each time
 
1. You already have the circles on the map.
2. You have them colored already.
3. You have small regions in the center of the circle.

Code:
Winning Circle
    Events
        Map initialization
    Conditions
    Actions
        Set Wining_Region = (Random integer number between 1 and 3)

Win
    Events
        Unit - A unit enters Circle1 <gen>
        Unit - A unit enters Circle2 <gen>
        Unit - A unit enters Circle3 <gen>
    Conditions
    Actions
        Wait 0.30 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        ((Circle1 <gen> contains (Triggering unit)) Equal to True) and (Wining_Region Equal to 1)
                        ((Circle2 <gen> contains (Triggering unit)) Equal to True) and (Wining_Region Equal to 2)
                        ((Circle3 <gen> contains (Triggering unit)) Equal to True) and (Wining_Region Equal to 3)
            Then - Actions
                Game - Display to (All players) the text: You've Won!
            Else - Actions
                Do nothing

Uh.... Every time I test it, the random number is 3... My only guess is not to have it right at the opening of the map, or random number sucks at being random but... There ya go.
 
thx i will try that i guess i will make it happen when it is 5 sec into the game as the event instead of intilization
 
yep if it doesn't wait it will be the same thing each time and it looked like u put 2 triggers there or is it one and u just usedif/then/else because i saw that u put one of those on there
 
i no the region stuff my map has 40 regions and i understand the world editor well i just don't know some things so i come here and ask u guys who know those things i m looking for
 
Every time I test it, the random number is 3

are you using the test map feature by any chance? If so, make sure you have turned "use fixed random seed" off. (file -> preferences -> test map -> the check box is there)

not that your theory isn't sound though, funny things do tend to happen if you try to do stuff at exactly the moment of map initialisation.
 
dude the set winning_region thing i assume u made that one up but i don't know what to do i can't find set interger anywhere where is it?
 
dude on the if/then/else action what where the conditions i don't get how u got 3 when u only get 1
 
dude i did the exact thing that u wrote there and when i steped in the circle nothing happened whats wrong?
 
Hmm

From what I can tell there are 3 senarios you might be talking about.

1)
You have 3 ciclres that change color every game, (red, blue, yellow) and the red one is always the winner.

2)
You have 3 circles, (left, middle, right) and the winning circle just has a random position.

3)
A combo of both where it is based on the position, but the colors also change as well.

Please clarify which one it might be.
 
Sorry this was meant for darkassaisin, because i could quite understand his question.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1
  • The Helper The Helper:
    Weekend went by too fast. Next weekend I am going to try to do a nature thing - buddy of mine lives by the Colorado river and has some kayaks and invited me to do some kayaking from a place he knows to get on the river.
  • Ghan Ghan:
    That sounds like an adventure.
  • The Helper The Helper:
    400 users all online all looking at latest content
  • The Helper The Helper:
    I wonder how all these bots that sit on the lastest content page get passed anubis or maybe they did not but they are just registering on whos online
  • The Helper The Helper:
    showing up on whos online not registration
  • Ghan Ghan:
    The first gate is stopping all the bots that don't execute javascript.
  • Ghan Ghan:
    That's the main thing with Anubis - no Javascript, no site. Typically you can still get the site to load without Javascript.
  • The Helper The Helper:
    I remember the whole javascript thing, question - how many real people disable that?
  • The Helper The Helper:
    Hell I guess I could go back on the stats to know that - we probably capture that and we know the before and after
  • Ghan Ghan:
    Real users can't really disable Javascript anymore these days.
  • Ghan Ghan:
    The internet is broken without it.
  • Ghan Ghan:
    Bot readable, not human usable.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!

The Helper Discord

Staff online

  • Ghan
    Administrator - Servers are fun

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top