NPC default appearance
This seems like a trivial question, but I haven't found the answer yet. I would like to create a (lootable) dead body, and would like to set the default appearance for the NPC if possible.
Now I could do this in Perl with setanim(3), but I'm betting this information is stored somewhere in the database. The animation field in the spawn2 table doesn't seem to do the trick (mob stands there, tried 3 and 16 as the animation value). If NPC appearance is in the database, I would very much like to know where. |
Do you just want it to lay there like a trampled slave? If so, code below:
Link to guide here: NPC Appearances Code:
sub EVENT_SPAWN |
Thanks, but I'm wondering if there is a way to set this in the database. I have a Perl solution already, I just don't want to create Perl scripts for a bunch of new mobs just so they can be dead.
A lot of appearance-related information is already kept, I am figuring this must be as well. |
i don't think it's stored in the database anywhere. otherwise, there wouldn't be scripts that set appearance periodically like in tutorialb.
(maybe this would be something that lua would be ideal for?) regardless, you don't have to set individual scripts for every npc you want to change appearance like this. just use the zone's default.pl or the global_npc.pl in the templates folder. |
Did you check the animation field in spawn2?
|
animation in spawn2 mentioned in original post, had no effect. (Server was restarted between changes -- so new shared memory region created)
I'll look into the defaults, but worry that I'm going to mess things up. One odd feature (to me) of SetAppearance is that an untargetable mob (bodytype=11) does not appear to do anything when the appearance is set to dead. Changing the bodytype to normal restores the death animation. This does get in the way of creating untargetable corpses. (I guess I don't really *Need* this, but having corpses with full HP bars just seems wrong) The wiki mentions $npc->SetTargetable, but this is not in any of the Perl XS stuff for the zone. So much for killing the mob then changing its targetability. And I was hoping this would be easy. I'll see if I can find corpse expiration code somewhere, maybe I can create a real corpse that doesn't expire. |
SetTargetable is defined in perl_mob.cpp.
|
Not in my source tree, and "svn diff" shows that I am up to date.
(I did an svn diff of everything in zone, just in case someone checked in something since my last merge). Perhaps you meant SetTarget which is different. |
perl_mob.cpp, line 7592
Code:
XS(XS_Mob_SetTargetable); /* prototype to pass -Wmissing-prototypes */ |
Quote:
|
Quote:
(This also explains why the wiki and the source did not always agree) Sorry for the confusion, but thanks for helping me clear this up. |
https://projecteqemu.googlecode.com/svn is the correct repository. Make sure you are using the trunk and not some random branch.
|
Ugh that's even worse news... I thought I had an explanation.
From "svn info" URL: http://projecteqemu.googlecode.com/s...EmuServer/zone Repository Root: http://projecteqemu.googlecode.com/svn Repository UUID: 1db01234-8a6e-11dd-8937-b3a01dae0fbe Browsing the repository via the web shows the code is not in sync. "svn diff" lists nothing for perl_mob.cpp, but does show my changes in other files. I guess I should just check out a clean copy and merge my changes by hand. I've never seen svn do anything like this, but I'm not sure I want to dig into it too far. |
Unless I'm mistaken, `svn diff` shows what's different between your local repository and the remote repository at whatever revision you last updated to.
You need to use `svn update` to actually update to the latest revision. You may simply have old code since you haven't updated. |
Quote:
|
All times are GMT -4. The time now is 11:36 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.