Eufloria > Eufloria HD Mods

iPad Custom Level [HELP, Very Beginner]

<< < (9/9)

Tomfloria:
I'm not sure, levels 1 - 8 are currently my own at the moment :P, but I've definately seen movement of camera positions during the story mode.

sillytuna:
To pan the camera:

SelectionClear() -- Clear current selection
SetCameraFocusToAsteroidID(2, 90000) -- Zoom to asteroid 2, set zoom to 90000

I don't know if setting the camera position itself will work on iOS, but either way you definitely need to have unhidden an asteroid in the area around where you're going or the camera won't be allowed there.

Tomfloria:
Well 3 camera positions which are the first three change to different positions of the home asteroid, so the area is fine, it just doesn't go we're I want if the user moves the screen.

It would have been nice if you made a movecameraavalablebutton haha.

annikk.exe:
Tom,

You asked for some code help a few posts back.


--- Quote ---When asteroid 0 gets 4 seedlings and has 4 dyson trees i would like a message to be shown and the speed option available
--- End quote ---



I spotted this:


--- Code: --- if GetAsteroid(0).NumDysonTrees + 4 and GetAsteroid(0).NumSeedlings + 4 then
--- End code ---

Should be:


--- Code: --- if GetAsteroid(0):GetNumDysonTrees() == 4 and GetAsteroid(0):GetNumSeedlings(1) >= 4 then
--- End code ---


http://www.dyson-game.com/smf/index.php?topic=212.msg1913#msg1913
For info on getting asteroid infos like this :>


By the way, if you're running this code inside a loop, once the conditions are met, they'll be met on EVERY run through the loop.
So you might want to add a latch variable, so that it only triggers once..

annikk.exe:
You could do it with while loops..



--- Code: --- while GetAsteroid(0):GetNumDysonTrees() < 4 and GetAsteroid(0):GetNumSeedlings(1) < 4 then
coroutine.yield()
end

WaitReal(2)
SetSpeedSwitchAvailable(true)
Message("This is going to take a while~Use the Speedometer on the top left of the screen to speed things up.", false, 1.0, "Left")
--- End code ---


Or you could do it the pro way (heh) with conditionals..



--- Code: --- latch = false

while GameRunning() do

if GetAsteroid(0):GetNumDysonTrees() == 4 and GetAsteroid(0):GetNumSeedlings(1) >= 4 and latch == false then
latch = true
WaitReal(2)
SetSpeedSwitchAvailable(true)
Message("This is going to take a while~Use the Speedometer on the top left of the screen to speed things up.", false, 1.0, "Left")
end

coroutine.yield()
end
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version