ID:138510
 
Could someone post a snippet again on how to make light radii, actually just as a suggestion it might be useful to make luminosity non-boolean and have it determine light radii instead.
Also I'm still stuck on how to make a separate inventory. This being a Mage Spellbook, a Priest Spellbook, and an Abilities menu. I want these things to be listed as objects so I can set things like ammount memorized and types of spells for specialty mages, also so certain abilities and spells should be able to be cast in different ways. Anyways, a snippet would be nice for this, I think Spuzzum had posted one, which I tried but the spells weren't coming up. I think I'm having trouble with the list thing and whatever the [] thing is after it. I think I just need some help with lists. Thanx again and sorry for the repitition!
On 7/8/00 8:56 pm DerDragon wrote:
Could someone post a snippet again on how to make light radii, actually just as a suggestion it might be useful to make luminosity non-boolean and have it determine light radii instead.

I think that's the current behavior, actually, but it makes a box instead of a sphere.

As for radii, you'd probably just have to use a function such as dd_get_dist() that returns actual distance rather than grid distance (eg. 1.5 spaces instead of 2 spaces), and then turn light on or off in a distance given. I'm working on light sourcing that's a little more advanced in Haven, and when I get it done, I'll discuss the effects and give some source.

Also I'm still stuck on how to make a separate inventory. This being a Mage Spellbook, a Priest Spellbook, and an Abilities menu. I want these things to be listed as objects so I can set things like ammount memorized and types of spells for specialty mages, also so certain abilities and spells should be able to be cast in different ways. Anyways, a snippet would be nice for this, I think Spuzzum had posted one, which I tried but the spells weren't coming up. I think I'm having trouble with the list thing and whatever the [] thing is after it. I think I just need some help with lists. Thanx again and sorry for the repitition!

mob
var
list
spells

is equivalent to

mob
var
spells[0]

Essentially, the [0] simply makes a blank list. It doesn't have any real significance whatever except to make it a list instead of a single variable.

To augment the spells, you can use mob.spells += /obj/spell. Then, use

mob
Stat()
statpanel("Magic",usr.spells)

to display them in the magic panel. See?
In response to Spuzzum
Cool,

I was just about to ask something down those very lines. Actually, I have managed to create the list and panel, but couldn't add the objects.

Thanks!
You can use the luminosity variable, it's not a boolean, but a range for the emitted light. I had exactly the same problem. The on-line manual is slightly (dare I say) inaccurate :-) and gives the impression that it is a boolean.
In response to Al
The on-line manual is slightly (dare I say) inaccurate :-)

Er, more of un-updated. It USED to be boolean, now it is a range.
In response to Valaquent
On 7/10/00 9:37 am Valaquent wrote:
Cool,

I was just about to ask something down those very lines. Actually, I have managed to create the list and panel, but couldn't add the objects.

Thanks!

Whoops... sorry about the misinformation, there. I see I must've caused you a little confusion...

When I said /obj/spell, I meant a reference to one, like

usr.spells += new /obj/spell

or

var/O = new /obj/spell
usr.spells += O

Sorry again! (Oh, and welcome to BYOND! Off to a fun start so far, huh? =)
In response to Spuzzum
It USED to be boolean, now it is a range.

But just to add a little extra fun, for areas it's boolean. Uh, I think, anyway.
In response to Guy T.
But just to add a little extra fun, for areas it's boolean. Uh, I think, anyway.

Oh, yes, that's right. Areas are supposed to be invisible, so they only can shed light on the turfs above them.