One guestion about random numbers.

Ask questions, discuss ideas, get answers

One guestion about random numbers.

Postby Vilespring » Wed Sep 11, 2013 11:24 pm

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:
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Vilespring
 
Posts: 743
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: One guestion about random numbers.

Postby freddy » Thu Sep 12, 2013 7:05 am

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
User avatar
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re: One guestion about random numbers.

Postby Vilespring » Sat Sep 14, 2013 1:16 am

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: )
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Vilespring
 
Posts: 743
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: One guestion about random numbers.

Postby freddy » Sat Sep 14, 2013 1:52 am

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
User avatar
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re: One guestion about random numbers.

Postby Vilespring » Sat Sep 14, 2013 2:03 am

so just add repeats to the numbers?
Thank god for the find and replace function :lol:
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Vilespring
 
Posts: 743
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: One guestion about random numbers.

Postby freddy » Sat Sep 14, 2013 9:12 pm

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
User avatar
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: No registered users and 21 guests