Staredit Network > Forums > SC1 Mapping Tools > Topic: Tool to generate triggers to create a random unit
Tool to generate triggers to create a random unit
Jan 25 2022, 10:47 pm
By: Prankenstein  

Jan 25 2022, 10:47 pm Prankenstein Post #1



Maps that give random units to players are popular (and the map I'm currently creating relies on it) so I created a little tool using Javascript and decided to share it here for what it might be worth to someone. It's in a very crude state, as I created it for my specific purpose alone.

It allows the user to create and input a CSV file (created in Excel or other spreadsheet) which in turn generates the necessary trigger conditions and actions to create a random unit.

In my case, I'm randomizing 6 switches to give me one random unit out of 64 possible units. In the HTML file, I simply set the variable "x = 6", and in the CSV file, there's 64 rows which contain the unit and the number of units to be spawned.

Zip file containing the HTML file and sample CSV is attached. Just simply run the HTML file and select the CSV to see it in action.



Attachments:
random-unit-trigger-generator.zip
Hits: 1 Size: 122.13kb



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[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
[2024-5-16. : 5:24 pm]
lil-Inferno -- poopoo
Please log in to shout.


Members Online: 6camilac933eM4, Moose