Page 3 of 6

Re: Light sources (in-game)

Posted: Fri Nov 02, 2018 6:55 pm
by pango
You're welcome :)
I actually like where you placed the test inside EquipItem(), in case of issue I'd better have a stack split for nothing that some item unequipped for nothing.
Maybe the check in SplitStack() that the item is indeed part of the container can catch stupid bugs later and can stay in, but other than that I'm totally fine with your fix.

Code: Select all

diff --git a/Assets/Scripts/Game/Items/ItemCollection.cs b/Assets/Scripts/Game/Items/ItemCollection.cs
index 64ecf818..63a18e53 100644
--- a/Assets/Scripts/Game/Items/ItemCollection.cs
+++ b/Assets/Scripts/Game/Items/ItemCollection.cs
@@ -260,7 +260,7 @@ namespace DaggerfallWorkshop.Game.Items
         /// <param name="numberToPick">Number of items to pick</param>
         public DaggerfallUnityItem SplitStack(DaggerfallUnityItem stack, int numberToPick) 
         {
-            if (!stack.IsAStack() || numberToPick < 1 || numberToPick > stack.stackCount)
+            if (!stack.IsAStack() || numberToPick < 1 || numberToPick > stack.stackCount || !Contains(stack))
                 return null;
             if (numberToPick == stack.stackCount)
                 return stack;

Re: Light sources (in-game)

Posted: Fri Nov 02, 2018 7:40 pm
by Hazelnut
I agree, have added that check into my PR. Thanks!

Re: Light sources (in-game)

Posted: Fri Nov 02, 2018 9:52 pm
by Hazelnut
pango wrote: Fri Nov 02, 2018 9:45 am Real life candles can last for hours, but they don't give out much light, the flame is small...
If they're cheap, and since they don't weight much either, they could be "last resort" kind of light source.
Yeah, got some more time tonight and this has been bugging me - candles should last longer but be dimmer. Original post updated. (again)

Re: Light sources (in-game)

Posted: Fri Nov 02, 2018 10:26 pm
by pango
So cool, thanks! :D

Re: Light sources (in-game)

Posted: Fri Nov 02, 2018 10:35 pm
by King of Worms
Hazelnut you are on fire, thanks for all of your latest additions!!

Re: Light sources (in-game)

Posted: Fri Nov 02, 2018 10:46 pm
by Hazelnut
Thanks KoW, I've been having fun with it all as you can tell. This was achieved with very little code added too, I like finding elegant ways of doing things within the existing DFU framework.

Re: Light sources (in-game)

Posted: Sat Nov 03, 2018 4:13 am
by MrDowntempo
Since these aren't in Vanilla anyway, can we have a little fun and add a flicker effect to the light of candles?

Re: Light sources (in-game)

Posted: Sat Nov 03, 2018 10:04 am
by Hazelnut
I'm using a flickering effect to give a visual indication that the light source is about to run out, and I feel a constant flicker would make that much less noticeable. Be easy to make a mod to do this if you really want to, or use the light spell as that moves around giving a flicker effect.

Re: Light sources (in-game)

Posted: Sat Nov 03, 2018 6:34 pm
by pango
Some feedback about that feature:
- light duration feels okay to me. Either way now you have to raid local shops for light sources before going into a dungeon, estimating how long you'll probably be in, or over-provision your wagon, if you can afford it... Good stuff.
- there's currently modal messages when light goes on or off, is it just for debugging stage? I think transient messages should be sufficient;
- when any menu is open, player torch goes on behind the menu, I don't see the purpose so I assume this is a bug;
- I think I got "your candle died out" message once after reloading a gamesave in Castle Daggerfall, having just died in the depths of a dungeon, I need to reproduce the issue. But maybe that's something to be expected right now.
I haven't played with lanterns much yet, need to do that.
I'd also like to start a character from scratch to see how hard it is with dark dungeons and now light sources. For a minute I had the idea that maybe one could take a log from the campfire in Privateer's Hold cavern as a torch, but that would be too abstruse...

I also wish the monsters would pay more attention to what's going on around them in general. Right now they often don't care if you're fighting one of their fellow creature in the same room, or bang a door like a madman nearby... Going around in a dark dungeon with a torch in hand is probably not very discreet either. But one feature at a time!

Re: Light sources (in-game)

Posted: Sat Nov 03, 2018 7:05 pm
by Hazelnut
pango wrote: Sat Nov 03, 2018 6:34 pm - there's currently modal messages when light goes on or off, is it just for debugging stage? I think transient messages should be sufficient;
Transient messages don't work when UI windows are open. Without these messages there's no feedback so they may be clunky, but that's DF UI for you.
- when any menu is open, player torch goes on behind the menu, I don't see the purpose so I assume this is a bug;
No, not a bug - no fuel is used as time is stopped.
- I think I got "your candle died out" message once after reloading a gamesave in Castle Daggerfall, having just died in the depths of a dungeon, I need to reproduce the issue. But maybe that's something to be expected right now.
I will take a look at this, maybe this is possible since the behaviour class is not reset at all currently.
I haven't played with lanterns much yet, need to do that.
I'd also like to start a character from scratch to see how hard it is with dark dungeons and now light sources. For a minute I had the idea that maybe one could take a log from the campfire in Privateer's Hold cavern as a torch, but that would be too abstruse...
I think starting equipment should include 5 torches and a couple of candles if this option is selected - good point. Will work on that. :) This should be enough for any players unless it's their first time in PH, but they can always switch the option off if they are having problems so I think that's okay.