Jump to content

Pseudo random problem


tomholmes10

Recommended Posts

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

Link to comment

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 by triga
Link to comment

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

Link to comment

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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...