Page 1 of 1
Dynamic lighting? Is this possible?
Posted: Sat May 11, 2013 8:16 am
by GottaLove88s
Gents,
I'd like to add changing lighting during a battle.
Specifically, for Dieppe, I want to start at night, with dark/blue lighting, but then warm up into dawn colours about 10 turns in...
I believe that I've figured out how to mod LOS to match. So the commando raid would benefit from defenders' reduced LOS for the first 10 turns, but then be exposed to the full fury of accurate snipers and arty from turns 10-30...
Is this possible?
Re: Dynamic lighting? Is this possible?
Posted: Sat May 11, 2013 12:42 pm
by Amaris
Not tested but I think that possible:
Seen into autodoc.txt:
//load a lighting file from the scenarios folder, name does not include .txt extension
SetLightingFile(lightfile)
So if you have several lighting files, you can load them when you want with adding into your scenario.BSF files a script like:
Code: Select all
FUNCTION StartTurn(side)
{
...
if( GetTurn() == TURN_DESIRED1 )
{
SetLightingFile(lightfile1);
}
if( GetTurn() == TURN_DESIRED2 )
{
SetLightingFile(lightfile2);
}
...
}
Re: Dynamic lighting? Is this possible?
Posted: Sat May 11, 2013 12:48 pm
by GottaLove88s
Intriguing! Nicely discovered Alex... Merci encore...
So if we start with a night lighting file and switch to a dawn lighting file after 10 turns...
Then add a LOS change for all units, also at 10 turns...
We can simulate a night raid becoming a dawn battle...
That's AWESOME!! Let's test...

Re: Dynamic lighting? Is this possible?
Posted: Tue May 21, 2013 6:50 am
by GottaLove88s
Hi Amaris!
I tried your solution in Dieppe v1.01 but it didn't seem to recognise the DIEPPE_LIGHTING filenames for my Lighting Files, even tho they're definitely in the scenario folder... BA kept crashing... Any ideas why??
For now, I've settled with half LOS for the first 5 turns for both players, opening up to full LOS on turn 6, to simulate dawn...
Re: Dynamic lighting? Is this possible?
Posted: Tue May 21, 2013 10:46 am
by Amaris
May ba a name problem:
Seen into autodoc.txt:
//load a lighting file from the scenarios folder,
name does not include .txt extension
SetLightingFile(lightfile)
Otherwise send me the all mod, I'll check that when I've time.

Re: Dynamic lighting? Is this possible?
Posted: Tue May 21, 2013 11:32 am
by GottaLove88s
Ummm... Could be...?
Here's the actual error report... It seems to want to interpret the filename inside SetLightingFile as a variable, where the actual filename is not meaningful...?

Re: Dynamic lighting? Is this possible?
Posted: Tue May 21, 2013 11:34 am
by GottaLove88s
If you're feeling brave, here's the full zip for Dieppe, including the bad lighting code that I've removed for the live version... [link removed]
Pls let me know if you picked it up, and I'll delete it from here, so players definitely have the same version...

Re: Dynamic lighting? Is this possible?
Posted: Tue May 21, 2013 11:39 am
by Amaris
I'm at work, so no BA allowed (Yes I know I need a new job with no BA restriction

)
Try with "" :
SetLightingFile("AGJS44_NT_LIGHTING");
If not tell me, I'll check that tonight.

Re: Dynamic lighting? Is this possible?
Posted: Tue May 21, 2013 12:00 pm
by GottaLove88s
Merci Amaris... the power of quotes. Sounds like something my old Prof used to say, lol! Your solution works perfectly...
Now that's GOOOOOOD... Dieppe now really starts at night... and Dawn rises after the 5th turn for both sides... Seriously, that's quite a wow effect... Merci Monsieur!
PS. Je suis très désolé for your predicament. I empathise deeply!

Re: Dynamic lighting? Is this possible?
Posted: Tue May 21, 2013 12:37 pm
by Amaris
GottaLove88s wrote:
Merci Amaris... the power of quotes. Sounds like something my old Prof used to say, lol! Your solution works perfectly...
Alrights.
GottaLove88s wrote:PS. Je suis très désolé for your predicament. I empathise deeply!

Thanks. I'll fighting one more time with ldap(*)... So sexy.

The hard life of a sysadmin.
(*): it would make a very good Action After Report with a lots of sweat, blood, and suspense.

Re: Dynamic lighting? Is this possible?
Posted: Wed May 22, 2013 2:15 pm
by GottaLove88s
Haha... I shan't asked what LDAP is?!?! Is it legal?!?!
Re: Dynamic lighting? Is this possible?
Posted: Wed May 22, 2013 2:16 pm
by GottaLove88s
With Amaris' fabulous support, anyone who might like to explore how Dynamic Lighting works in a scenario... that starts at night, with reduced line of sight (LOS), and then becomes dawn after 5 turns, please take a look at any version of The Dieppe Raid from v1.02 onwards...
Link here ->
viewtopic.php?f=87&t=42347#p399048