Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Placing Units in Random Locations
Placing Units in Random Locations
Jul 14 2015, 2:41 pm
By: yairzick  

Jul 14 2015, 2:41 pm yairzick Post #1



Hello,

I'm interested in doing the following: I have a text file saying something like
0.2, 0.3, 0.5

Is there some way to read these numbers from the text file, and then place a unit (say, a marine) in location 1 with probability 0.2, in location 2 with probability 0.3 and in location 3 with probability 0.5?

I'm aware that one can make some randomized numbers using switches, and then place units according to that randomization;

the thing is that I want to have the numbers read from file (because some other script is generating them).

Many thanks!

Yair



None.

Jul 14 2015, 3:29 pm Roy Post #2

An artist's depiction of an Extended Unit Death

No. SC maps can only access things within the map itself or within SC's memory; a text file is neither of those things, and therefore could not be accessed.

This would additionally create synchronization issues were it possible.




Jul 14 2015, 8:35 pm rockz Post #3

ᴄʜᴇᴇsᴇ ɪᴛ!

You'll have to manually translate the triggers.

I believe someone has created a text trigger scripting language which would be able to do this, I assume via OOP or something.

The actual triggers you'll need is:
Randomize 10 switches, and generate a random number between 0-1023
1 trigger with range 0-200 for the DC to create the marine in location 1
1 trigger with range 201-510 for the DC to create the marine in location 2
1 trigger with range 511-1023 for the DC to create the marine in location 3

The reason for so large a number, you can really only do binary randomization well, so unless your total number of outcomes fits into a nice binary number (2,4,8,32,64,etc...)

You'd be surprised how easy it is to use something like FARLAP or just notepad to create the proper triggers you'd need to do this.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:00 am]
Oh_Man -- he hasnt won a single game so far this is hilarious
[11:41 pm]
Oh_Man -- new arty username Rage Against The Machine
[10:14 pm]
Oh_Man -- https://m.youtube.com/watch?v=KPXri8q9ZBs artys vsing the bot now
[08:12 pm]
Ultraviolet -- do you even lift bro?
[2026-9-23. : 5:21 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: NudeRaider yeh thts straight up cheating
the mutas yes, the wraiths probably not. Have you even watched the video? ;)
[2026-9-23. : 12:56 pm]
Oh_Man -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
yeh thts straight up cheating
[2026-9-23. : 12:24 pm]
Oh_Man -- arty's done another vid. he's also announced he's going to organise showmatches with pro, with NO maphacks, so we can see its actual capabilities
[2026-9-23. : 10:09 am]
NimoStar -- It can by playing the same map thousands of times. It is similar to AI speedrunning games
[2026-9-23. : 2:30 am]
Symmetry -- I dreamed about that as a kid. The idea of a computer capable of analyzing a starcraft map and calculating the fastest possible way to hit the victory condition
Please log in to shout.


Members Online: UndeadStar