Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 8:18 pm
All times are UTC + 0
Trigger for Day/Night-Cycle [solved] // Gamespeed
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [21 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Ich-Henker
Flamethrower


Joined: 06 Aug 2015
Location: Germany

PostPosted: Tue Oct 31, 2017 11:30 am    Post subject:  Trigger for Day/Night-Cycle [solved] // Gamespeed Reply with quote  Mark this post and the followings unread

Hey,

does anybody know the Trigger for Day/Night-Cycle to put in via a Text-Editor? Or has a Map in mind that hase one to find it on my own - becuase as of now I do not have a map in mind - I would have looked myself.

Thank you!

Edit_1: You need
[Triggers]
[Events]
[Actions]
[Tags]
[VariableNames]

Last edited by Ich-Henker on Thu Nov 02, 2017 9:26 am; edited 1 time in total

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Wed Nov 01, 2017 8:22 am    Post subject: Reply with quote  Mark this post and the followings unread

Open FA2 & press F1, the help file will pop up with a basic guide to making triggers. It should be enough to help you figure out how to make a day-night cycle yourself.

If you have any specific questions about triggers I'd be (& most others) will be happy to answer them.

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Wed Nov 01, 2017 8:29 am    Post subject: Re: Trigger for Day/Night-Cycle Reply with quote  Mark this post and the followings unread

FA2 Manual wrote:




13. Changing Lighting (Beginner)

Lighting includes five values for both storm and non-storm modes. Storm mode is what you see around the map whenever the Weather Storm is used; non-storm is anytime else. Temperate and Snow each have their own color settings for Morning, Afternoon, Dusk, and Nighttime.


Step 1: Begin Setting Up A Morning Temperate Map

Under the Edit menu, select Lighting. There are five settings each for the Normal and Storm Modes, as described above. All of the values are on a decimal-percentage scale, so 1.00 is normal lighting and 0.6 is 60% lighting. The five settings are:

a. Ambient - Controls the general lighting for any objects on the map, such as structures, units, and terrain brightness.
b. Level - Controls how much the lighting changes for each tile of elevation. DO NOT set the level to a value greater than about 0.30 (30%) or the lighting will change so drastically that high elevation will be almost pure white, and lower elevation will be so black as to be unobservable. 0.032 (3.2 % change) is about the average lighting step for most maps.
c. Red - Adjusts how red the terrain looks.
d. Green - Adjusts how green the terrain looks.
e. Blue - Adjusts how blue the terrain looks.
The Storm Mode settings are identical in function to all the regular mode settings.


Step 2: Change Normal Lighting Attributes

Change the following Normal attributes:

a. Ambient = 0.750000 // Decreases the normal lighting to 75%
b. Level = 0.032000 // Level is the same for most maps.
c. Red = 1.090000 // Slightly increases red (by 9%)
d. Green = 0.800000 // Decreases green to 80%
e. Blue = 0.490000 // Decreases blue to 49%


Step 3: Change the Storm Mode Attributes

Change the following Storm Mode attributes:

a. Ambient = 0.650000 // Storm is darker than normal lighting (at 65%)
b. Level = 0.032000 // Level is the same for most maps.
c. Red = 0.695000 // The Red, Green, and Blue values are shifted
d. Green = 0.445000 // from primarily red to primarily blue, while
e. Blue = 0.775000 // still maintaining the Morning effect.


Step 4: You Can Now Adjust Lighting!

Your temperate map will now show the morning effect in RA2 and will have a bluish tint whenever a Weather Storm is created. A table follows with some other lighting values from within RA2.

Temperate: Morning Afternoon Dusk Night
Ambient 0.750000 1.000000 0.750000 0.350000
Red 1.090000 1.080000 0.710000 0.510000
Green 0.800000 0.940000 0.810000 0.460000
Blue 0.490000 0.680000 1.190000 1.410000
Snow:
Ambient 0.750000 1.000000 0.750000 0.550000
Red 1.120000 0.990000 1.060000 0.760000
Green 0.800000 1.040000 1.070000 0.740000
Blue 1.330000 1.070000 1.540000 1.180000




Original tutorial writer: Thalassicus

I didn't see any trigger tutorials regarding lighting changes...

_________________
One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done. #Tongue

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Wed Nov 01, 2017 8:34 am    Post subject: Reply with quote  Mark this post and the followings unread

That's for changing the default map lighting & not making triggers...

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Wed Nov 01, 2017 8:57 am    Post subject: Reply with quote  Mark this post and the followings unread

Run the "Day Night Loop" script in FinalAlert which automatically adds the complete trigger action stuff.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Wed Nov 01, 2017 9:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Odd, I can't seem to find that script for FA2...

But FinalSun has it.

Sunrise.Actions:
73 Set ambient light=95
72 Set ambient rate=1070000000
71 Set ambient step=1019000000

Sunset.Actions:
73 =40
72 =1070000000
71 =1019000000

These are just for Lighting, no loops. Do those yerself #Tongue

_________________
One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done. #Tongue

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
Ich-Henker
Flamethrower


Joined: 06 Aug 2015
Location: Germany

PostPosted: Wed Nov 01, 2017 1:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks to all of you!

This is my first time map trigger editing so far i have this questions

1.How to put the Triggers in Order? With Events. I tried 13Elapsed Time giving the first Trigger a shorter elapsed time then the second and third but that doesn't worked as planned (only the second trigger is fired). In FA do the triggers read from bottom to top?
2. I have no idea how to create a trigger loop to have it reapeatedly go from day to night ... (I looked at the Honeymoon map but could not manage to understand it there)

Back to top
View user's profile Send private message
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Wed Nov 01, 2017 2:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ich-Henker wrote:
In FA do the triggers read from bottom to top?

They're read via ID-Number. Westwood's stock maps have some ...weird IDs.
By default, FA starts with 010000 (dunno how many zeros) for every new Trigger, Script, TaskForce or TeamType, and then increases it +1.
But IDs are something that only the game uses, or whoever is crazy enough to edit the whole map with Notepad, to know a Trigger's Actions and Events.
Triggers can also call on other Triggers using Actions too, which allows for this:
Ich-Henker wrote:
2. I have no idea how to create a trigger loop to have it reapeatedly go from day to night ... (I looked at the Honeymoon map but could not manage to understand it there)

Use Actions 53 and 54. They disable/enable Triggers respectively.

Start with this:
1) Have a Trigger with Event 13 Elapsed time. Set parameter to... what is the parameter's format here again? I know it isn't in seconds, but I don't think it's in frames either (what's the game's speed in RA2/YR single-player anyway?)

