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.
[07:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
Please log in to shout.


Members Online: RIVE, Ultraviolet