Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Little help?

Little help?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Sparro   USA  (12 posts)  Bio
Date Mon 03 May 2004 11:28 PM (UTC)
Message
Ok, I got my compile issues sorted out, now I am asking for advice on the best way to go about implementing Werewolves. I would like to alter vampires and create werewolves, so they are not player selectable, but can be created by contracting the correct disease from the right mob. I have found plenty of posts describing how to make races/classes player choices or not, but I'm not sure the best way to go about the actual change to the character.

I would like the disease effect to change the character, so instead of a human thief, they are now a werewolf, but would that best be done as a race change, a class change, or a spell/disease effect? While they are changed I want them to be different, but be able to revert back to their earlier form if cured retaining the xp they gained while transformed. I also want both vamps/weres to be unable to loot/sac corpses while transformed. I am thinking doing it as a class would be easiest, because vamp already is, and then to implement the werewolf's inability to equip items, I could just make them all "No_Were" right? IS there a way to tie the transformation into the existing weather/time system, or would I need to code that too? Sorry, I am still looking at stuff... Maybe I could try using the polymorph code??? I want to keep the vamp only stuff and add some were only skills as well...

As expected, I am a newb to coding and bases, but am learning a ton every day. Any help appreciated. Thanks!

Ships in bottles can not sail, and neither can a tombstone kill a feather.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 04 May 2004 02:53 AM (UTC)
Message
Seems to me that the first thing you need to do is get all your ideas straight and figure out exactly what you want. :)

If a werewolf cannot wear *any* items, then making *every* item no_were is a bad plan. Rather, you'd want to edit the wear function to not let vampires wear it.

Remember that no_mage for instance is the exception rather than the rule. If the exception is were_can_wear, then you make the flag for that - you don't make a flag no_were.

Second, since becoming a werewolf is not a class change but an effect of sorts, the logical thing to do seems to be an effect; not a class change.

Third, what do you mean by tying transformation into the weather/time system? Unless you mean something else than what I'm thinking, yes, your only solution is to code it yourself.

A word of caution, you're doing something that is really non-trivial. If you think you can handle it now then more power to you, but perhaps you should practice on some easier things before attacking a large project like this.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Sparro   USA  (12 posts)  Bio
Date Reply #2 on Tue 04 May 2004 06:23 AM (UTC)
Message
Thanks for your feedback/input!

I agree that this may be a little ambitious for my current skill level, but I've got to at least TRY it. :) The weather and time system tie-ins would be for the mooon phase transformations of the werewolf. I want the transformation to take place at night during specific parts of the month, which I can probably just do with a timer, 'cause I didn't want a character to transform into a were at noon on a cloudless day, only at night when the moon is present. I was in the middle of a brain fart during my earlier post, and had meant to ask about editing the wear function to exclude werewolves (and only werewolves) which shouldn't be that tough (I think), not excluding each item. Rereading it sure seemed like that tho, sorry. Also, by making it an effect based transformation, won't the character retain all of their cuurent skills/spells? I want to make those inaccessible while transformed and grant were only or vamp only skills/spells while transformed... Anyway, the direction of an effect seems like the best course, if I can just figure out the specific of what will need to change and if I can change it with that effect...

Ships in bottles can not sail, and neither can a tombstone kill a feather.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Tue 04 May 2004 07:55 AM (UTC)
Message
Well, sometimes trying something that you can't do yet is more frustrating than rewarding. Trust me, I've been there and done that. :)

I would consider putting your werewolf code into the update.c routines somewhere; whenever it's midnight (or whenever), check the month status, and transform accordingly. And then whenever it's 6 AM (or whenever) transform back if necessary.

What you can do for skills and spells is edit to skill_lookup function, or whatever it is that gets called in interp.c. You could add a flag to skills, e.g. "is_were", which means that "this is a werewolf skill" - you would make sure that the only skills that interp.c lets you use are the ones marked with is_were.

It's always important to think what is the rule and what is the exception. That will allow you to make design choices to make your task easier or harder. Then again, if you plan on making a really, really big deal of this, and plan on future expansion, you may want to be a little more thoughtful about how you proceed. To be honest I'm not sure myself yet what the "right" way of doing this is. I've definitely come to the conclusion that hacking it into a class is *not* the right way; it's a short-term solution but in the long run will probably create more trouble than it's worth.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #4 on Tue 04 May 2004 03:44 PM (UTC)
Message
If you want an entirely different set of werewolf skills independant from a players normal skill, and you want them saved from one transformation to another, I think a possibility is to add a field to your character structure, something like
    sh_int		condition	[MAX_CONDS];
    sh_int		learned		[MAX_SKILL];
    sh_int		lycan_learned	[MAX_SKILL];
    KILLED_DATA		killed		[MAX_KILLTRACK];
You could copy the reading/writing of the field to player files fairly easily, as well as add check to learn_from_success, check_skill(the interp called function), and a couple of others to use lycan_learned instead of learned while they are transformed.

Another option would be to create a new data structure and just have a pointer to it in character files. This would allow for a more versatile system, as you can have many fields without cluttering up your character structure directly. The down side is that this is more difficult to do. Just some thoughts.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,830 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.