I'm looking for information on how to change the light circle radius for an item that is being worn. What I'm trying to do is create a torch that lasts for a given time, say 30 minutes, and every few minutes the light circle gets smaller, until finally it burns out. I was able to get this to work for an item that is placed on the ground, but haven't been able to figure out how to get the same effect for the item as it is equipped on the paperdoll. When equipping on the paperdoll, the light circle is always the same size.

Any feedback or direction is appreciated.
Thanks!
 
Can you post what you tried?

I would think a timer that reduces the light ID circle size every ten minutes or so should work.

Start at Light ID 29, then 1 then 2 before burning out. Cool idea btw.
 
Ok, just looked at Torch in the files. You'll want to change the LightType on a timer tick.

LightType.Circle300; for first 10 minutes, then LightType.Circle225;, then LightType.Circle150;
 
That's kind of what I'm doing. I have 1 timer that counts down, and another timer that watches the first timer and then changes the LightType.Circle150. For testing I have the total time set to 1 minute, with the light circles changing every 10 seconds. I also added in 2 larger circles to light.mul which are essentially 375 and 450, but they are named "SuperBig" and "SuperBigBlue" (I did that a long time ago and never updated it). Also for testing i gave the equipped item an itemID of around 0x40fe through 0x4101 which happen to show up in the client as different colors.
Code:
light = new LightSource();
  light.Layer = Layer.Unused_xF;
  light.ItemID = 0x4101;//0xF6B;
  light.Light = LightType.SuperBig;
Everything works fine on the ground, but an equipped light seems to work differently.
https://dl.dropboxusercontent.com/u/5608436/Torch1.webm
 
Here is what I'm working with, if you actually run it as is you may crash because of the missing light.mul entries, So comment those out if you do end up running it.
 

Attachments

  • Torch.cs
    8.1 KB · Views: 7
that Torch1.webm seems to have cut off short, but it basically shows the timer ticking down and the light radius getting smaller.
 
It's because you're adding a second light object to the torch. On Line 75:

light = new LightSource();

When you already have on line 20:

Light = LightType.SuperBig;

You modify light in your timer, but Light remains constant at SuperBig.
 
Ok i've edited a couple things, commented out the line 20:
Light = LightType.SuperBig;

and moved
light = new LightSource();
to
public override void Ignite()

so that it adds the LightSource when igniting, and there's a delete in the
public override void Douse()

Here's what its doing now, which is still not entirely perfect.
https://dl.dropboxusercontent.com/u/5608436/Torch2.webm
You can see at 15 seconds in, that as it crosses below 50 seconds on the timer it does seem to add a light "ArchedWindowEast" which is the default first entry, while also having the Circle300 sized light that always seems to show up.
I'm wondering if i might have to go about this entire thing in a more hacked up kind of way. Add a new art entry, gump and anim to get away from the default torch stuff if it is hard coded in to the client to always show up a certain way.
 

Attachments

  • Torch.cs
    7.7 KB · Views: 8
Yea, I've been messing with it using a TimerDelay, and I can't seem to get it to shift LightType in the process. It deletes itself when I have it set to "die out", but it never actually changes light radius.

Maybe @tass23 can help. He wrote some code a while back for lightsabers on his shard that use light sources.

Edit: Btw, great looking world and gumps in your video. Very nicely done. Are you open for play, or just in dev?
 
Here's something I did with the custom lights I came up with, just to show off how the different lights can mix and blend together, creating mood lighting for psychological/emotional effect.
 

Attachments

  • OoohColors.PNG
    OoohColors.PNG
    740 KB · Views: 70
Yes, I remember seeing that. I forgot you were working on Requiem. Good stuff.

I played with a bunch of folks from there on Khaeros "back in the day". Glad to see you're still keeping it going.
 
Ok, found this a bit interesting and fiddled around. So the Lightsource you see while wearing the item is not the defined lightsource but the lightsource you get from your TileData.mul. To be more precise it is the StackOff value on lightsources
 
That's good to know. I think what I may try doing is adding duplicate lit torch art, giving them all the different stages of the circles. They could all share the same gump and anim number. Then in the code when it hits the next stage, delete that torch and add another in its place with the next smaller circle.
 
Sorry, this is a bit beyond what my lightsabers do heh
Are you controlling the light level for nightsight as well (clients have that settings also for Darker Nights I think it is)?
 
Yes sort of, night sight does not do a full bright in one cast, what it does is takes a look at your skill in the magic school that casts that spell (divine arcana, we have five different types) and increases the light level by a few points according to how high your skill is.
 
Back