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.
[05:08 am]
NudeRaider -- Ultraviolet
Ultraviolet shouted: l in the chat for you cooked bois
| l I 1 │ ︳ 〡│┃︱ hope I did include your line of choice :awesome:
[2025-7-07. : 1:43 am]
Moose -- lil-Inferno
lil-Inferno shouted: chat am I cooked
chopped and cooked :pensive:
[2025-7-06. : 6:35 pm]
KrayZee -- at least you're not burnt
[2025-7-06. : 4:54 pm]
RIVE -- Too many cooks
[2025-7-06. : 4:20 pm]
Ultraviolet -- l in the chat for you cooked bois
[2025-7-06. : 3:09 pm]
lil-Inferno -- chat am I cooked
[2025-7-06. : 7:27 am]
Moose -- we cooked :pensive:
[2025-7-03. : 9:09 pm]
Sie_Sayoka -- im cooked
[2025-7-03. : 7:53 pm]
NudeRaider -- Sie is COCKING ... his mapping revolver. Next BANGer is on the way!
[2025-7-03. : 6:55 pm]
l)ark_ssj9kevin -- Sie is COOKING
Please log in to shout.


Members Online: tima123