Page 1 of 2

Change corpse graphic

Posted: Sat Oct 14, 2006 1:30 am
by Lagoon
Is there any way to change a corpse graphic?
So far I have only one idea: create and npc with the wanted graphic, move all items from the corpse to the npc, kill it, change the new corpse desc to match the original corpse desc, move its corpse where the original corpse is and destroy the original corpse
Any cleaner way?

Posted: Sat Oct 14, 2006 12:53 pm
by Yukiko
Far as I know scripting it is the only way.

Posted: Sat Oct 14, 2006 1:06 pm
by Lagoon
Ok, thanx, I'll try to live with the trick of replacing the corpse :P

Posted: Sat Oct 14, 2006 2:04 pm
by Yukiko
I had once had the idea of using a different way of handling character "death" because I see it as kind of lame that one keeps dying and getting ressed. I wanted to replace the corpse with a backpack and the RP of "death" would be that the player was seriously wounded and had to drop their pack in order to be able to get to the healer and get healed. Thus no one "dies" as far as the RP is concerned. Then I found the only way to handle this was to create a pack out in the "black" area and then transfer all items in the corpse to that pack, destroy the corpse and move that pack to the corpse location.

So like many other things, until they get added to the core, we script around them.
:P

Posted: Sat Oct 14, 2006 2:50 pm
by Lagoon
what I'm trying to do is even worse, I want my Polymorph spell (which can be directed toward any target mobile in range) to work also on mobiles who fainted (which I simulate with death), so I have to change the graphic and color of corpses ^_^

Posted: Mon Oct 16, 2006 1:31 pm
by Yukiko
I see atleast we agree on the "lameness" of repeatedly dying and ressing. My odea was similar to yours except players never loose conciousness. They simply have to leave all belongings behind because their wounds make them too weak to carry much with them when going back to the healer.

Posted: Tue Oct 17, 2006 12:59 am
by Lagoon
Not exactly, I have death too
hp <1 -> death
stamina <1 -> unconscious
I agree dying often ruins the mood, in fact, when my shard will have a decent players base, I'll probably ask them if they agree in the introduction of permanent death :P

Posted: Tue Oct 17, 2006 10:04 pm
by Yukiko
OK
Guess not then.

If you are thinking "perma-death" == Character gets deleted, I bet most players wouldn't go for that. But if perma-death == character must go to a special place and fulfill a quest before being allowed to return to the living, I can see how that might have a better chance of getting a thumbs up. But hey! Who am I to guess the mind of people?

Posted: Wed Oct 18, 2006 1:50 am
by Lagoon
I mean character deleted. I know it's far from easy to find players willing to play with such setting ^_^

Posted: Wed Oct 18, 2006 2:35 am
by Yukiko
Yeah I'd not be votin' for that.

*grins*

And people thought I was harsh cause my guards confiscated (destroyed) equipped weapons if they captured a criminal or murderer.

Posted: Wed Oct 18, 2006 2:41 am
by Lagoon
I'm curious what'd they think about my server which has no place where to put an item so that it can't be stolen :|

Posted: Wed Oct 18, 2006 10:44 am
by Yukiko
Yep. I got all kinds of grief when I was talking about removing secured containers because of the bug with secures, even though I offered to increase bank storage to 40,000 stones to compensate for the loss of secures.

Posted: Wed Oct 18, 2006 3:44 pm
by Marilla
Umm... question; Has no one else figured out how to make secures work on POL? I have secure containers on our shard that work just fine. The last time I really worked with a distro was back at 092, but I guess I assumed someone else used the features available since then to implement secures in POL.

So, are there no secure containers in the distro? If not, here's basically how to do it:


You first need to be sure -ALL- container items that are -EVER- 'out in the world' in players' hands (and therefore, could be secured) use the same scripts for CanRemove and OnUse. You could, possibly, leave out CanRemove, but I strongly recommend implementing that, as well (as otherwise, someone with Injection could manage to 'hack' their way into a container and remove any item they would like)

The OnUse script can actually NOT be set on containers by default. In fact, I recommend that; no sense having the code run on everyone's backpacks, sub packs, etc, etc. You also likely have other OnUse scripts set to containers for other special purposes.

But, when the container is secured, it should also be set to have the OnUse script and CanRemove scripts you will write. It should also set a CProp to the serial of the house sign, or whatever method of house-access-control you have (you could use such code to implement "town secures" too, or whatever).


The actual scripts themselves (CanRemove or OnUse) would first check to be sure the container really is secured. ('locked down', and has a valid serial of a real house sign in which location it is contained). IF not, it should remove its OnUse script and just send the player a SendViewContainer() and exit.

