Eufloria > Eufloria HD Mods

iPad Custom Level [HELP, Very Beginner]

<< < (8/9) > >>

Tomfloria:
Can anyone help me on this please?

I would like the code to do this...

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


--- Code: --- if GetAsteroid(0).NumDysonTrees + 4 and GetAsteroid(0).NumSeedlings + 4 then
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

-- Wait for 4 seedlings to be made
while GetAsteroid(0).NumSeedlings < 4 do
coroutine.yield()
end
--- End code ---

sillytuna:

--- Quote from: Aino on May 02, 2012, 01:37:12 AM ---GetEmpire(1):UpdateAsteroidLists() is Updating the Asteroid List (i.e how many asteroid the empire has, which asteroids, if the empire is defeated and other stuff).
SetSpeedSwitchAvailable(true) is probably allowing to change the speed in-game, like the developers mode +/-.
WaitReal(1) is, I think, to stop everything. 1 should be 1 millisecond, not a second.
Message("04_01", true, 1.0, "Top") is probably Message(Text, Clickable???, Size, Position(Text Based))(I'm not certain about this, do some experiementation! :D)
IsiOS() doesn't need any explanation.

--- End quote ---

SetSpeedSwitchAvailable: This just disables or enables the top left speed control. Levels disable it for the first few seconds during opening message displays for one reason - some levels have AI on both switches and timers which are only affected after the text has finished. Having a speed control at the start can thus give a player a head start. It's perhaps not the ideal fix but that's why you'll see this in levels (disabled in set up, enabled after the intro message).

There are many other availability messages too - note that these tend to match game settings although you could be evil and prevent the player planting flowers by disabling the button even though they could grow them according to the rules!

WaitReal(t) - waits t seconds of real time. This is not game time, i.e. it is unaffected by the speed control. It's mainly used for message delays. WaitGame(t) is game time. Parameters are seconds. Nothing actually stops by the way, it just pauses further execution of that function. The game can still end as normal as long as scripting has been done correctly (i.e. the CheckConditions function is valid).

Message(<ID>, <AUTO DISPLAY TIME true/false>, <SIZE>, <LOCATION ["Top", "Left", "Center", possibly right and bottom]>) - you can add text to lang.csv. See my iOS scripting post.

Also, someone was setting zoom to 50. I have no idea if this is ok or not but it looks like a really low number to me. Crashing may be possible if the zoom is set beyond a sensible range (zooms tend to be in the high 100s or 1000s from memory). The camera code was reworked heavily a couple of times to suit the iPad and is probably not hugely flexible.

annikk.exe:
Thanks for the info about camera zoom...  the iPad version of the command expects different ranges than the PC, I think..?

All very informative.. :>

Tomfloria:
It's cleared a few things up, definitely thought WaitReal(1) was wait 1 second in game time, and the camera zoom, you'll have definitely seen me do this, but the player can zoom out whenever they want :P, the camera zoom was only for scripted events, e.g say an explanation of the level and functions where dramatic poses of the asteroids adds to the drama :p I could show you what I mean, but I don't want to use your time :D

sillytuna:
I think level 2 does a pan and back at some point?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version