Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: location on unit
location on unit
Jan 7 2008, 10:52 pm
By: Cloaked-Dragon  

Jan 7 2008, 10:52 pm Cloaked-Dragon Post #1



Is it possible to move a location to a random unit? All of the units are burrowed drones, i have about 30 of them and they are scattered around. When a switch is set, I want a 2x2 location randomly centre one of those drones.
I'm currently using the "move location" trigger, but it always seems to select the same drone.
Is there a way of fixing this to make it random without using to many locations?
Please help..



None.

Jan 7 2008, 11:05 pm Falkoner Post #2



The best way would be to get a random number, probably using Switches or Death Counts and then give that amount of drones to another player, then center the location and give those drones back.



None.

Jan 7 2008, 11:11 pm Cloaked-Dragon Post #3



Quote from Falkoner
The best way would be to get a random number, probably using Switches or Death Counts and then give that amount of drones to another player, then center the location and give those drones back.

Maybe you dont understand my senario or I just dont understand your answer?
I have 30 preplaced drones in a certain pattern and I want a location to centre on a random drone.



None.

Jan 7 2008, 11:25 pm Conspiracy Post #4



Ok, let me explain better what Falkoner said.

What he was stating, was that the way you were probabbly thinking of, would be using a none existing trigger, like "Center Location on random drone at any location"

What you would have to do, is get a random number, probably of deaths, and switches. Then you would have to give the same amount of drones as deaths, then move location, and center on it. Then do what you want.

The reason is, SC checks from left to right in that pattern only. It checks up to down in unit numbers (I have no clue what that is, just what I heard from someone else) To do a "random" center location, you would have to do what I suggest above.



None.

Jan 7 2008, 11:31 pm Cloaked-Dragon Post #5



Quote from FrIuT
Ok, let me explain better what Falkoner said.

What he was stating, was that the way you were probabbly thinking of, would be using a none existing trigger, like "Center Location on random drone at any location"

What you would have to do, is get a random number, probably of deaths, and switches. Then you would have to give the same amount of drones as deaths, then move location, and center on it. Then do what you want.

The reason is, SC checks from left to right in that pattern only. It checks up to down in unit numbers (I have no clue what that is, just what I heard from someone else) To do a "random" center location, you would have to do what I suggest above.

I still dont really understand when you say "Then you would have to give the same amount of drones as deaths,...".



None.

Jan 8 2008, 2:55 am who Post #6



Ok, first get a random death count # from 0 to 29 (easiest way is to have these triggers:

C:
if deaths of dc1 is 0
if deaths of dc2 is at most 28
A:
add 1 death of dc2
preserve

C:
if deaths of dc1 is 0
if deaths of dc2 is exactly 29
A:
set deaths of dc2 to 0
preserve

just have these running the whole game. DC1 is used to pause these triggers when needed, and dc2 is the random death.

so then when you start the randomizer:

C:
(conditions that start the random picker)
A:
set deaths of dc1 to 1
set deaths of dc3 to 1
(other actions that prevent this from continually running, such as moving a civ back)
preserve

C:
deaths of dc3 is 1
deaths of dc2 is at least 1
A:
subtract 1 death of dc2
give 1 drone owned by p12 to p11 at DroneLocation

C:
deaths of dc3 is 1
deaths of dc2 is 0
A:
set dc1 to 0
set dc3 to 0
center location ___ on drone owned by P12 at DroneLocation
(whatever you want to do)
give all drones at DroneLocation to P12

If you don't have hypertriggers, this will take a very long time to execute, so make sure you have them.
What this does it for every death that you have from the randomizer, it will give one drone at the location to another neutral player, so when you center the location, it will center on a drone owned by P12, which will be at a random area because some drones are owned by the other player.



None.

Jan 8 2008, 10:30 am NudeRaider Post #7

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Cloaked-Dragon
I still dont really understand when you say "Then you would have to give the same amount of drones as deaths,...".
OK another try to explain Falks solution:

The problem:
When centering a location on a unit SC checks the large location (usually anywhere) from left to right. The first unit SC finds is the leftmost unit. As you noticed it's always the same.

The solution:
But you can specify WHICH PLAYER owns the drones to look for.
So BEFORE you CHECK for a random drone (owned by lets say P1) you GIVE a random numer (lets say 10) of drones to ANOTHER PLAYER (lets say 2). The 10 leftmost drones will be given to P2 and the 20 other drones are still owned by P1.
Now you check for Drones of P1 at anywhere and you find the random number + 1 (11th) drone from the left.
After that give all Drones of P2 back to P1.
And then you have centered on a random drone.

Check someone09's triggers to see how to do that once you understood it.
(I Didn't check his triggers but I'm sure he knows how to do it right.) ;)




Jan 10 2008, 12:11 am Moose Post #8

We live in a society.

Have a look.




Jan 10 2008, 10:54 pm Cloaked-Dragon Post #9



Kk thx a lot guys, i get it now. :)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
Please log in to shout.


Members Online: Degon760, Roy, 1milae19100eh9