tomholmes10 Posted March 30, 2011 Share Posted March 30, 2011 Hi! I have random problem one cartridge! I switch on start zone random, one device work well - two device same time give me identical results! How i can made real random? Holmes Quote Link to comment
Ranger Fox Posted March 30, 2011 Share Posted March 30, 2011 It would be helpful, please, if you'd include the section of your cartridge that is performing the random operation. I believe "start zone random" means that, when the cartridge starts, the zone is being moved to a random location? Quote Link to comment
tomholmes10 Posted March 30, 2011 Author Share Posted March 30, 2011 It would be helpful, please, if you'd include the section of your cartridge that is performing the random operation. I believe "start zone random" means that, when the cartridge starts, the zone is being moved to a random location? Hei! zones is fixed, i try activat starting point randomly! algus = math.random(1,6) if algus == 1 then zone001.Active = true zone001.Visible = true end if algus == 2 then zone002.Active = true zone002.Visible = true end if algus == 3 then zone003.Active = true zone003.Visible = true end if algus == 4 then zone004.Active = true zone004.Visible = true end if algus == 5 then zone005.Active = true zone005.Visible = true end if algus == 6 then zone006.Active = true zone006.Visible = true end Holmes Quote Link to comment
+triga Posted March 30, 2011 Share Posted March 30, 2011 (edited) Just a suggestion, try working with elseif algus = math.random(1,6) if algus == 1 then zone001.Active = true zone001.Visible = true elseif algus == 2 then zone002.Active = true zone002.Visible = true elseif algus == 3 then zone003.Active = true zone003.Visible = true elseif algus == 4 then zone004.Active = true zone004.Visible = true elseif algus == 5 then zone005.Active = true zone005.Visible = true elseif algus == 6 then zone006.Active = true zone006.Visible = true end Not sure if that will work, but you can try Edited March 30, 2011 by triga Quote Link to comment
tomholmes10 Posted April 4, 2011 Author Share Posted April 4, 2011 Solution: function alguss() local n = Player.ObjectLocation.latitude n = n * 1000000 local l = string.reverse(n) l = l / 1000000 l = string.format("%2.0f",l) l = l+2 local v = 1 while v < l do algus = math.random(1,6) l = l-1 end if algus == 1 then zone001.Active = true zone001.Visible = true end if algus == 2 then zone002.Active = true zone002.Visible = true end if algus == 3 then zone003.Active = true zone003.Visible = true end if algus == 4 then zone004.Active = true zone004.Visible = true end if algus == 5 then zone005.Active = true zone005.Visible = true end if algus == 6 then zone006.Active = true zone006.Visible = true end end Maybe somebody have better! Holmes Quote Link to comment
tomholmes10 Posted May 22, 2011 Author Share Posted May 22, 2011 Latest not working well, here is better: function algus() local n = Player.ObjectLocation.latitude local l = string.reverse(n) l = l / 10000000000 l = string.format("%2.0f",l) l = l+2 local v = 1 while v < l do tulem = math.random(1,12) l = l-1 end end Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.