Camera and some letters
» Siedler Map Source Forum » Siedler DEdK Script Forum » Camera and some letters
Seiten: 1
Qba331PL
|
#1 27.02.2018 17:42 Beiträge: 102 |
Camera and some letters
Hi again. I've got 2 questions about scripts and editor:
1. I want to use flaying camera, moving camera, something like that. For example map starts and it doesn't start with normal, static briefing but it flyes after the army and hero that also moves. I don't know how to do it.
2. I need something like (I don't know if I translated it well) variables in Lua (I will describe it now if I translated it wrong and it has nothing to do with Lua). I need something like a letter that can safe a number. For example a=2. And then for example b=a+1 (so b=3). It would be very useful in my maps in future.
Best regards
Qba331PL
mcb
|
#2 27.02.2018 18:11 Beiträge: 1472 |
Camera: You have 2 possibilities, real cutscenes or some Lua functions (maybe with modified briefing code).
Lua Functions would be:
Camera.StopCameraFlight() -- stopps previous camera flights Camera.InitCameraFlight() -- initializes a flight Camera.RotFlight(rot, ft) -- sets the target rotation Camera.ZoomSetDistanceFlight(zDist, ft) -- sets the target zoom distance Camera.ZoomSetAngleFlight(zWin, ft) -- sets the target zoom angle Camera.FlyToLookAt(pos.X, pos.Y, ft) -- sets the target position -- ft ist the time in seconds the flight should last
Varables:
a=2 b=a+1 c="test" d=true e={[1]=1} f = functon() end [code] Every one of these is a Lua global variable, where you can store values across functions. If you put a local in front of the variable, it is only visible inside this function. [code] function foo() local x = 2 Message(x+2) end
But this mathematical variable is not a valid Lua variable (as you might expect)
5*x=2-x
Qba331PL
|
#3 27.02.2018 21:34 Beiträge: 102 |
Zitat von mcb:
Camera: You have 2 possibilities, real cutscenes or some Lua functions (maybe with modified briefing code).
Lua Functions would be:
Camera.StopCameraFlight() -- stopps previous camera flights Camera.InitCameraFlight() -- initializes a flight Camera.RotFlight(rot, ft) -- sets the target rotation Camera.ZoomSetDistanceFlight(zDist, ft) -- sets the target zoom distance Camera.ZoomSetAngleFlight(zWin, ft) -- sets the target zoom angle Camera.FlyToLookAt(pos.X, pos.Y, ft) -- sets the target position -- ft ist the time in seconds the flight should last
Varables:
a=2 b=a+1 c="test" d=true e={[1]=1} f = functon() end [code] Every one of these is a Lua global variable, where you can store values across functions. If you put a local in front of the variable, it is only visible inside this function. [code] function foo() local x = 2 Message(x+2) end
But this mathematical variable is not a valid Lua variable (as you might expect)
5*x=2-x
Thank you. Oh, and, do you know a map here that has some Lua camera functions?
mcb
|
#4 28.02.2018 13:44 Beiträge: 1472 |
You could have a look at the Fake-Cutscenes:
http://www.siedler-games.de/si...doku.php/utilscripts:cutscenes (But it is in German)
Seiten: 1