Page 1 of 1

One guestion about random numbers.

Posted: Wed Sep 11, 2013 11:24 pm
by Vilespring
I remember seeing somewhere about adding random things to, things. (you get my drift) My question is, is this addition totally random, or is it more like a counter? because I have a stupid idea that seems kinda fun! :lol:

EDIT: gonna tell you my secret, because I cannot keep it it! :lol:
I'm going to take all the tank parts, and mix them up.
a random hull, random tracks, random turret, random gun. Sounds STUPIDLY FUN!!! :lol: :lol:

Re: One guestion about random numbers.

Posted: Thu Sep 12, 2013 7:05 am
by freddy
lol! go for it! i know it works for weapons but havent tried on other parts, should work tho :)

and it is more like a counter, seems to start with the second object listed when you load a map

viewtopic.php?f=43&t=1749

Re: One guestion about random numbers.

Posted: Sat Sep 14, 2013 1:16 am
by Vilespring
I got some results. When first testing it, it was great. Then, I noticed, that all it does is pick the SAME 7 COMBINATIONS, AND LOOPS THEM!!! :(
Is there a way to make it more.... random?

There is, theoretically, 2401 combinations, but it only gets 7. I don't want to to make each individual combo and have a spanner randomly make one.

so, I need a more random random number generator. (if that makes any sense :lol: )

Re: One guestion about random numbers.

Posted: Sat Sep 14, 2013 1:52 am
by freddy
nope no real random generator, but maybe if you make for example 5 base thingys (tanks or what ever) but then add 6 "random" of some other stuff (rotational bundle) to it, and 7 of the next (weapons on that rotational bundle), 8 of next thing you add and so on, then its gonna be asynchronous and give you more combinations

Re: One guestion about random numbers.

Posted: Sat Sep 14, 2013 2:03 am
by Vilespring
so just add repeats to the numbers?
Thank god for the find and replace function :lol:

Re: One guestion about random numbers.

Posted: Sat Sep 14, 2013 9:12 pm
by freddy
5 tanks was a bad example hehe

but like 1 tank and say 3 ShermanTower, 4 different ShermanGunBase, then when tank #4 spawns it will have ShermanTower1 and ShermanGunBase4, when tank 5 spawns ShermanTower2 and ShermanGunBase1 etc

the more odd pieces you add in the chain the more combinations you get

Code: Select all

ObjectTemplate.create Bundle ShermanComplex
ObjectTemplate.addTemplate ShermanTower
ObjectTemplate.setPosition 0/-0.8/0
ObjectTemplate.setRandomGeometries 3

Code: Select all

ObjectTemplate.create RotationalBundle ShermanTower1
ObjectTemplate.addTemplate ShermanGunBase
ObjectTemplate.setPosition 0/1.95/0.77
ObjectTemplate.setRandomGeometries 4