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.
[01:05 am]
Ultraviolet -- :wob:
[2025-7-17. : 6:45 pm]
Vrael -- no u
[2025-7-17. : 12:40 am]
Ultraviolet -- u mad bro
[2025-7-15. : 11:53 pm]
Vrael -- UR WATERFALL SUX AND U SHUD B ASHAMED (excuse me while I go and cry in a corner somewhere at all the hours I spent trying to make a waterfall that nice)
[2025-7-14. : 5:10 pm]
Ultraviolet -- No kidding, that thing is incredibly slick. If I didn't know SC that well, I'd assume it was a standard graphic that came with the game
[2025-7-14. : 10:14 am]
Oh_Man -- zomg that waterfall is the best thing i've ever seen
[2025-7-14. : 5:13 am]
Moose -- dumbducky
dumbducky shouted: Huge breakthrough: I fixed the RAID failure to automount and my stupid router applied the correct IP
put ddwrt or openwrt on router. Or maybe don't I have no idea if it will make your use case easier
[2025-7-14. : 4:58 am]
Moose -- O cool, someone else fixed it while I was dead or w/e
[2025-7-13. : 4:32 am]
dumbducky -- Huge breakthrough: I fixed the RAID failure to automount and my stupid router applied the correct IP
[2025-7-12. : 5:13 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Ultraviolet