Page 1 of 1

Some Scripting questions.

Posted: Mon Jul 14, 2014 5:25 pm
by thelegend
Hey all,
i am going to rebuild the Liberty City from GTA 4. I already made one in my gta mod but after a while a learned a lot of new stuff and so on. Anyway would like to create something new one. So I have some questions with lua functions and how things may be possible.

1. Sky files:
It is possible to write a skyfile that changes the skydome after a few seconds/ minutes. Example: I have got 4 sky dome textures, divided into 4 models. And I want that the skydome 1 changes to skydome 2 after six minutes (or just the texture of the sky; both should work). I want to do a dynamic map because to capture all cp's needs time and the map gets bored after a while. ( I have more sky textures I'd like to use (I have 24 textures, every minute a new one)).
I have seen something similair in the based on the clone wars movie map. Don't know the name, but in this map the textures changes to day to evening to night after a few objectieves.

2. I only want to add a timer that counts up at 00:00 and repeats after 24 minutes. It just should be the clock time for my map. Exactly like in Gta. And it is possible to change the figures to custom "painted" figures (And maybe in other position?).

3. If you captured cp 1 you should capture cp 2 till cp 12. I don`t want that the players takes (He just play as one side) random cp's. And if a cp is controled the cp should be untakeable.

And one other but not so important thing is the sun. It is possible to let the sun rotate over the map? It starts at east side of my map and goes down in western side and is for 8 minutes under the terrain. I gta 4 the sun is really well hidden behind of dark grey clouds. So its not so important to get a rotating sun. It just may be a nice touch.

That`s all and I would be really happy If anyone can answer my questions.

Re: Some Scripting questions.

Posted: Mon Jul 14, 2014 5:50 pm
by razac920
I believe at least 2 and 3 are possible.

For 2, I would create 2 timers, make one of them visible and never start this timer. The other one make it invisible and looping every second to increase the value of the visible timer. Add a check for when it reaches 24 minutes to set it back to 0.

For 3, you coulld use SetProperty to edit each cp's control region. Initially get rid of all but cp1's control region, then when cp1 is capture, get rid of it's control region and add back in cp2's control region, and so on.

Re: Some Scripting questions.

Posted: Mon Jul 14, 2014 7:03 pm
by thelegend
I am going to look on it. I think I should do a campaign map.
And I really hope It will work.
I have one other question: It is possible to add effects after 5 minutes in game time and let it (example) rain for a few minutes. And again after a short time. And maybe other effects too?

Re: Some Scripting questions.

Posted: Mon Jul 14, 2014 7:34 pm
by Marth8880
thelegend wrote:1. Sky files:
It is possible to write a skyfile that changes the skydome after a few seconds/ minutes. Example: I have got 4 sky dome textures, divided into 4 models. And I want that the skydome 1 changes to skydome 2 after six minutes (or just the texture of the sky; both should work). I want to do a dynamic map because to capture all cp's needs time and the map gets bored after a while. ( I have more sky textures I'd like to use (I have 24 textures, every minute a new one)).
I have seen something similair in the based on the clone wars movie map. Don't know the name, but in this map the textures changes to day to evening to night after a few objectieves.
I'm positive there aren't any sky file parameters to achieve this. However, it'd be easiest to simply model a sky, place it in ZE, and script it in such a way that one sky is killed and the next one is spawned, or you could utilize the OverrideTexture ODF parameter and change the texture via that.
thelegend wrote:And one other but not so important thing is the sun. It is possible to let the sun rotate over the map? It starts at east side of my map and goes down in western side and is for 8 minutes under the terrain. I gta 4 the sun is really well hidden behind of dark grey clouds. So its not so important to get a rotating sun. It just may be a nice touch.
You'd probably be best off just modeling a glowing object that looks like a sun, but you won't have a sun flare or anything. Also, I don't think you'll be able to change the lighting dynamically.

Re: Some Scripting questions.

Posted: Mon Jul 14, 2014 7:52 pm
by thelegend
The first one. I can use the Inner skydome I have got in my Space2Sky2Ground maps. I think with ZE Animation It will work. The sun is not really important but I think I can draw one on my sky dome (Or take a photo of an existing sun).
Anyway thanks for help. If I have any more problems I am going to ask here.

Re: Some Scripting questions.

Posted: Mon Jul 14, 2014 10:41 pm
by LRKfm946
Just an idea: Create a 360 degree skydome with day on one side, night on the other and fade in between. Have it rotate slowly so it appears to change time of day. I'm not sure if you can make skydome objects cast shadows if the world light is above them, but if you can, you could have the night side of the skydome have polygons facing upwards (away from the ground) so it'll cast a shadow over the whole world at night.

Re: Some Scripting questions.

Posted: Tue Jul 15, 2014 4:06 am
by thelegend
I like the idea. Yes. I think I should try it out.
Edit: Ok. To my first question: I have added six skydome models with different textures (night, morning, day, evening...). In Zeroeditor animation I made six animations; all with a duration of 24 minutes. I am testing it out but for the first look it looks really nice and realistic. I am trying to get more from the sky.
If I may have any more questions I let you know.

Edit2: Yes. The switching skydomes work well. And look really awesome in game. I am going to show some screenshots soon.