If it verifies that it is still inside the house, by getting the house sign serial, and loading a ref to the house sign and checking the bounds, it can then access the friends/co-owners/owner list and verify that the person trying to open the container, or remove an item (depending on which script we're talking about) really is allowed to do so. You could implement separate 'friends' and 'co-owners' containers, or again, whatever you like. I also recommend checking the .locked member of the container, and preventing access if it's locked.

In the OnUse script, if the above checks pass, you just send SendViewContainer() to the player. You could be really 'cool', and also implement house refreshing on that.

In the OnRemove script, of course you just return 1, so the player can remove the item.

Otherwise, if any of the checks fail, you tell the player they can't do this, and return 0.

When a container is unsecured, you should remove the OnUse script and the CProp pointing to the house sign serial (but also still have the code mentioned above that double-checks).


And that's basically it. That system has worked perfectly for us ever since we've been on 095. I would post my code, but our town stone and housing systems are both deeply intertwined and completely unique, so the code would be confusing. Those interested can take my explanation and create the code fairly easy - we're talking maybe a dozen or two lines of script total.

Posted: Wed Oct 18, 2006 9:37 pm
by CWO
Yep a very nice guideline to dwell on as I rewrite my entire shard from scratch. Most of what you said is already done by secures but its definitely a nice and complete guide to be sure we all have in our scripts.

Posted: Thu Oct 19, 2006 10:02 am
by Lagoon
Thank you very much, an useful guide ^_^
I plan to code such a system soon...

Posted: Mon Oct 23, 2006 2:37 pm
by Yukiko
The bug of which I spoke relates to the dropping of an item on a closed secured container. This bug manifests itself sporadically so it's hard to fix. What occurs is the item sometimes does not appear in the container when you open it. POL "sees" the item as being inside yet it does not appear there. If you unsecure the container and let decay take place POL drops the item on the ground when the container decays.

I assume the bug has to do with certain critical timing events that are at times in the right or in this case wrong sequence which causes this error. Probably something in the OnInsert scripts.

This bug has existed since Bishops original Static Housing package. I found it happening on World of Dreams housing system as well.

It may also be a problem in general with dropping on closed containers but I think we only saw it happen with secures.

Posted: Mon Oct 23, 2006 10:52 pm
by Xadhoom
Yukiko it happened also once to me with a normal container and some ingots, tried many times but never reproduced it

Posted: Tue Oct 24, 2006 2:34 am
by Yukiko
Yeah. I think it's some timing critical bug. The events have to happen at just the right time and probably ten other things must be just right to cause it to occur.

Posted: Tue Oct 24, 2006 9:23 pm
by Marilla
Hmmm... I've never heard of such a bug happening in the roughly five years we've been running, and we started with the WoD scripts. (then again, the WoD scripts I got did not have 'secures')

Posted: Tue Oct 24, 2006 9:58 pm
by Yukiko
Yeah. It's strange indeed. It doesn't happen only with secures I guess either. Oh well. It is rather rare so it ain't too bad and you can recover the "lost" items if you release the chest and wait til it decays.

Posted: Wed Nov 29, 2006 2:03 am
by Gnafu
to change a corpse graphic i think tou can use
corpse.corpsegraphic
or
corpse.graphic

Posted: Wed Nov 29, 2006 2:06 am
by Yukiko
EDIT:

OK well, I edited this because now the graphic change seems to work except I do have to walk away til it is off screen. Sometimes I think POL just hates me.

*sighs*

Posted: Wed Nov 29, 2006 3:07 pm
by Marilla
Yukiko wrote:Yeah. It's strange indeed. It doesn't happen only with secures I guess either. Oh well. It is rather rare so it ain't too bad and you can recover the "lost" items if you release the chest and wait til it decays.
Hmmm.. that's really odd. I've never seen anything like that at all. I would think it'd be a pretty big thing for players if items they drop in containers started just disappearing, but I've never heard of any such thing.

I can't imagine what a script would have to do with that at all, either, aside from an On/CanInsert script. So I'd suggest carefully perusing those scripts to look for what might be happening.

Posted: Wed Nov 29, 2006 4:50 pm
by Yukiko
*nods*
Well, it happens once in a blue moon. I have seen it happen in versions of POL as early as 092 with secured containers on a server that used Bishop's original static housing package. Also on POL 094 using WoDs housing system. As for anything after 094 I've only heard reports. Again though it's like once a year or so that it seems to happen. With that infrequent occurrence it's hard to believe it would be a totally script related issue. Guess it could be though. Anyway, it isn't a big problem because it happens so infrequently.

Posted: Wed Nov 29, 2006 10:43 pm
by OldnGrey
Just a wild shot, check in the data\storate.txt file for the item.
Are the co-ordintates of the item sane?

Does a foreach script actually find the item in the container?