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 ➜ A few questions.

A few questions.

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


Pages: 1  2 3  4  5  6  

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #15 on Mon 11 Apr 2005 02:28 AM (UTC)
Message
Type: "cedit skin"
What does it display?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Robert Powell   Australia  (367 posts)  Bio
Date Reply #16 on Mon 11 Apr 2005 06:07 AM (UTC)

Amended on Mon 11 Apr 2005 06:08 AM (UTC) by Robert Powell

Message
Quote:

Ok, I don't understand the commands for adding the code for a new skill. I'm quite willing to try it myself but I don't know how to check if I'm in a room where you can fish or how to check the bait on my pole or your skill or anything. Could somebody give me a list of commands for writing code?


Whenever i face these problems, i look to other sections of code that might hopefully do simular things to what i want to acheive.

1. Am i in the right type of room to fish.

What i would do is grep for a sector type and hope that something looks to do what i need. grep SECT_ *.c, what i found thats usefull is this, in magic.c in the spell plant pass.

if ( ch->in_room->sector_type == SECT_FOREST )
{
}
else
{
}

So if a Chariter is in a room with the sector type equalling forest, it would then execute the next line/few lines of code contained in the {}, else execute the code in this section {}

2. Does charicter have bait or a pole.

A fishing pole would be held, right? So we can then check to see what the player has in the WEAR_HOLD location. Lots of other things need to be held to use, so grep WEAR_HOLD *.c and there i found this example in do_scribe, to scribe you need to be holding a blanc scroll.

if ( ( scroll = get_eq_char( ch, WEAR_HOLD ) ) == NULL )
{
}

I this get_eq_char checks to see whats in WEAR_HOLD and if there is nothing (NULL) then it executes whats in the {}, if there is something in WEAR_HOLD, then scroll gets given all the data for that object(dont know if i said that right) so we can then check values of scroll to see if its that right type to do what we want.


if ( scroll->item_type == ITEM_SCROLL )


A check like this would be used to see of the oject is the right item_type.

I have assumed that you would be creating a new item type.

There is some parts to get you thinking, you will also need to work out how to remove and object from a player, to take away a lost or stolen bait, load an object into a room to give the player a fish if one is caught.

Good luck, if your still stuck, post what you have written and we can help you out further, the most important part here is having a go at it, dont worry if it doesnt work right or even compile first time, its all a part of the learning.

The good thing here is once you have the first one done, you will have a frame work to continue on to make baking and the other sumular skills with.

Peace.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
Top

Posted by Longbow   (102 posts)  Bio
Date Reply #17 on Wed 13 Apr 2005 11:05 PM (UTC)

Amended on Wed 13 Apr 2005 11:13 PM (UTC) by Longbow

Message
Alright, I figgered out what my skin problem was. I had to practice the skill. :D Yes, go ahead and laugh...

Whenever I kill an animal it says:

Log: [*****] BUG: death_cry: invalid vnum. As a result I don't get a deathcry from anything. What's up with that?

Edit: ugh, now it's gone away. But I can skin the same corpse as many times as I want! I want it to die when it has been skinned once! Grrr...

Also, the whole point of the skin command for me was to make it possible to sell animal skins. Will it automatically tell the difference between the skins? Somehow I doubt that, so how do I define what kind of skin it should be so I can sell it?

Thanks for that last post Robert Powell, I'll take a try at it and see what I can come up with.


Godbless yall!

Longbow
Top

Posted by Robert Powell   Australia  (367 posts)  Bio
Date Reply #18 on Wed 13 Apr 2005 11:55 PM (UTC)

Amended on Wed 13 Apr 2005 11:56 PM (UTC) by Robert Powell

Message
Death cry, i had a look at it, its in fight.c, here is the section of code that issues the bug.

if(!get_obj_index(vnum))
	{
		bug("death_cry: invalid vnum", 0);
		return;
	}


The part get_obj_index looks to see if the variable vnum is a valid one, if it isnt valid then you get that error. So looking deeper into the deadth_cry function you need to find out where vnum is being givin its value to see what the heck it does.

if(HAS_BODYPART(ch, cindex))
    		{
    			msg = part_messages[shift];
    			vnum = part_vnums[shift];
    			break;
    		}

Vnum equals parts_vnums which atleast means something, its the vnum of a body part that is left over when you kill a mobile. So i would say in limbo.are your missing a bodypart, as for what one i dont know. LOL
Peace.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
Top

Posted by Longbow   (102 posts)  Bio
Date Reply #19 on Thu 14 Apr 2005 12:53 AM (UTC)
Message
Ok, I've started working on my new code file. Would somebody explain to me the &, |, and -> commands?

Top

Posted by Robert Powell   Australia  (367 posts)  Bio
Date Reply #20 on Thu 14 Apr 2005 06:33 AM (UTC)
Message
Now i think i need some of this explained to me also, but i will have a crack, & has a number of uses, the most used one that i can think of is in this situation

if ( this && that ) which should mean if this and that is true.

The pipe | if ( this || that ) is if this or that is true.

