ID:272695
Dec 7 2008, 10:12 am
|
|
How do I make a roofing icon disappear when a mob walks under it? I've tried using Entered() and Exited() with the see_invisible variable, but no luck.
|
Dec 7 2008, 10:24 am
|
|
Make the roof an area, and use area/Entered() with the invisibility var. Not see_invisible.
|
In response to Andre-g1
|
|
Not working :(
area |
In response to Mizukouken Ketsu
|
|
mob Try that. |
In response to Andre-g1
|
|
Ah thanks.
Now... Is there a way to get a turf to merely overlap another turf, not delete the underlaying turf? Like I want the roofing in the previous posts to be put over the walls, but I still want the wall to be there for when the player walks into it. |
In response to Andre-g1
|
|
You can also use images, which are probably the best solution in this case; the invisibility related vars are very useful for other sight related things.
|
In response to Andre-g1
|
|
Do not forget that movement related procedures, like Entered(), Exit(), Bump(), etc. do not check if the argument is the type you entered.
For example, if a projectile (an /obj for this example) entered "area/Roofing/Main", then Entered() will be called even though you have "Entered(mob/M)"... and it'll cause a runtime error since see_invisible is a mob only variable. So, to avoid runtime errors in movement procedures, always check if the object in the argument is what you want: Entered(mob/M) |
In response to Mizukouken Ketsu
|
|
Is there a way to get a turf to merely overlap another turf, not delete the underlaying turf? No, you need to use another type of object. |
In response to Jeff8500
|
|
Like that?
image |
In response to Jeff8500
|
|
What do you mean by "another type of obj"? It's an area I'm using, not turf|obj.
|
In response to Mizukouken Ketsu
|
|
No, I meant object.
|
In response to Mizukouken Ketsu
|
|
You would want to give it its own type, too.
|
In response to Jeff8500
|
|
Objects don't delete the underlaying turf? I'll look up the obj.type thing in the Guide.
|
In response to Mizukouken Ketsu
|
|
Objects is a general term in object-oriented program that can mean any form of thing that holds data.
|
In response to Jeff8500
|
|
So I'd have to create something like...?
Roof |
In response to Mizukouken Ketsu
|
|
...datums don't have an icon variable. When I say another type of object, I mean another form of atom that can do what you want. An obj would work be kind of be the equivalent of two turfs on the same location (minus the Enter() etc. proc being called).
I think we might be on two different subjects, though. Here's an example of how to use /image objects to do what you want var/list/roof_images = new //make a list of roof images |
Take a look at Shadowdarke's RoofLib (it's free now, despite what the hub says). I've never tried it, but Shadowdarke's libraries tend to work well and are fairly easy to use.
|
In response to Jeff8500
|
|
It would be better to have an individual <code>roof_images</code> list for each <code>area/building</code>, unless he plans on having only one building with a roof.
|