Euflorium: The Eufloria Community
Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: Orion63 on August 18, 2011, 03:15:41 AM
-
function LevelSetup()
-- Global Values
Globals.G.Asteroids=(0)
SetBackdropColor(18, 0, 0)
roid = AddAsteroid(0, 0)
roid.Owner = 0
roid:SetRadius(50)
roid.Moveable = false
print(roid.Radius)
end
function LevelLogic()
print(roid.Radius)
coroutine.yield()
end
Code above should create a 50radius asteroid, but after LevelSetup it's radius increases to ~245.
Any reason and/or fix for the radius increase after level setup?
-
Use .Radius = 50
Or atleast I do and never got any problems... And keep in mind that 50 is a very small number, so the game might change it for visability sake :)
-
Nope, still doesn't work.
The thing is, that the zoom level is pretty small, and you at radius 50, it can be seen clearly
Funny thing is that if owner = 1, radius stays 50.
Thanks, anyway ;)
-
Problem:
function LevelLogic()
print(roid.Radius)
coroutine.yield()
end
You have a coroutine.yield(), but no While loop!
-
It doesn't necessarily have to be in a loop. coroutine.yield() just passes back control to other coroutines, ready to be picked up again. In the case above, it is completely unnecessary, since there is nothing that takes up a lot of time, but in other cases, it could be advisable.
Again, I refer you to http://www.lua.org/pil/9.html
-
Problem:
function LevelLogic()
print(roid.Radius)
coroutine.yield()
end
You have a coroutine.yield(), but no While loop!
That was actually just a test. Even if I loop it, the outcome it's the same.
And regarding the tip that you gave me on the other topic(Of changing the radius on the LevelLogic function), I did that, but obviously the trees already planted there, stayed where they were initially(making them grow outside of the planet).
Thanks anyway ^^
-
How much does it change BTW?
-
...
Code above should create a 50radius asteroid, but after LevelSetup it's radius increases to ~245.
...
-
Ohh, didn't read it ;)
-
You could add the trees in LevelLogic() too, just don't use the PlantTree() or whatever it's called.
-
You could add the trees in LevelLogic() too, just don't use the PlantTree() or whatever it's called.
As the only asteroid not empty, the game plants trees automatically. My luck, huh :P
-
Try adding player trees/seedlings in LevelSetup too. Then it won't have to auto-add them, which might stop it from screwing everything up. :>
-
If it's NOT empty, why does it add trees to it?