-> now i dont realy know how to explain this, but has to do with referencing parts of structures(with pointers??, im not realy up on pointer theory.

CHAR_DATA *ch; declares a pointer ch that points to the CHAR_DATA structure in mud.h, so you can then reference part of the structure, ch->name, would give you the name element from the structure.

Im sure someone else could explain that way better than i have.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
Top

Posted by USER007   (124 posts)  Bio
Date Reply #21 on Thu 14 Apr 2005 09:56 PM (UTC)
Message
Heres a link that should prove useful later on.
http://immu.arthmoor.com/functions.htm
Top

Posted by Longbow   (102 posts)  Bio
Date Reply #22 on Thu 14 Apr 2005 11:23 PM (UTC)

Amended on Thu 14 Apr 2005 11:38 PM (UTC) by Longbow

Message
Ok, I've got a bit going now. Now how does one add a new obj_type? I want to add several new ones.

Also, I'm trying to change the various combat messages, such as "MOB scratches you" but I can't seem to find the right file to edit. Which would it be please?


Godbless,
Longbow

Top

Posted by Robert Powell   Australia  (367 posts)  Bio
Date Reply #23 on Fri 15 Apr 2005 01:53 AM (UTC)
Message
Grep for stuff you know, ITEM_SHOVEL and shovel, scratches you.

Make grep your friend and you will never be lost, well not very lost anyway, heh.

The reason for ITEM_SHOVEL and shovel, (it could be any item type you can think of) is because in some of the lists you need to add to it is ITEM_ and in others its just the name. Take a look you will see, after adding it in all the places you can find, if something doesnt work then post again, so you can be shown what you missed.

Peace.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
Top

Posted by Longbow   (102 posts)  Bio
Date Reply #24 on Sat 16 Apr 2005 07:36 PM (UTC)

Amended on Sat 16 Apr 2005 08:00 PM (UTC) by Longbow

Message
Ok, I put in a new skill that I got from some snippet place for "charge", and I followed all the steps exactly, but when I try to compile it gives me about a bazillion errors in mud.h saying stuff has been called before or something or other. It's about every line in mud.h I think that calls an error. What's up with that and how do I fix it?

Also, what do you do to an object to make it cookable?

And more critically, how do you set a player's Pkill flag on and off? I want to allow folks to kill each other right off the bat, none of this level 5 baloney. :)

Thanks and Godbless,
Longbow
Top

Posted by Robert Powell   Australia  (367 posts)  Bio
Date Reply #25 on Sat 16 Apr 2005 09:55 PM (UTC)
Message
Can you post a few lines of the errors your getting, that will help in working out whats going on.

For the pkill stuff, being pk PK is just means you have the PCFLAG_DEADLY flag set on them, if you want that set on everyone, the best place to set it would be in comm.c in the nanny function, just look for where the auto's(auto exits i think in stock) are set and put it there.

For cooking, look in skills.c in the function do_cook.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
Top

Posted by Longbow   (102 posts)  Bio
Date Reply #26 on Sat 16 Apr 2005 10:10 PM (UTC)
Message
K, I'll post some lines of that later, I don't have time now.

More critical at the moment is the fact that shopkeepers won't buy anything. I followed the guide on Herne's Smaug Page but we still can't get the shops to say anything other then, "Looks uninterested in the item". What could be wrong? We set the shop buy1, 2 and 3 values, and it is open.


Thanks,
Longbow
Top

Posted by Robert Powell   Australia  (367 posts)  Bio
Date Reply #27 on Sun 17 Apr 2005 05:05 AM (UTC)
Message
Does the object have any value, a cost, if the object is worth 0 then a shopkeep will not be interested in it.

if ( ( cost = get_cost( ch, keeper, obj, FALSE ) ) <= 0 )
    {
	act( AT_ACTION, "$n looks uninterested in $p.", keeper, obj, ch, TO_VICT );
	return;
    }

Like i have said a few times befor, most times you can work out whats going on, by grepping your source for either the error, or responce your being given. The code above is in shop.c.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
Top

Posted by Longbow   (102 posts)  Bio
Date Reply #28 on Wed 20 Apr 2005 11:52 PM (UTC)
Message
Ok, I'm not sure how to call a dice sequence to check for success. This would also apply to my fishing code, but at the moment it has to do with chopping wood. My current code is as follows:

void do_chop (CHAR_DATA *ch, char *argument)
{
if (ch->in_room->sector_type == SECT_FOREST)
{
if ( ( shovel = get_eq_char(ch, WEAR_HOLD) ) == NULL)
{
send_to_char( "You don't have an axe! \n\r", ch );
}
if (shovel->item_type ==ITEM_SHOVEL)
{
act(AT_ACTION, "$n chops at the trees with their axe.", NULL, NULL, TO_ROOM);

}
}
}

I'd appreciate help with the dice, and any comments on the code would be nice. Thanks for all the help! I feel I might actually be learning something from all this. :)

Godbless,
Longbow
Top

Posted by Longbow   (102 posts)  Bio
Date Reply #29 on Mon 02 May 2005 05:13 PM (UTC)
Message
Howdy folks, I'm back. Was on a trip for the last 10 days. Anybody have a comment on my code?
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.


222,513 views.

This is page 2, subject is 6 pages long:  [Previous page]  1  2 3  4  5  6  [Next page]

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.