Jump to content

Script that controls glow maps?


KiCHo666

Recommended Posts

Hello once again!

I've retextured the motorcycle for Mojave Travel mod:

http://puu.sh/acAuf/0bb9a9472e.jpg

 

 

I'm happy with the way it looks like, especially since I've added the glow map.

NOW the question!

Is there a way to make glow work only at night?
I know about "gamehour" and "swaptexture" GECK commands, but how to make a sctipt so it puts Emit Multi for MaterialControler to default value?

Emit Multi is currently at 10, so I would like that script puts it at 1 when it's daytime and back to 10 when it's night time.

Help would be appreciated! :smile:

Edited by KiCHo666
Link to comment
Share on other sites

Create separate NIF files for day and night, and use SetModelPathEX (NVSE 4.2b2+) instead of swapping textures:

if (GameHour > 19) || (GameHour < 5)
	if bNight == 0
		set bNight to 1
		SetModelPathEX "path to night NIF" BikeEditorID
		BikeRef.Disable
		BikeRef.Enable 0
	endif
elseif bNight
	set bNight to 0
	SetModelPathEX "path to day NIF" BikeEditorID
	BikeRef.Disable
	BikeRef.Enable 0
endif
Edited by jazzisparis
Link to comment
Share on other sites

Thank you!!

Few questions since I'm scripting noob.

That bike is actually an activator that uses bike model to activate it. MTMojaveTravelActivator is the activator.
So how can I make Bike reference?

ref rBike

begin GameMode

set rBike to MTMojaveTravelActivator
....

Like that?

Also, what is bNight?

The compiler said it's unknown command.


Little more help? :D

Link to comment
Share on other sites

After I've done some thinking, having two model just for light switch is kinda resourse waste, i couldn't find a better word.
The future of this mod is to include different skins to choose from, so having two models for each skin is not an optimal solution.

Would prefer if we could have one nif model and just switch the texture when needed.

The problem is, of course, the script.

Link to comment
Share on other sites

I assume MTMojaveTravelActivator uses a script? Open its script and add the following code inside a GameMode block:

short	bNight	; Add this with the rest of the script's variables.


	if bNight != ((GameHour > 19) || (GameHour < 5))
		set bNight to (bNight == 0)
		if bNight
			SetModelPathEX "path to night NIF" MTMojaveTravelActivator
		else
			SetModelPathEX "path to day NIF" MTMojaveTravelActivator
		endif
		Disable
		Enable 0
	endif

 

 

 

how to make a sctipt so it puts Emit Multi for MaterialControler to default value?

Emit Multi is currently at 10, so I would like that script puts it at 1 when it's daytime and back to 10 when it's night time.
(...)
After I've done some thinking, having two model just for light switch is kinda resourse waste, i couldn't find a better word.
The future of this mod is to include different skins to choose from, so having two models for each skin is not an optimal solution.
Would prefer if we could have one nif model and just switch the texture when needed.

 

You can't directly modify properties inside a NIF file via script. We currently don't have that capability (and likely never will). Creating two versions (day and night) of each model seems the best, easiest solution to me.
Texturing isn't my forte, but you can also increase luminosity by increasing the brightness of the alpha channel of the normal maps.
Edited by jazzisparis
Link to comment
Share on other sites

Yes, it uses a script and thanks, but it still doesn't work. :/


.....

Begin GameMode
short bNight
if bNight != ((GameHour > 19) || (GameHour < 5))
set bNight to (bNight == 0)
if bNight
SetModelPathEX "vehicles\UniqueMotorcycle\UniqueMotorcycleNight.nif" MTMojaveTravelActivator
else
SetModelPathEX "vehicles\UniqueMotorcycle\UniqueMotorcycle.nif" MTMojaveTravelActivator
endif
Disable
Enable 0
endif
...

When I try to save it, it says that MTMojaveTravelActivator is unknown variable, if I remove quotes then it saves, but no changes in game.
Link to comment
Share on other sites

It appears SetModelPathEX only accepts variables as parameters. Try this:

short	bNight
ref	rActivator

; The above should be added immediately after the first line in the script, not inside the GameMode block.


	if bNight != ((GameHour > 19) || (GameHour < 5))
		set bNight to (bNight == 0)
		set rActivator to MTMojaveTravelActivator
		if bNight
			SetModelPathEX "vehicles\UniqueMotorcycle\UniqueMotorcycleNight.nif" rActivator
		else
			SetModelPathEX "vehicles\UniqueMotorcycle\UniqueMotorcycle.nif" rActivator
		endif
		Disable
		Enable 0
	endif
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...