20 Jan, 2009, Venrexx wrote in the 1st comment:
Votes: 0
If I can I would like to set the safe flag to allow you to Pkill but report it to the system as an illegal player kill
if ( xIS_SET( victim->in_room->room_flags, ROOM_SAFE ) )
{
if ( show_messg ) {
set_char_color( AT_MAGIC, ch );
send_to_char( "A magical force prevents you from attacking.\n\r", ch );
}
return TRUE;

I believe I would have to change this to allow someone to attack but report illegal pk but I am not sure how to go about doing that without royally screwing the flag up lol
20 Jan, 2009, Kayle wrote in the 2nd comment:
Votes: 0
This is going to sound mildly flame-ish, but whatever.

The easiest way for you to go about doing the things you want is going to be to learn basic programming techniques. Grab a book, and just start hammering it out. And don't give me that "I can't learn unless someone shows me" line. Most Programming books contain examples of what they're teaching you. Not everyone is going to want to spoon feed the answers to you. You're not actually going to learn anything as long as people are handing you the answers. It's not how the human mind retains things.

If you can't invest the time learning basic programming, Why should I invest the time to do your code changes for you? If you "can't learn" without someone spoon feeding the answers to you… Maybe programming isn't the hobby for you.

[/being a dick]
20 Jan, 2009, Venrexx wrote in the 3rd comment:
Votes: 0
Like I had said before in other posts, I literally cannot learn unless there is an example and explanations directly associated with what I am doing otherwise I cannot figure out how to associate the material I have learned with the environment that I am trying to apply it to. It is the same for coding as it has been for anything else in my life, in this instance yes those coding books taught me some but the majority of the information I have learned I could not apply to the code because the examples had nothing to do with how I was trying to apply them. You can flame me, mock me or insult me all you like but I cannot change how I learn. But I would appreciate if people would stop picking on my learning disability, it is hard enough as it is without people insulting me for it as well -.-
I am not asking that people "spoon feed me" the answers, I am just requesting people help me understand what it is I am doing and generally giving examples to the situation helps alot.
20 Jan, 2009, Zeno wrote in the 4th comment:
Votes: 0
Quote
I am just requesting people help me understand what it is I am doing and generally giving examples to the situation helps alot.

We've tried time and time again.
Zeno said:
Where str is string = target + amount;

do_hell(NULL, str);


Dunno if you can use NULL though.

Look into basic programming: function calls.
20 Jan, 2009, Davion wrote in the 5th comment:
Votes: 0
Venrexx said:
Like I had said before in other posts, I literally cannot learn unless there is an example and explanations directly associated with what I am doing otherwise I cannot figure out how to associate the material I have learned with the environment that I am trying to apply it to. It is the same for coding as it has been for anything else in my life, in this instance yes those coding books taught me some but the majority of the information I have learned I could not apply to the code because the examples had nothing to do with how I was trying to apply them. You can flame me, mock me or insult me all you like but I cannot change how I learn. But I would appreciate if people would stop picking on my learning disability, it is hard enough as it is without people insulting me for it as well -.-
I am not asking that people "spoon feed me" the answers, I am just requesting people help me understand what it is I am doing and generally giving examples to the situation helps alot.


I understand the way you learn. I learn a very similar way. However, you still have to know how the language works before you can even start to understand it via examples. The point of reading the book, is to just grasp what all the characters do within the code. Like what '*' means, the difference between ', and ". Using & properly, etc. You still have to grasp the basics of the language. You may not be able to apply them directly to the code at all. There's just some things that you can't learn from simply looking at the code (trust me, I tried). Before you jump into code, you should at least have some concept of what a pointer is, and how a memory address relates to it. As well as understand how linked lists work as these are huge parts to any dikurivative. Now that said, it doesn't mean we're not going to help you. You can read these things and simply ask "Hey, I don't get this, how does it relate to (insert codebase here)" and I'm sure someone out there will have an answer for you. These people aren't wrong, some just have an interesting way of putting things ;).
21 Jan, 2009, David Haley wrote in the 6th comment:
Votes: 0
The problem is that it is unclear to us – I think I speak for all of us – what kind of examples you seem to need to help you learn. It looks like the "examples" needed are in fact the solution to the problem, and then a little bit later, a new question pops up on the forum with another request for "examples" and the question is basically repeated until a solution is given in full detail. We aren't in your head, obviously, so we don't know what is going on. The usual modus operandi for forums like this one – where you have a bunch of developers – is to assume that people are doing their homework, and to then stop paying attention to somebody who doesn't look like they are.

I realize that it probably seems horrendously boring to have to go "back to basics" and learn the fundamentals, but in the end of the day, as Davion said, it is the only way you will ever go forward usefully.

Here are some things to try:
- can you write a "hello world" program from scratch?
- can you modify that program to take a string from input, and say "hello <the string that was inputted>"?
- can you take two numbers from input, multiply them together, and output the result?

It's really unclear, I think, just how much programming you know, because people have given you what appear to be fully complete answers except for the literal code being written. It would help a lot if we knew where you are in terms of your programming ability. There is no shame in having to start at the beginning – we all did. Well, actually, many people didn't, and then later paid the price for their impatience and hotheadedness, either in the form of total frustration at not being able to do something, or in the development of very bad habits that will hamper them for the rest of their programming career (until corrected, if such a time arrives). FWIW, I tried to jump-start things, and even though I got pretty far, the amount I learned in just a few months of doing things "The Right Way" exceeds the amount I learned in several years of "self teaching".
21 Jan, 2009, Venrexx wrote in the 7th comment:
Votes: 0
Well to be honest I decided to go with a compiler program and a few tutorials that zeno gave me along side a few I found while browsing for coding tutorials in general. I spent a few weeks on the same couple of things and have learned pretty much nothing from it, I seen how to make what they wanted to make but I couldn't apply it to anything I wanted to because of the fact that I just cannot seem to do that with any form or subject that usually needs that kind of learning. I just figured that if I gave some things that I needed help with I would be able to get somewhere finally, unfortunately I was apparently mistaken. Sorry for wasting your time :(
21 Jan, 2009, The_Fury wrote in the 8th comment:
Votes: 0
Venrexx said:
Well to be honest I decided to go with a compiler program and a few tutorials that zeno gave me along side a few I found while browsing for coding tutorials in general. I spent a few weeks on the same couple of things and have learned pretty much nothing from it, I seen how to make what they wanted to make but I couldn't apply it to anything I wanted to because of the fact that I just cannot seem to do that with any form or subject that usually needs that kind of learning. I just figured that if I gave some things that I needed help with I would be able to get somewhere finally, unfortunately I was apparently mistaken. Sorry for wasting your time :(


Maybe this was because you did not grasp and understand the subject matter in the first place, also, if you fail to understand basics that most books run you through, how do you expect to comprehend much more complex examples like what you have been asking here.

Learning to code takes time, learning to be a competent coder like many on these boards who have attempted to steer you in the right directions takes even longer. We are fortunate to have very talented people on these forums to teach and guide those who are just starting and heeding their council will most often lead you in the right direction.

Take for example the other thread, grepping for supermob shows you a lot of code that uses supermob to do things, those lines of code answer your question fully. I gave you all that you need to know to move forward, and use supermob to hell people in the absence of a valid immortal. I could have written the 1 line of code you needed for you and you would have learned nothing, i have you 30 odd lines of code to look at where you can learn everthing you need to know about supermob, from where it is initialized through to what it can do.

/* Hello World program */

#include<stdio.h>

main()
{
printf("Hello World");


}


Typing that lone into an editor and compiling it, does not mean you understand anything about whats going on and why, all that is, is monkey see, monkey do, and in many ways that all i do as a programmer, because im not of the same caliber as many on this forum, but i understand whats going on and why in the above example, i also understand many of the fundamentals of programming, and its the fundamentals that your currently lacking in. Get some books on basic programming then read and apply what they teach you, take some night courses in programming and algorithm design, do whatever you have to do to learn the fundamentals so that when you dont know how to do something and you ask a question, your able to learn a lot from the answers your given.

I have a lot of respect for people like Nick Gammon and David Haley, because they never wrote the code directly for me, they would teach you the principles and ideas and left you on your own to work it out, and then when your failing, you show the code you have written and they point out the areas you have gone wrong in.
21 Jan, 2009, quixadhal wrote in the 9th comment:
Votes: 0
Understanding the basics is far more important than any of us can find a way to say it.

Anyone can learn to write code. Most of us learn to write BAD code, because we do it the way that seems to make sense. Then, if we're lucky, someone forces us to unlearn a fair amount of what we thought we knew, and actually learn how to THINK about it before trying to DO it.

A programming class or book really shouldn't do much to teach you a particular language. That's for later. Learning the difference between a bubble sort and quicksort, and WHY O(n^2) is so much worse than O(n log n)… those are the kinds of things that help you write good code. Learning why a dangling pointer doesn't always cause a crash, and all the many places data corruption can come from… those help you learn how to debug and fix problems.

In the end, programming is about solving problems. You need to be good a problem solving before you can master doing it in a particular language, or for a particular application.

Sure, you can skip all the boring stuff, but then you won't know WHY things work the way they do. Knowing HOW gets you across the street, but knowing WHY takes you wherever you need to go.
21 Jan, 2009, David Haley wrote in the 10th comment:
Votes: 0
To reinforce what Fury said, this is not a process that happens in a few weeks. If it were, then there'd be a lot more programmers running around. :wink: You might have set unrealistic expectations for yourself, which explains why you are disappointed now. It is completely unsurprising to me that spending a few weeks with some books didn't help you understand everything about the MUD code you want to write. Why would it? That is like spending a few weeks with a French language book, and then expecting to be able to read Rousseau and understand everything that is going on. Just as learning to speak a natural language takes time, so does learning to program. In fact, learning to program requires not only a "vocabulary", but as Quix said, it requires understanding problem solving.

If you get discouraged, don't let it be because you're not achieving great victory immediately, because you will not do so until years and years of practice and education. But you should be aware that you are embarking on a path that will take time. One of the interesting things about forums is that you can go back and see the proof in the pudding, as it were, and watch how many people here and on other places have learned over the years. People eventually go from those asking for help to those giving help. It takes a long time, but is IMO very rewarding.

I started programming sometime around age 6 or 7. I started messing around with C sometime around age 13 or 14, and C++ around 16, I think. By 18, when I started university, I thought I was pretty hot stuff. By 20 I realized how little I knew before and how much better I had become. Some years later, I am still improving, every day. Had I been doing things correctly from the beginning, I think the whole process would have been faster, but even then it would have taken a good several years. I have taught introductory and intermediate computer science, and can tell you that people do not go from knowing nothing to being able to write full programs in just a few weeks.

In the end of the day, the decision to persevere is yours alone. You need to know that the process is slow, and that you should not expect to be able to understand everything about the MUD in a short period of time. You need to decide, armed with this knowledge, if you still want to spend the time it will take, or if you would more enjoy spending your time on something else. Do what you enjoy – this is a hobby after all. Just don't set unrealistic expectations for yourself, because that will only lead to disappointment.
21 Jan, 2009, Keberus wrote in the 11th comment:
Votes: 0
Quote
Knowing HOW gets you across the street, but knowing WHY takes you wherever you need to go.


I like that.


Venrexx: If you want to truely learn. I'll teach you the basics. I've been bored lately, and I can always use another side project. The only real stipulation is that you have to show me that you're making progress, if I don't feel that you are, then I'll stop trying to help.

Edit: Figured you might wanna know the easiest way to contact me is via IM, keberus@msn.com, if I'm not around send me an email, I'll get back with you, and we can set aside some time to get started.
21 Jan, 2009, tphegley wrote in the 12th comment:
Votes: 0
Venrexx said:
If I can I would like to set the safe flag to allow you to Pkill but report it to the system as an illegal player kill
if ( xIS_SET( victim->in_room->room_flags, ROOM_SAFE ) )
{
if ( show_messg ) {
set_char_color( AT_MAGIC, ch );
send_to_char( "A magical force prevents you from attacking.\n\r", ch );
}
return TRUE;

I believe I would have to change this to allow someone to attack but report illegal pk but I am not sure how to go about doing that without royally screwing the flag up lol


To go back to your original post. You need to find where something is being logged and figure out how/why it logs the action. Then you need to put that knowledge to use here.

Here is how I learned. I looked at the code, figured out how to grep, and then find something in the code that related to what I wanted to do. This is not the proper way as stated, but I, like you, like to learn by doing and seeing examples. There are no better examples then what is already in the code. You just have to find it. Grep is your friend.

With that said, I have been 'learning' to program for 8 years just by looking at the code itself and figuring out how to do something and if they break figuring out why it crashed and how to fix it. Sometimes I have to ask why it broke (as I did with the libc.so.6 topic) and I can usually give enough information to help someone give me the knowledge I can use to fix my code. I just recently bought the C++ for Dummies book and I highly recommend it. I have learned more in the first 10 chapters then in my first 4 years of messing around with the code. I actually learned WHY things work. Now, I haven't gotten into the more advance C++ stuff yet, but will eventually.

I guess my rambling is meant to say, there are tons of examples in your code already. If you learn best by hands on then I say grep your code for things that you want to look off of to figure what you want to do.

In this case, look in your log files and see what your logs say. Then grep for that string in your codebase, find the file and line number and then see how log works.

If you're really serious about learning programming then take a class or two. As David said, that is the best way to learn properly. I myself have not learned properly and I have paid for it because my knowledge only applies to mud code rather then being able to apply it to any type of programming. With the book I bought though it has helped me see things differently though.

You need to go into this with a level head and knowing that you're going to screw up. It's inevitable. Make backups. You WILL mess something up. But if you have the proper tools, you can fix it.

Grep, gdb, valgrind, mudbytes in that order :lol:
21 Jan, 2009, Hades_Kane wrote in the 13th comment:
Votes: 0
I echo tphegley quite a bit, actually…

I've been "coding" for about three years now. After years of being one of the lead immortals on a MUD here and there, but getting frustrated at the lack of dedication of the people coding and the lack of progress, I finally decided that if I want it done, then I'm going to have to do it myself. I already had years of experience on the ROM codebase, so that helped a ton, because I understood quite clearly how things worked from a player's perspective, and how it worked from a builder's perspective. I had some measure of familiarity with the concepts of if/or/and checks and such because of mobprogs.

I started out changing simple things… mostly simple string changes, such as changing the damage outputs, the names of the days and months, some of the misc messages you got such as "Alas, you cannot go that way." Grep quickly because my friend in this way. I wanted to change the logout message, so I grepped for that and found where it was. It wasn't too long before I began to understand where things would likely be located. Things like score, who, and other informational commands were located in act_info.c while combat messages and such were in fight.c. I began to understand that merc.h was the file where a lot of things needed to be declared (I didn't understand what 'declaring' something was at the time, but the errors I would get quickly let me know that I needed to copy some things over to that file that was included in every other file).

Little by little, things began to make sense. Mostly through trial and error (and errors :p). Fixing errors that popped up as I compiled is what taught me quite a bit. My first somewhat complicated thing was changing the layout of the who command and score sheet. Next came install some basic snippets, and then came changing some other snippets to do slightly different things. Every step of the way in the beginning, particularly, were baby steps. And every step of the way, I've used the code already there to learn how to do something new. If I had an affect or something I wanted to create, I would think really hard for something in the MUD that worked in a similar way, and if I was able to think of something, I would grep for it, find it, and study it until I had some idea of what was going on. Sometimes I wouldn't, and I would copy the function and mess with it until I did.

It's been a slow process. At the beginning of it all, I bought a "Teach Yourself C" book, but I couldn't learn from that, as I had nothing real or tangible to apply it to. Now, three years later that I feel I understand quite a bit of the basics, I'm thinking of going back through the book and trying to relearn things the correct way. Like tphegley, I understand MUD code. I've rarely encountered something that I just absolutely couldn't do, but that's because I understand the way ROM works.

But it took me two years to get to the point where I felt confident enough that I could rework anything if I put enough time and effort into it. And now, three years after I started, I'm still learning, there's still plenty I don't understand, and I still have to come to places like here to get help from the more experienced and the more skilled to help me learn how to figure out things when I'm stuck. A lot of the time, the advice flies over my head, but I put a sincere amount of effort in trying to apply what they suggest and trying to learn what it is that has gone wrong and why.

If you are going to take the "learn by doing" approach, which I've done, prepared to spend literally years learning, and even after about 3 years, you'll still have a long way to go. It's not easy and it takes a tremendous amount of patience. If you do indeed have a learning disability, then be prepared for that process to take even longer. But patience is key, that, and frequent backups of your code. I've had to restore backups on numerous occasions when I've mangled stuff beyond repair :p
21 Jan, 2009, Venrexx wrote in the 14th comment:
Votes: 0
What I don't understand is I can do most things and then when it comes back to basics I get hooped. I try reading the books and then I realise that most of the actual commands they use and teach you with have no standing in the actual code and I have no idea what it is supposed to be in the mud and so forth. For example I wrote my score page, my wizlist, my area list, my who list was changed alot by me. Ill show you my score:
#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "mud.h"

void do_score2( CHAR_DATA * ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
char buf3[MAX_STRING_LENGTH];
char buf4[MAX_STRING_LENGTH];
// AFFECT_DATA *paf;

if( IS_NPC( ch ) )
{
do_oldscore( ch, argument );
return;
}

sysdata.outBytesFlag = LOGBOUTINFORMATION;

switch ( ch->style )
{
case STYLE_EVASIVE:
sprintf( buf, "Evasive" );
break;
case STYLE_DEFENSIVE:
sprintf( buf, "Defensive" );
break;
case STYLE_AGGRESSIVE:
sprintf( buf, "Aggressive" );
break;
case STYLE_BERSERK:
sprintf( buf, "Berserk" );
break;
default:
sprintf( buf, "Standard" );
break;
}

if( ch->alignment > 900 )
sprintf( buf2, "Devout" );
else if( ch->alignment > 700 )
sprintf( buf2, "Noble" );
else if( ch->alignment > 350 )
sprintf( buf2, "Honorable" );
else if( ch->alignment > 100 )
sprintf( buf2, "Worthy" );
else if( ch->alignment > -100 )
sprintf( buf2, "Neutral" );
else if( ch->alignment > -350 )
sprintf( buf2, "Base" );
else if( ch->alignment > -700 )
sprintf( buf2, "Evil" );
else if( ch->alignment > -900 )
sprintf( buf2, "Ignoble" );
else
sprintf( buf2, "Fiendish" );

strcpy(buf3, num_punct(ch->mana));
strcpy(buf4, num_punct(ch->max_mana));

pager_printf( ch, "&YLoading…\n\r" );
pager_printf( ch, "&Yo&c=============================================================&Yo \n\r" );
pager_printf( ch, " &G%s's &gScore \n\r", ch->name );
pager_printf( ch, "&Yo&c=============================================================&Yo \n\r" );
pager_printf( ch, " &CRace &Y: &W%-15s&GMud Time &Y: &W%d &wo'clock %s \n\r", capitalize( get_race( ch ) ), (time_info.hour % 12 == 0) ? 12 : time_info.hour % 12, time_info.hour >= 12 ? "pm" : "am" );
pager_printf( ch, " &CLevel &Y: &W%-2d &GTime Played &Y: &W%d &whours\n\r", ch->level, ( get_age( ch ) - 4 ) );
pager_printf( ch, " &CAge &Y: &W%-3d &GGold &Y: &W%s \n\r", get_newage( ch ), num_punct( ch->gold ) );
pager_printf( ch, " &CSex &Y: &W%-7s &GItems Carried&Y: &W%d \n\r", ch->sex == SEX_MALE ? "Male" : ch->sex == SEX_FEMALE ? "Female" : "Neutral", ch->carry_number );
pager_printf( ch, " &CRPP &Y: &W%-3d &GMax Items &Y: &W%d \n\r", ch->pcdata->quest_curr, can_carry_n( ch ) );
pager_printf( ch, "&Yo&c=============================================================&Yo \n\r" );
pager_printf( ch, " &Y[&GSTR&Y: &W%-3d&Y] [&GIQ&Y: &W%d&Y] &Y[&GSPD&Y: &W%-3d&Y] [&GCAP&Y: &W%d&Y]\n\r", get_curr_str( ch ), get_curr_int( ch ), get_curr_dex( ch ), get_curr_con( ch) );
pager_printf( ch, " &Y[&GLCK&Y: &W%d&Y(&cUntrainable Stat&Y)]\n\r", get_curr_lck( ch ) );
pager_printf( ch, "&Yo&c=============================================================&Yo \n\r" );
pager_printf( ch, " &zHitPoints &Y: &w%d \n\r", ch->hit );
pager_printf( ch, " &zPosition &Y: &w%s \n\r", buf );
pager_printf( ch, " &zAlignment &Y: &w%s \n\r", buf2 );
pager_printf( ch, " &zEnergy &Y: &w%3s \n\r", buf3 );
pager_printf( ch, " &zArmor &Y: &w%d \n\r", get_armor( ch ) );
pager_printf( ch, " &zBase PL &Y: &w%s\n\r", num_punct_ld( ch->exp ) );
pager_printf( ch, " \n\r" );
pager_printf( ch, " &RPlayerKills &Y: &w%-5d &RPlayerDeaths&Y: &w%d \n\r", ch->pcdata->pkills, ch->pcdata->pdeaths );
pager_printf( ch, " &RMobKills &Y: &w%-5d &RMobDeaths &Y: &w%d \n\r", ch->pcdata->mkills, ch->pcdata->mdeaths );
pager_printf( ch, "&Yo&c=============================================================&Yo\n\r" );
if ( ch->pcdata->clan != NULL )
{
pager_printf( ch, " &zClan Name&Y : &W%s%-s\n\r", color_clan( ch ), ch->pcdata->clan->name );
pager_printf( ch, " &zCurrent Rank&Y : (&W%d&Y)&W%-20s\n\r", ch->pcdata->clanRank, get_clanTitle( ch ) );
pager_printf( ch, " &zTotal Clan Members&Y : (&W%d&Y)\n\r", ch->pcdata->clan->members );
pager_printf( ch, " &zTotal Zeni Donated&Y : (&W%s&Y) &cTotal Zeni Taxed&Y: (&W%s&Y)\n\r", num_punct_d( ch->pcdata->clanZeniDonated ), num_punct_d( ch->pcdata->clanZeniClanTax ) );
pager_printf( ch, "&Yo&c=============================================================&Yo\n\r" );
}
if( IS_IMMORTAL( ch ) )
{
if( ch->pcdata->area )
{
pager_printf( ch, " &CVnums&Y: &WRoom &Y(&G%-5.5d - %-5.5d&Y)\n\r", ch->pcdata->area->low_r_vnum, ch->pcdata->area->hi_r_vnum );
pager_printf( ch, " &WObject &Y(&G%-5.5d - %-5.5d&Y)\n\r", ch->pcdata->area->low_o_vnum, ch->pcdata->area->hi_o_vnum );
pager_printf( ch, " &WMob &Y(&G%-5.5d - %-5.5d&Y)\n\r", ch->pcdata->area->low_m_vnum, ch->pcdata->area->hi_m_vnum );
pager_printf( ch, " &CArea Loaded &Y[&W%s&Y]\n\r", ( IS_SET( ch->pcdata->area->status, AREA_LOADED ) ) ? "&Byes" : "&bno" );
pager_printf( ch, "&Yo&c=============================================================&Yo\n\r" );
}
}
return;
}

Ant my wizlist I decided to do Circlemud style for reasons that I like to change it and add to it and such the way I want it looking and this makes it easier for me:
/*Snippet created by Venrexx/Vendetta, Influenced by CircleMUD*/

#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "mud.h"

void do_wizlist2( CHAR_DATA * ch, char *argument )
{
pager_printf( ch, "&Y &O(&Y*&O) \n\r");
pager_printf( ch, "&O ()&z=================================================&O() \n\r");
pager_printf( ch, "&R Staff Of &rDragon&zBall&W: &cForgotten Legends\n\r");
pager_printf( ch, "&O ()&z=================================================&O() \n\r");
pager_printf( ch, "&R \n\r");
pager_printf( ch, "&C Venrexx &Y-&WOwner/Coder/Enforcer &R[&GOwner&R] \n\r");
pager_printf( ch, "&C Zanex &Y-&WCo-Owner/Builder/Enforcer &R[&GCo-Owner&R] \n\r");
pager_printf( ch, "&C Grubby &Y-&WCo-Owner/Builder/Enforcer &R[&GCo-Owner&R] \n\r");
pager_printf( ch, "&c Open &O-&wCoder/Enforcer &r[&gCoder&r] \n\r");
pager_printf( ch, "&c Open &O-&wEnforcer &r[&gEnforcer&r] \n\r");
pager_printf( ch, "&c Open &O-&wHead Builder &r[&gBuilder&r] \n\r");
pager_printf( ch, "&c Open &O-&wRP Admin &r[&gRolePlay&r] \n\r");
pager_printf( ch, "&c Open &O-&wAdv. Builder &r[&gBuilder&r] \n\r");
pager_printf( ch, "&c Open &O-&wBuilder &r[&gBuilder&r] \n\r");
pager_printf( ch, "&c Open &O-&wBuilder &r[&gBuilder&r] \n\r");
pager_printf( ch, "&c Open &O-&wRP IMM &r[&gRolePlay&r] \n\r");
pager_printf( ch, "&c Open &O-&wRetired &r[&gRetiree&r] \n\r");
pager_printf( ch, "&R \n\r");
pager_printf( ch, "&O ()&z=================================================&O() \n\r");
pager_printf( ch, "&c SPEAK TO &CVENREXX &cOR &CGRUBBY &cABOUT ANY POSITIONS \n\r");
pager_printf( ch, "&O ()&z=================================================&O() \n\r");
}

But all that I only learned how to do by looking at other codes that I could easily find seeing as score already existed and I could learn what each thing accounted for. Wizlist the way I have it setup a monkey could have done it seeing as all it is doing is sending strings to the mud when you call for them, thats about it. I do need to learn basics but just like how I am probably the best computer technician in all of peace region I had to learn from trial and error and through examples and explanations, I can get good at this I just have a different way of learning and it is the only way I CAN learn :(
21 Jan, 2009, Venrexx wrote in the 15th comment:
Votes: 0
tphegley said:
Venrexx said:
If I can I would like to set the safe flag to allow you to Pkill but report it to the system as an illegal player kill
if ( xIS_SET( victim->in_room->room_flags, ROOM_SAFE ) )
{
if ( show_messg ) {
set_char_color( AT_MAGIC, ch );
send_to_char( "A magical force prevents you from attacking.\n\r", ch );
}
return TRUE;

I believe I would have to change this to allow someone to attack but report illegal pk but I am not sure how to go about doing that without royally screwing the flag up lol


To go back to your original post. You need to find where something is being logged and figure out how/why it logs the action. Then you need to put that knowledge to use here.

Here is how I learned. I looked at the code, figured out how to grep, and then find something in the code that related to what I wanted to do. This is not the proper way as stated, but I, like you, like to learn by doing and seeing examples. There are no better examples then what is already in the code. You just have to find it. Grep is your friend.

With that said, I have been 'learning' to program for 8 years just by looking at the code itself and figuring out how to do something and if they break figuring out why it crashed and how to fix it. Sometimes I have to ask why it broke (as I did with the libc.so.6 topic) and I can usually give enough information to help someone give me the knowledge I can use to fix my code. I just recently bought the C++ for Dummies book and I highly recommend it. I have learned more in the first 10 chapters then in my first 4 years of messing around with the code. I actually learned WHY things work. Now, I haven't gotten into the more advance C++ stuff yet, but will eventually.

I guess my rambling is meant to say, there are tons of examples in your code already. If you learn best by hands on then I say grep your code for things that you want to look off of to figure what you want to do.

In this case, look in your log files and see what your logs say. Then grep for that string in your codebase, find the file and line number and then see how log works.

If you're really serious about learning programming then take a class or two. As David said, that is the best way to learn properly. I myself have not learned properly and I have paid for it because my knowledge only applies to mud code rather then being able to apply it to any type of programming. With the book I bought though it has helped me see things differently though.

You need to go into this with a level head and knowing that you're going to screw up. It's inevitable. Make backups. You WILL mess something up. But if you have the proper tools, you can fix it.

Grep, gdb, valgrind, mudbytes in that order :lol:


As for this, the string that is sent to the game when attacking someone in a room marked safe is:
send_to_char( "A magical force prevents you from attacking.\n\r", ch );

What I Don't understand is how this message prevents you from attacking altogether, I believe it has something to do with AT_MAGIC but I am not sure WHAT it is exactly AT_MAGIC even does.
Oh and as a side note, I have followed all the steps zeno had given me to follow to get GDB working in my code and no ammount of trying has fixed the problem that GDB just wont create a dump file when the game crashes, infact I havent had any luck on using GDB at all for some reason.
21 Jan, 2009, Kayle wrote in the 16th comment:
Votes: 0
It has nothing to do with AT_MAGIC. AT_MAGIC is a color. It translates into a probably two digit number. The reason it's stopping them from attacking is because the is_safe function returns true if the room is flagged as safe. And the kill or murder function stops. and doesn't do anything if is_safe is true.
21 Jan, 2009, Zeno wrote in the 17th comment:
Votes: 0
AT_MAGIC is just a color.

[EDIT] Damn you!
21 Jan, 2009, Hades_Kane wrote in the 18th comment:
Votes: 0
Venrexx said:
What I Don't understand is how this message prevents you from attacking altogether, I believe it has something to do with AT_MAGIC but I am not sure WHAT it is exactly AT_MAGIC even does.


What function is that in? You might quote the rest of the function as well and those of us unfamiliar with your codebase might better be able to help you with that.

In my game, we have an IS_SAFE check that runs through various things to see if its legal to attack a character, and if it isn't, it returns with a message saying such. I don't know if your's would have something similar and if that's being called or not.
21 Jan, 2009, Venrexx wrote in the 19th comment:
Votes: 0
Lol what was that? a race to see who can define AT_MAGIC? :D lol But seriously though, I think I understand what you mean. Kill playername is designed to do just that and it is also designed somewhere in it to listen to flags, when the safe flag is set and comes out TRUE then instead of kill doing its regular follow through and someones face getting murdered you instead end up with a message and thats all. Right?
21 Jan, 2009, Kayle wrote in the 20th comment:
Votes: 0
Zeno, I'm king of the Forums. You must bow to me and my quick fingers. :P
0.0/34