Looking to add a new skill similar to hide, and just want to make sure of what I'm doing.
Basically I can copy hide, change the flags, then add the flag to the do_visible. Anywhere else I would need to alter something so everything would work right?
Also I'd like to make it where onyl one class can detect people using the skill, so would I need to add to a detect skill something like:
I don't like doing things for people.. so i'll just tell you the primary parts of what you want to do:
Copy the hide like you said.. rename it.. give it it's own AFF(such as how hide has AFF_HIDE) than in handler.c, after this in can_see:
if (!IS_AFFECTED(ch, AFF_TRUESIGHT)
{
blah
blah
blah
}
if (IS_AFFECTED(victim, AFF_YOURSKILL) && ch->class != CLASS_SOMECLASS)return FALSE;
This is basically all you'll need.. I didn't look at the code during this so it may not be exact, but you should get the idea. Try it and see if it works .. if not .. than me or someone else can give more detail
Thanks. I don't want someone to do things for me, I'm happy with a general overview since I'm about as new to coding as you can get. I think I can get it working though, as I mostly needed to know if I was right or not.
Also, some help would be nice as to which .c files do what. I know player.c is mostly player info, mud.c is the general code for the rest, and a few others, unless their is a helpfile I have missed along the line (which may be the case)
mud.h is defines.. such as structures(CHAR_DATA etc.) and where #define is mostly used, along with commonly used function declarations. You also define your new commands here(DECLARE_DO_FUN(do_sit) etc.)
act_obj.c is things like drop, take sacrifice
Deity.c is just about everything relating to deities
act_wiz.c is immortal stuff.
db.c is basically any loading/database stuff
fight.c well... duh :-p
skills.c is... skills
magic.c is spells
handler.c is where most of the functions like get_class, can_see, etc. are kept.
const.c is where most of the in-file names for stuff is
tables.c is where the tables are kept, class_table, race_table and also skill/spell/command listings.
Most of the files are self-explanitory in what they do, especially if you go into them and read the big comment at the top.
For what you're doing you'll want these:
mud.h
handler.c
skills.c
I'm looking throug handler.c for the TRUE_SIGHT bit, and getting nada. I got the skill added to the system, but finding the TRUE_SIGHT bit is a bit rough, and as for mud.h, like I said, I'm almost clueless...
/* Commented out for who list purposes
if (!NOT_AUTHED(victim) && NOT_AUTHED(ch) && !IS_IMMORTAL(victim)
&& !IS_NPC(victim))
return FALSE;*/
return TRUE;
}
I need to add
if (IS_AFFECTED(victim, AFF_CAMOUFLAGE) && ch->class != CLASS_RANGER)return FALSE;
and I need to add the
||IS_AFFECTED( victim, AFF_CAMOFLAUGE) in along with the invis/hide/wininvis
in line 10 in the above code, right? Sorry for all the questions btw, just want to make sure I understand this so that later I understand exactly what I am doing.
Ok, added everything in, started to make
I got through a bunch of issues, mainly undeclared problems by hunting back through mud.h, handler.c, and skills.c, but now I'm into skills.c and keep getting an undeclared problem. using crtl-f and the equating HIDE setting, I cann't find the original issue with the undeclared problem. They both happen in do_camouflage and do_visible, and I'm pretty sure I've gotten everything fixed in mud.h and handler...
Edit: Turned out to be a typo. Silly me. Now I'm gettin:
undefinced referenced in:
affect_modify in handler.o (_gsn_camouflage)
do_camouflage in skills.o (same thing)
then there are a bunch of other odd things, but mostly just undeclared refrences. Help?