Welcome to the Builder Academy

Loved New OLC Craft System

More
26 Jun 2012 00:10 #247 by Halenbane
Replied by Halenbane on topic Re: New OLC Craft System
Yes that makes sense, the problem is , if you get it do the crit roll, and the item doesn't have a crit item defined, then it should automatically revert to the original item.

I'm just having trouble writing that part.

Some items will have critical results, say a regular short sword on crit becomes a very fine short sword. Which are both defined in craftedit menu's, but if they crit roll, and the craft doesn't have a crit item set, I need it to just move on and give them the normal item. As if the crit roll never happened.

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

More
26 Jun 2012 00:15 #248 by Halenbane
Replied by Halenbane on topic Re: New OLC Craft System
Also having trouble defining it correctly.. (its been a long day)
Code:
struct craft_data { int craft_id; char * craft_name; int craft_flags; obj_vnum craft_object_vnum; obj_vnum craft_crit_object_vnum; int craft_timer; char * craft_msg_self; char * craft_msg_room; char * craft_crit_msg_self; char * craft_crit_msg_room; ------------------------------- #define CRAFT_ID(craft) (craft->craft_id) #define CRAFT_NAME(craft) (craft->craft_name ? craft->craft_name : "<No Name>") #define CRAFT_FLAGS(craft) (craft->craft_flags) #define CRAFT_OBJVNUM(craft) (craft->craft_object_vnum) #define CRAFT_CRIT_OBJVNUM(craft) (craft->craft_crit_obj_vnum) #define CRAFT_TIMER(craft) (craft->craft_timer) #define CRAFT_SKILL(craft) (craft->craft_skill) #define CRAFT_SKILL_LEVEL(craft) (craft->craft_skill_level) -------------- send_to_char(ch, "Item: %-14s Print Id: %d\r\n", CRAFT_NAME(craft), CRAFT_ID(craft)); rnum = real_object(CRAFT_OBJVNUM(craft)); cnum = real_object(CRAFT_CRIT_OBJVNUM(craft)); send_to_char(ch, "These prints display in detail the how-to of creating %s.\r\n", rnum == NOTHING ? "Nothing" : obj_proto[rnum].short_description); send_to_char(ch, "Judging by the difficulty, you estimate that will take about %d seconds.\r\n", CRAFT_TIMER(craft)); send_to_char(ch, "There is a rare chance to make %s.\r\n", cnum == NOTHING ? "Nothing" : obj_proto[cnum].short_description); send_to_char(ch, "Gazing at the requirements list, you envision what you need:\r\n"); while ((req = (struct requirement_data *) simple_list(craft->requirements)) != NULL) {

crafts.c:179: error: 'struct craft_data' has no member named 'craft_crit_obj_vnum'
crafts.c: In function 'save_crafts_to_disk':
crafts.c:213: error: 'struct craft_data' has no member named 'craft_crit_obj_vnum'
crafts.c: In function 'show_craft':
crafts.c:479: error: 'struct craft_data' has no member named 'craft_crit_obj_vnum'
crafts.c:496: error: 'cnum' undeclared (first use in this function)
crafts.c:496: error: (Each undeclared identifier is reported only once
crafts.c:496: error: for each function it appears in.)
crafts.c:496: error: 'struct craft_data' has no member named 'craft_crit_obj_vnum'
crafts.c: In function 'craftedit_disp_menu':
crafts.c:894: error: 'struct craft_data' has no member named 'craft_crit_obj_vnum'
crafts.c:900: warning: operation on 'vnum' may be undefined

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

More
26 Jun 2012 00:20 #249 by Liko
Replied by Liko on topic Re: New OLC Craft System
make something like

IF(!crititem)
load nrmitem

something like that :)

Randian(0.0.0)
Owner/Developer

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

More
26 Jun 2012 02:34 #250 by Halenbane
Replied by Halenbane on topic Re: New OLC Craft System
Well I did some reworking and got all of my errors to disappear, so now time to see if I can finish it :P

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

More
26 Jun 2012 02:37 #251 by Vatiken
Replied by Vatiken on topic Re: New OLC Craft System
This would be the way I'd go about doing this.
Code:
if (success) { /* Success */ if (real_obj(CRAFT_CRIT_VNUM(craft)) != NOTHING && crit_is_successful) { /* Does our crit item exist? If so, did we get a crit? */ /* Critical Success */ } else { /* Normal Success */ } } else { /* Failure */ }
Though technically that would be a lie...
What I would do, and what I was planning to do, would be to create a special trigger for crafted objects. This way, a trigger could be run on the successful creation of a craft. Then the builder could use oset to alter the stats/strings of the same object without the need for an extra vnum.
Code:
An example would be: Craft Sword --> Create Sword named 'a sword' --> Run Craft Trigger --> Skill Roll on Player's Sword Craft --> Give the Sword a +1 to Damage if skill successful --> Change the Sword's name to 'a sharpened sword'

tbaMUD developer/programmer

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

More
26 Jun 2012 02:43 - 26 Jun 2012 02:44 #252 by Halenbane
Replied by Halenbane on topic Re: New OLC Craft System
I haven't yet put in the condition to check for crit item or regular item, i have it compiling clean right now before i do that part (which is what you refer'd to above)

When I set a crit item in craftedit , and then look at the blueprint, it says

You have a rare chance of making : nothing
I'd say it has to do with the code below. I don't think I'm allowed to use rnum twice like I have, what would I use in it's place for the Crit item
Code:
} else { send_to_char(ch, "Item: %-14s Print Id: %d\r\n", CRAFT_NAME(craft), CRAFT_ID(craft)); rnum = real_object(CRAFT_OBJVNUM(craft)); rnum = real_object(CRAFT_CRIT_OBJVNUM(craft)); send_to_char(ch, "These prints display in detail the how-to of creating %s.\r\n", rnum == NOTHING ? "Nothing" : obj_proto[rnum].short_description); send_to_char(ch, "Judging by the difficulty, you estimate that will take about %d seconds.\r\n", CRAFT_TIMER(craft)); send_to_char(ch, "There is a rare chance to make %s.\r\n", rnum == NOTHING ? "Nothing" : obj_proto[rnum].short_description); send_to_char(ch, "Gazing at the requirements list, you envision what you need:\r\n"); while ((req = (struct requirement_data *) simple_list(craft->requirements)) != NULL) { if ((rnum = real_object(req->req_vnum)) == NOWHERE) send_to_char(ch, "Req: NO OBJECT! "); else send_to_char(ch, " %d, %s %s.\r\n", req->req_amount, obj_proto[rnum].short_description, IS_SET(req->req_flags, REQ_FLAG_IN_ROOM) ? "in the room" : "in your possession"); } } }
Last edit: 26 Jun 2012 02:44 by Halenbane.

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

Time to create page: 0.228 seconds