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
➜ Adding a new hide type skill
Adding a new hide type skill
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Dralnu
USA (277 posts) Bio
|
Date
| Thu 28 Apr 2005 02:58 AM (UTC) |
Message
| 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:
if (is_npc( ch)&&(is_ranger)
ect. so that only rangers could see it? | Top |
|
Posted by
| Txzeenath
USA (54 posts) Bio
|
Date
| Reply #1 on Fri 29 Apr 2005 12:43 PM (UTC) |
Message
| 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 |
Darkness comes along thy path, searching, wanting, calling wrath,
shadows awaken, release the light, one and only.. here to fight,
challenge the darkness, the shadows they call, hunting the living,
more and all. Roaring thunder, full of hate, a single bound, seals
your fate.
-Txzeenath
telnet://divineright.org:8088
Alumuble Arda -
*Player owned shops, clans, and housing
*Multiclass & Stat training
*Random mob name generation implemented and Overland mapping.
*Realistic equipment statistics
*Interactive enviroment(weather/sectors)
*Weapon sheaths(scabbards), Throwing weapons
*Automatic crash recovery, saving, and reporting without disconnecting
*Fully customizeable color, Automapper, "Smart" mobiles, Hiscore tables, and more!
Currently running AGE v1.9.6(Originated and modified from Smaug 1.4a) | Top |
|
Posted by
| Dralnu
USA (277 posts) Bio
|
Date
| Reply #2 on Fri 29 Apr 2005 08:24 PM (UTC) |
Message
| 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) | Top |
|
Posted by
| Txzeenath
USA (54 posts) Bio
|
Date
| Reply #3 on Fri 29 Apr 2005 08:39 PM (UTC) |
Message
| Hmm mine is kinda a jumble.. but:
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
If you need anything else just ask |
Darkness comes along thy path, searching, wanting, calling wrath,
shadows awaken, release the light, one and only.. here to fight,
challenge the darkness, the shadows they call, hunting the living,
more and all. Roaring thunder, full of hate, a single bound, seals
your fate.
-Txzeenath
telnet://divineright.org:8088
Alumuble Arda -
*Player owned shops, clans, and housing
*Multiclass & Stat training
*Random mob name generation implemented and Overland mapping.
*Realistic equipment statistics
*Interactive enviroment(weather/sectors)
*Weapon sheaths(scabbards), Throwing weapons
*Automatic crash recovery, saving, and reporting without disconnecting
*Fully customizeable color, Automapper, "Smart" mobiles, Hiscore tables, and more!
Currently running AGE v1.9.6(Originated and modified from Smaug 1.4a) | Top |
|
Posted by
| Dralnu
USA (277 posts) Bio
|
Date
| Reply #4 on Fri 29 Apr 2005 08:42 PM (UTC) |
Message
| 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... | Top |
|
Posted by
| Dralnu
USA (277 posts) Bio
|
Date
| Reply #5 on Fri 29 Apr 2005 08:55 PM (UTC) |
Message
| Near line 2719 in handler.c, there is alot about if a char can see you, and mentions hide/invis alot. That is what i need to alter, right?
/*
* True if char can see victim.
*/
bool can_see( CHAR_DATA * ch, CHAR_DATA * victim )
{
if( !victim ) /* Gorog - panicked attempt to stop crashes */
return FALSE;
if( !ch )
{
if( IS_AFFECTED( victim, AFF_INVISIBLE ) || IS_AFFECTED( victim, AFF_HIDE ) || xIS_SET( victim->act, PLR_WIZINVIS ) )
return FALSE;
else
return TRUE;
}
if( ch == victim )
return TRUE;
if( !IS_NPC( victim ) && xIS_SET( victim->act, PLR_WIZINVIS ) && get_trust( ch ) < victim->pcdata->wizinvis )
return FALSE;
/*
* SB
*/
if( IS_NPC( victim ) && xIS_SET( victim->act, ACT_MOBINVIS ) && get_trust( ch ) < victim->mobinvis )
return FALSE;
/* Deadlies link-dead over 2 ticks aren't seen by mortals -- Blodkai */
if( !IS_IMMORTAL( ch ) && !IS_NPC( ch ) && !IS_NPC( victim ) && IS_PKILL( victim ) && victim->timer > 1 && !victim->desc )
return FALSE;
if( !IS_NPC( ch ) && xIS_SET( ch->act, PLR_HOLYLIGHT ) )
return TRUE;
/*
* The miracle cure for blindness? -- Altrag
*/
if( !IS_AFFECTED( ch, AFF_TRUESIGHT ) )
{
if( IS_AFFECTED( ch, AFF_BLIND ) )
return FALSE;
if( room_is_dark( ch->in_room ) && !IS_AFFECTED( ch, AFF_INFRARED ) )
return FALSE;
if( IS_AFFECTED( victim, AFF_INVISIBLE ) && !IS_AFFECTED( ch, AFF_DETECT_INVIS ) )
return FALSE;
if( IS_AFFECTED( victim, AFF_HIDE )
&& !IS_AFFECTED( ch, AFF_DETECT_HIDDEN )
&& !victim->fighting && ( IS_NPC( ch ) ? !IS_NPC( victim ) : IS_NPC( victim ) ) )
return FALSE;
}
/*
* Redone by Narn to let newbie council members see pre-auths.
*/
if( NOT_AUTHED( victim ) )
{
if( NOT_AUTHED( ch ) || IS_IMMORTAL( ch ) || IS_NPC( ch ) )
return TRUE;
if( ch->pcdata->council && !str_cmp( ch->pcdata->council->name, "Newbie Council" ) )
return TRUE;
return FALSE;
}
/* 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. | Top |
|
Posted by
| Dralnu
USA (277 posts) Bio
|
Date
| Reply #6 on Fri 29 Apr 2005 09:23 PM (UTC) Amended on Fri 29 Apr 2005 09:33 PM (UTC) by Dralnu
|
Message
| 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? | Top |
|
Posted by
| Txzeenath
USA (54 posts) Bio
|
Date
| Reply #7 on Fri 29 Apr 2005 09:50 PM (UTC) |
Message
| Hmm you got any messengers? This makes it "difficult" to talk well :-p to me atleast lol |
Darkness comes along thy path, searching, wanting, calling wrath,
shadows awaken, release the light, one and only.. here to fight,
challenge the darkness, the shadows they call, hunting the living,
more and all. Roaring thunder, full of hate, a single bound, seals
your fate.
-Txzeenath
telnet://divineright.org:8088
Alumuble Arda -
*Player owned shops, clans, and housing
*Multiclass & Stat training
*Random mob name generation implemented and Overland mapping.
*Realistic equipment statistics
*Interactive enviroment(weather/sectors)
*Weapon sheaths(scabbards), Throwing weapons
*Automatic crash recovery, saving, and reporting without disconnecting
*Fully customizeable color, Automapper, "Smart" mobiles, Hiscore tables, and more!
Currently running AGE v1.9.6(Originated and modified from Smaug 1.4a) | 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.
21,267 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top