2) Set the Actions for that Trigger to be the ones in my previous post (you can find them in FA2's manual too, somewhere near the bottom)
Code:
Sunrise.Actions:
73 Set ambient light=95
72 Set ambient rate=1070000000
71 Set ambient step=1019000000
Sunset.Actions:
73 =40
72 =1070000000
71 =1019000000


3) Repeat until each Trigger sets a different time of day, then make sure all of them (except for a day-time of your choosing) are disabled.

What follows is the trickier part, and is also where the IDs come into play (for the modders and mappers using FA2, as well as the game/engine or Notepad-users):
4) If you have the Morning/Noon/Dusk/Night triggers (with each of them changing the lighting appropriately. Or not #Tongue) and decide to start the cycle with Noon:
Create new Actions for Noon:
53 Enable Trigger=DuskTrigger.ID (DuskTrigger.Name)
54 Disable Trigger=MorningTrigger.ID (MorningTrigger.Name)
For Dusk:
53 Enable Trigger=NightTrigger.ID (NightTrigger.Name)
54 Disable Trigger=NoonTrigger.ID (NoonTrigger.Name)
etc.

Basically, what-ever Trigger is next to spring must disable what-ever time/Trigger was before it (so it doesn't jump back to that time's Lighting, unless you want it messed up #Tongue) and enable the one that's supposed to come after it, so it can transition to that time's Lighting in the first place.

I don't know though if the transition is done smoothly/gradually in RA2/YR like in TS/FS, as the only mod that uses this that I know of is Mental Omega, and even then I think that was only in the first Allied mission, but I could wrong, seeing as I never really got that far due its ridiculous difficulty.

If the transition isn't gradual, you're going to have to make a new Trigger for every 'step' (MorningNoon1,MorningNoon2,MorningNoonFinal, etc.) IF you want it looking good.
Of course, this can be 'abused' to have time stuck somewhere between Morning and Noon for most of the mission, and then to transition straight to Noon-Dusk close to the end, or something...

_________________
One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done. #Tongue

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
Ich-Henker
Flamethrower


Joined: 06 Aug 2015
Location: Germany

PostPosted: Wed Nov 01, 2017 2:39 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wow great! Thank you.

It is in time units (says in the amnual).
Waht is about elapsed scenario time - does that work too?I try your tutorial  now!

Back to top
View user's profile Send private message
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Wed Nov 01, 2017 2:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ich-Henker wrote:
Wow great! Thank you.

It is in time units. I try it out now!


You're welcome, but how many seconds does one time-unit equal to? 0.2?
And what's the speed for the RA2/YR SP-Missions?
I NEED TO KNOW AND MODENC DOESN"T HAVE ANY ANSWERS! Crying or Very sad

_________________
One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done. #Tongue

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Wed Nov 01, 2017 4:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

Event 13 'Elapsed time' takes seconds as parameter.

Trying to factor game speed into it is irrelevant as everything in this game is tied to the current framerate (selected game speed only sets upper cap for framerate) and thus seconds/minutes and frames are interchangeable. Game basically treats 1 second as 15 frames. This also means that only at constant 15 FPS do things displayed in minutes/seconds like superweapon timers sync up with real time, otherwise it's slower or faster depending on FPS.

_________________

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
MustaphaTR
Scorpion Sniper


Joined: 22 Jan 2015
Location: Kastamonu, Turkey

PostPosted: Wed Nov 01, 2017 4:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ich-Henker wrote:

Waht is about elapsed scenario time - does that work too?I


Elapsed time counts from when the all other events are completed and trigger is enabled.

Elapsed scenario time counts from games' start.

_________________
CnCD2K Mod: http://www.moddb.com/mods/red-alert-2-yuris-revenge-cncd2k-mod
Changed Dune Mod: http://www.moddb.com/mods/changed-dune
MustaphaTR's D2K Mod: http://www.moddb.com/mods/mustaphatrs-d2k-mod
Generals Alpha: http://www.moddb.com/mods/generals-alpha
Romanov's Vengeange: https://www.moddb.com/mods/romanovs-vengeance

Back to top
View user's profile Send private message
Ich-Henker
Flamethrower


Joined: 06 Aug 2015
Location: Germany

PostPosted: Wed Nov 01, 2017 5:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

Okay,

I got three Triggers 2 are disabled.
The starting trigger has elapsed time 13 - each following trigger has as final actions: enable the next, disable the last trigger. But it still only plays the nightfall action.

What events should set with the consecutive Triggers - time too?

Back to top
View user's profile Send private message
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Wed Nov 01, 2017 5:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Starkku wrote:
Event 13 'Elapsed time' takes seconds as parameter.

Negative.

As proof, I had a Trigger start playing a WAV and enable a second Trigger, and to get that Trigger firing precisely at the WAV's 45s spot, the parameter had to be set to 96s. More than twice the seconds.

I've had this problem for some time, and took a LOT of tries to get the timing right. All for less than a minute in Supremacy's first Soviet mission.

_________________
One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done. #Tongue

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
Ich-Henker
Flamethrower


Joined: 06 Aug 2015
Location: Germany

PostPosted: Wed Nov 01, 2017 7:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Few Questions here...

0. I am sorry but the method with enabling the following and disabling the last does not resolve into a loop - it stops after the last trigger - i tried using a fourth trigger that has the first attached to it but it doesn't work - i am trying more out...
1. Does anyine got the shroud entire map action working (reveal map worked but not reshroud)?
2. What does local clear/local set do?

Last edited by Ich-Henker on Wed Nov 01, 2017 8:23 pm; edited 1 time in total

Back to top
View user's profile Send private message
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Wed Nov 01, 2017 8:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

TAK02 wrote:
Starkku wrote:
Event 13 'Elapsed time' takes seconds as parameter.

Negative.

As proof, I had a Trigger start playing a WAV and enable a second Trigger, and to get that Trigger firing precisely at the WAV's 45s spot, the parameter had to be set to 96s. More than twice the seconds.

I've had this problem for some time, and took a LOT of tries to get the timing right. All for less than a minute in Supremacy's first Soviet mission.


How about you read the whole ztyping post and not just cherrypick the first line. That would explain why it does not sync with your damn wave audio file which is always played at same speed & length.

_________________

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Thu Nov 02, 2017 5:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Starkku wrote:
How about you read the whole ztyping post and not just cherrypick the first line. That would explain why it does not sync with your damn wave audio file which is always played at same speed & length.


Read it and it isn't useful, for the sole fact hat I'm talking about SP missions with a fixed speed of... I think 20 FPS ('Fast')?

Starkku wrote:
Trying to factor game speed into it is irrelevant as everything in this game is tied to the current framerate (selected game speed only sets upper cap for framerate) and thus seconds/minutes and frames are interchangeable. Game basically treats 1 second as 15 frames. This also means that only at constant 15 FPS do things displayed in minutes/seconds like superweapon timers sync up with real time, otherwise it's slower or faster depending on FPS.


...I still don't see how the parameter can be set properly for missions.
But if 1 second is 15 frames, and the speed is 20 FPS...

That's it. I'm lost.
All I know for sure is 96 game-seconds ~ 45 seconds at Fast (20 FPS?)

_________________
One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done. #Tongue

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Thu Nov 02, 2017 8:18 am    Post subject: Reply with quote  Mark this post and the followings unread

TAK02 wrote:

...I still don't see how the parameter can be set properly for missions.
But if 1 second is 15 frames, and the speed is 20 FPS...

That's it. I'm lost.
All I know for sure is 96 game-seconds ~ 45 seconds at Fast (20 FPS?)


Just cause the game speed sets upper cap of 20 FPS it doesn't mean the game is actually running that fast - it could be running significantly slower depending on many, many factors. Albeit here the problem is that game is going faster than real time audio playback, which can probably be mostly explained by the fact that missions run capped at 30 FPS, not 20 (Game speed 4 / Fast). Which, assuming constant FPS, would mean that to match 45 second audio playback, you'd need atleast 90 second timer. Error margin could be explained by delays in starting audio playback. Maybe.

Due to the fact that the game's framerate is variable, doing stuff like syncing audio file playback with the elapsed time event is bound to work inconsistently.

_________________

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
Ich-Henker
Flamethrower


Joined: 06 Aug 2015
Location: Germany

PostPosted: Thu Nov 02, 2017 9:25 am    Post subject:   Reply with quote  Mark this post and the followings unread

Got a four Stage Day/night-Cicle to work. It starts via setting a local linked to variable names that function as a second event for the specific time of day. Each time of day clears its own local and sets the next [thanks to Omega Bolt, who created the map The Honeymoon].

Last edited by Ich-Henker on Fri Nov 03, 2017 9:13 am; edited 1 time in total

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Fri Nov 03, 2017 6:37 am    Post subject: Reply with quote  Mark this post and the followings unread

I dont remember ever making a map called "Honeymoon" :/

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
Ich-Henker
Flamethrower


Joined: 06 Aug 2015
Location: Germany

PostPosted: Fri Nov 03, 2017 9:13 am    Post subject: Reply with quote  Mark this post and the followings unread


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [21 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1754s ][ Queries: 11 (0.0087s) ][ Debug on ]