Staredit Network > Forums > Modding Assistance > Topic: "randcondjmp" Number Generator
"randcondjmp" Number Generator
Sep 13 2008, 12:28 am
By: Sand Wraith  

Sep 13 2008, 12:28 am Sand Wraith Post #1

she/her

-StarCraft - randcondjmp - Number Generator v1.zip
-StarCraft - randcondjmp - Number Generator v2.zip

(Super-compressed, used 7-zip; seriously, the ZIP is like 1/6 of the actual filesize.) (Based on v1.)

Okay, this program, programmed using the programming language Turing, was programmed to take input in the form of a positive integer from 1 to 100 and convert it into a percent for StarCraft's iscript.bin file. Included in this ZIP is the source code in text and in Turing source, so if you don't trust the EXE file, well then there you go; no malice intended.

Retarded Legal Agreement here: By using this program, you agree that I (as in the maker) cannot be held liable for damage to your computer caused by this program by itself, yada yada yada, blah blah blah, more vague legal notices in EULA and ToS, etc., etc., woohoo!

-

v1 note: If there should be another version, then I'll add a gritty menu-esque function to allow you to choose whether you want to save an output TXT file. It would also allow you to pick if you want to convert the number backwards, to a normal percent (in case you ever forget what the number was).

And I am aware that the calculation might be dead easy, but I thought this program would make it all the more convenient. Hooray!


-

v2: A menu has been added, and now you can navigate it to convert numbers both ways.

Post has been edited 2 time(s), last time on Sep 27 2008, 6:12 am by Hydrolisk.




Sep 13 2008, 1:37 am Fisty Post #2



Useful, definitely going in my modding cabinet.



None.

Sep 13 2008, 2:33 pm Doodle77 Post #3



Or you could just put number * 255/100 into a calculator...



None.

Sep 13 2008, 4:21 pm Sand Wraith Post #4

she/her

*lulz*

I know. I knew that while I was making this. I'm just saying, it's a little more convenient, especially if the user doesn't already know how to convert the numbers.




Sep 15 2008, 2:48 am A_of-s_t Post #5

aka idmontie

... wow... How completely pointless... Why didnt you make a series randcondjmp maker so that someone can make a series of 5 randcondjmps that all have the same probability of firing?



Personal GitHub
Starcraft GitHub Organization - Feel free to request member status!
TwitchTV

Sep 15 2008, 2:52 am O)FaRTy1billion[MM] Post #6

👻 👾 👽 💪

I agree. People wouldn't be saying "Or I could calculate ...", they would instead be saying "Now I don't have to calculate ...". :D



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Sep 15 2008, 8:05 pm Sand Wraith Post #7

she/her

Quote from O)FaRTy1billion[MM]
I agree. People wouldn't be saying "Or I could calculate ...", they would instead be saying "Now I don't have to calculate ...". :D

Quote from A_of-s_t
... wow... How completely pointless... Why didnt you make a series randcondjmp maker so that someone can make a series of 5 randcondjmps that all have the same probability of firing?

I don't think I understood either of the above.




Sep 18 2008, 3:47 am A_of-s_t Post #8

aka idmontie

Say that there are two randcondjmp ( which I will refer to as RCJ ) in a row with the exact same probablity of firing number. When you test it, you'll find that the first RCJ has a higher observed probablity of firing. I go into deeper explanation of RCJs in my wiki about Tedious Coding.

http://www.staredit.net/wiki/Javascript
http://www.staredit.net/wiki/Tips_for_Tedious_Coding



Personal GitHub
Starcraft GitHub Organization - Feel free to request member status!
TwitchTV

Sep 27 2008, 5:23 am Sand Wraith Post #9

she/her

Ah, yes, I've been meaning to reply a while ago but I kept getting held back.

I've read those, although I thought I'd do something similar but with a number generator.

I need to update this...

-

Updated.

Post has been edited 1 time(s), last time on Sep 27 2008, 6:09 am by Hydrolisk.




Sep 30 2008, 4:16 am Sand Wraith Post #10

she/her

Quote from A_of-s_t
Say that there are two randcondjmp ( which I will refer to as RCJ ) in a row with the exact same probablity of firing number. When you test it, you'll find that the first RCJ has a higher observed probablity of firing.

Ah, I believe that with the help of my father, I now understand how to properly implement series of percentages such that each one will have an equal chance of being picked.
I think I can add that to RCJ-generator v3.

-

Here's what I have.

Divide 100% into the number of possibilities there are. The quotient is "a." This is the % that you want to be equal.
"b" has initial value of 100.
"c" is a percent variable.
"d" is the term of the pattern.

1: a = bc (If "a" were 10%, then it would be: 10% = 100c; thus, to complete the equation, c must be .1.) You need 10%.
2: a = (b-a)c (Thus, 10% = (100-10)c; c must be 0.11111... (10/90)) You need 11.11111111...%
3: a = (b-a(d-1))c (Thus, 10% = (100 - 10(3-1))c; c must be 0.125.) You need 12.5%
...

It's hard to explain. But I think I can make it work somehow...




Oct 3 2008, 9:16 pm Sand Wraith Post #11

she/her

RCJ v3 will allow you to input real numbers (better defined, rationals).

(Cross out the above formulae. There's a better way to explain it, I just don't know how to properly. I know how to do it though.)




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
Please log in to shout.


Members Online: Roy, DiearAnother