Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I can just box 4 or what ever dice, with the mouse. This is the R key with extra steps.
Thanks again Mr. Stump
--Loop, runs through each item in the bag, sets its position and rotation for its destination, and pulls it out
local addRot = math.random(0,359)
for i, v in pairs(contents) do
--This is how we determine the position of each individual removed item. (see end for more)
local xp = xPos + math.sin( (addRot+(spokes*i)+yRot)*0.0174532 ) * radius
local yp = yPos + height
local zp = zPos + math.cos( (addRot+(spokes*i)+yRot)*0.0174532 ) * radius
Or do you mean the same dice end up at the same point over and over? That's an easy one. add a self.shuffle() right before takeObject() takes everything out of the bag to shuffle up the dice first.
I may re-write the rolling to use roll(), then position them down so they don't scatter all over. (roll throws them in the air)
As for the mathmatical solution, here is how I apply rotation: http://pastebin.com/1fEkiuA5
You can see commented out just some of the other solutions I have attempted.
I am also working on a solution involving quats with the help of some nice internet people. Basically, creating a random quat meeting certain requirements and then converting it to Euler angles. Fun stuff, and over my head math-wise. But the good news is even if I don't get it, the dice rolls are quite random now, if not quite perfect.
For those reasons, the feature is off by default. I made a simple variable you can edit at the top of the code to activate the feature.
I really like this. Thank you.
Anyway to post the roll (with player steam name) to chat?