Welcome to the Builder Academy

Question Item Durability

More
13 May 2013 17:17 #2240 by Papaya Pete
Item Durability was created by Papaya Pete
I'm going to be working on a new snippet that adds item durability, which to begin with will just be used by armor and weapons. As I'm looking through the code, to see what changes/additions I need to make, I'm realizing that object files are going to be changed, seeing as it'll be saving two new values.

I guess my only (minor) worry is having to do a complete object wipe. Has anyone else tried something like this, adding new values to an object to be saved? Curious to see if anyone else has ever been forced to do a full wipe after adding something.

Please Log in or Create an account to join the conversation.

More
13 May 2013 19:06 #2241 by DirtyDevil
Replied by DirtyDevil on topic Item Durability
Item durability was added to NewDawn mud that I worked on many years ago, it also had a fumble then meant that you could break a weapon when fighting my missing a hit. I have a version of the whole mud but am struggling to get it to compile to check what features were in the version I have. I have also sent an email to mono.org which is where the mud was once hosted in 1996

I have found an old webpage that still kicking about on the internet
community.fortunecity.ws/rivendell/dunge...newbie/newdawnh.html

I will wait for the reply from mono.org (a telnet bbs still running in a world of WWW)to see if they have the code lying around. If not I will upload what I have

Please Log in or Create an account to join the conversation.

More
13 May 2013 20:48 #2242 by Papaya Pete
Replied by Papaya Pete on topic Item Durability
Well I was looking over the code a little bit today, just to get an idea on what files to work on and such... and so far, it looks like I'll have to tinker with act.wizard.c to show durability (current and max) when statting an item... then there's making the additions to oedit.c so that you can set it in the first place. Structs.h under object data, fight.c is where damage to items (and removal upon breaking) would take place. act.item.c, to make sure that it isn't broken when you try to wield/wear an item (if it's broken, "Hey, this is broken, you can't use it!). Let's see... genobj.c is where item saving and loading takes place, need to do some work there as well. And in utils.h. That's what I've seen so far: it looks like it's going to be a lot of work but not impossible.

NewDawn, huh? I know of another mud that did item durabilities too... Eternal Visions, actually. Thing is, while the place is still up, hardly anyone ever goes on there, and last I heard the coder there is pretty strict about letting anyone look at the code. I'm not even sure if it would help much to take a look, seeing as EV used a circlemud base that's been highly modified.

Please Log in or Create an account to join the conversation.

More
15 May 2013 00:59 #2274 by Kewlb
Replied by Kewlb on topic Item Durability
I implemented item durability in my fallout game.

Since I was going to have to add some values to the obj file I went ahead and did one for material type and one for durability. The material affected the decay rate & ease of damage of an item. As a person fought they might take damage to certain body parts in which turn that armor might degrade. I had energy weapons degrade armor the most. I also made it so its overall effectiveness (statistics assigned to that object type) would slide up/down based on its condition. I then coded in the ability to repair items with like items.

If you get stuck or need pointers just let me know.

Please Log in or Create an account to join the conversation.

More
15 May 2013 04:52 #2279 by Papaya Pete
Replied by Papaya Pete on topic Item Durability
Ah after some work and looking it over with a friend, who helped me to see I was forgetting to make sure things were loading properly, I have the basics done. In oedit, one can set an item's max durability and current durability, with a 0 max meaning that the item is indestructible. With how I've coded it in thus far, it means going in by hand and making the small additions to each of the objects in the world files (basically adding " 0 0" after the four "vals" are stored) or just wiping and starting over.

I've been trying to write instructions out as I go along, so I don't feel so overwhelmed I just never get around to it. Hoping to get the actual wear and tear implemented sometime this week.

Please Log in or Create an account to join the conversation.

More
16 May 2013 02:06 #2302 by Kewlb
Replied by Kewlb on topic Item Durability
another method is to write your "save to disk" function for your objects first, compile, boot your game, oedit save each zone writing these new values, shut the game down. Now write in the code to read the new values.. no need to manually make modifications.

Please Log in or Create an account to join the conversation.

Time to create page: 0.223 seconds