run script upon save game load? FX lights issue, LightSource
run script upon save game load? FX lights issue, LightSource
I am using a lot of fx lights and save games don't keep them! this is causing problems, but I can clear it up if I could just run a certain script upon the player loading a save game - is this possible?
Finished Dungeons - complete mods to play
Re: can I run a certain script every time a player loads a g
uhhhh...I don't see how unless you maybe saved the party's location so that when they moved after loading you'd search for your FXs and when not found you'd know they just loaded?
Actually, I would turn all those FXs into LightSource objects so they survive saves then you can manipulate them better.
Actually, I would turn all those FXs into LightSource objects so they survive saves then you can manipulate them better.
Re: can I run a certain script every time a player loads a g
You could have a ticker script that constantly checks for the presence of one of your FX entities... if it isn't there run the script to spawn them all.
You may need to move the timer to the current level every time the party changes level though, as timers run slower if on different levels
You may need to move the timer to the current level every time the party changes level though, as timers run slower if on different levels
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: can I run a certain script every time a player loads a g
Thanks both of you, each suggestion is valuable! After looking into setting up custom lightsource objects, I believe that is the best most controllable way to go. But I should have thought of the constant ticker checker idea, that's a good solution too!
THANKS!!!
THANKS!!!
Finished Dungeons - complete mods to play
Re: run script upon save game load? FX lights issue, LightSo
Odd "bug" I'm encountering, but all my LightSource objects are casting shadows, even though I have...
...clearly in the definition
Anyone else seeing this?
It says "castShadow: a boolean which turns dynamic shadow rendering on and off", so maybe "dynamic" means when monsters walk by, etc?
But my old FX lights truly didn't cast shadows of any kind when set to false, so the light went through walls, statues, etc.
Code: Select all
castShadow = false,
Anyone else seeing this?
It says "castShadow: a boolean which turns dynamic shadow rendering on and off", so maybe "dynamic" means when monsters walk by, etc?
But my old FX lights truly didn't cast shadows of any kind when set to false, so the light went through walls, statues, etc.
Finished Dungeons - complete mods to play
Re: run script upon save game load? FX lights issue, LightSo
I've tried to use FXs with a timer for lighting and got it working. However, I noticed that multiple FXs can hit performance really hard, even when they're completely out of sight. Presumably it's because their effects can't be precalculated. So I'd say using LightSources is much preferable.
And the castShadow field really doesn't seem to have any effect on LightSources, though it works fine with FXs.
And the castShadow field really doesn't seem to have any effect on LightSources, though it works fine with FXs.
Re: run script upon save game load? FX lights issue, LightSo
FX objects are meant to be used for short unimportant effects that need not persist across save games (persisting the state of particle effects would make the save game system much more complex because each individual particle would need to be saved).
Re: run script upon save game load? FX lights issue, LightSo
That sounds like witch talk to me. Keep the quantum mechanics or star trek teleportation pattern talk out of grimrock!petri wrote:FX objects are meant to be used for short unimportant effects that need not persist across save games (persisting the state of particle effects would make the save game system much more complex because each individual particle would need to be saved).
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
Re: run script upon save game load? FX lights issue, LightSo
I figured out the light save problem by creating lights as objects.
Objects.lua
example red floor light:
Now you can place (and spawn) light objects in editor, and of course destroy when needed to be off.
Objects.lua
example red floor light:
Code: Select all
defineObject{
name = "red_floor_light",
class = "LightSource",
lightPosition = vec(0.5, 0.5, 0),
lightRange = 6,
lightColor = vec(1, 0, 0),
brightness = 60,
castShadow = true,
placement = "floor",
editorIcon = 88,
}
Re: run script upon save game load? FX lights issue, LightSo
Yes, that is what I've done now, all LightSource objects
Finished Dungeons - complete mods to play