Welcome to the Builder Academy

Loved New OLC Craft System

More
26 Jun 2012 04:46 #259 by Vatiken
Replied by Vatiken on topic Re: New OLC Craft System
No it should be an open bracket '{'. In your prior posting of that snippet of code you were missing the closing bracket.
Code:
if (real_obj(CRAFT_CRIT_VNUM(craft)) != NOTHING && rand > crit) { <--- LINE 549 remove_components(ch, craft, TRUE); obj_to_char(obj, ch); act(CRAFT_CRIT_MSG_SELF(craft), TRUE, ch, obj, 0, TO_CHAR); act(CRAFT_CRIT_MSG_ROOM(craft), TRUE, ch, obj, 0, TO_NOTVICT); <------------- MISSING
Code:
if (real_object(CRAFT_CRIT_OBJVNUM(craft)) != NOTHING && rand > crit) } <-------- Should be { remove_components(ch, craft, TRUE); obj_to_char(obj, ch); act(CRAFT_CRIT_MSG_SELF(craft), TRUE, ch, obj, 0, TO_CHAR); act(CRAFT_CRIT_MSG_ROOM(craft), TRUE, ch, obj, 0, TO_NOTVICT); }

tbaMUD developer/programmer

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

More
26 Jun 2012 04:55 - 26 Jun 2012 05:01 #260 by Halenbane
Replied by Halenbane on topic Re: New OLC Craft System
Got it down to 1.

crafts.c:555: error: expected identifier or '(' before 'else'

Code:
if (rand < crit) { if (real_object(CRAFT_CRIT_OBJVNUM(craft)) != NOTHING && rand < crit) {} remove_components(ch, craft, TRUE); obj_to_char(obj, ch); act(CRAFT_CRIT_MSG_SELF(craft), TRUE, ch, obj, 0, TO_CHAR); act(CRAFT_CRIT_MSG_ROOM(craft), TRUE, ch, obj, 0, TO_NOTVICT); } } else { <-----555 if (skill > rand) { if ((obj = read_object(CRAFT_OBJVNUM(craft), VIRTUAL)) == NULL) { send_to_char(ch, "You seem to have an issue with your crafting.\r\n"); mudlog(CMP, LVL_GOD, TRUE, "SYSERR: Event Craft called without created object."); return (0); }

if I make it an open ended bracket here --> if (real_object(CRAFT_CRIT_OBJVNUM(craft)) != NOTHING && rand < crit) {

it spits out more than just the 1,
crafts.c: In function 'event_craft':
crafts.c:640: error: invalid storage class for function 'copy_requirement'
crafts.c:645: error: invalid storage class for function 'copy_craft'
crafts.c:696: error: invalid storage class for function 'craftedit_setup_new'
crafts.c:795: error: invalid storage class for function 'craftedit_disp_skill_menu'
crafts.c:812: error: invalid storage class for function 'craftedit_disp_req_flags'
crafts.c:830: error: invalid storage class for function 'craftedit_disp_craft_flags'
crafts.c:848: error: invalid storage class for function 'craftedit_requirement_menu'
crafts.c:870: error: invalid storage class for function 'craftedit_disp_menu'
crafts.c:1233: error: expected declaration or statement at end of input


otherise It only gives me the 1 error


Sorry I know I'm probably being a pain, but I will overlook a bracket or ; or a declaration when it's right in front of my face
Last edit: 26 Jun 2012 05:01 by Halenbane.

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

More
26 Jun 2012 15:46 #264 by Vatiken
Replied by Vatiken on topic Re: New OLC Craft System
Code:
if (real_object(CRAFT_CRIT_OBJVNUM(craft)) != NOTHING && rand < crit) {} <----- Just '{', not '{}' remove_components(ch, craft, TRUE); obj_to_char(obj, ch); act(CRAFT_CRIT_MSG_SELF(craft), TRUE, ch, obj, 0, TO_CHAR); act(CRAFT_CRIT_MSG_ROOM(craft), TRUE, ch, obj, 0, TO_NOTVICT); } } else { <-----555

tbaMUD developer/programmer

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

More
26 Jun 2012 16:28 - 26 Jun 2012 16:29 #265 by Halenbane
Replied by Halenbane on topic Re: New OLC Craft System
Yeah, I had actually tried what you showed above already, as I stated above.,

crafts.c: In function 'event_craft':
crafts.c:640: error: invalid storage class for function 'copy_requirement'
crafts.c:645: error: invalid storage class for function 'copy_craft'
crafts.c:696: error: invalid storage class for function 'craftedit_setup_new'
crafts.c:795: error: invalid storage class for function 'craftedit_disp_skill_me nu'
crafts.c:812: error: invalid storage class for function 'craftedit_disp_req_flag s'
crafts.c:830: error: invalid storage class for function 'craftedit_disp_craft_fl ags'
crafts.c:848: error: invalid storage class for function 'craftedit_requirement_m enu'
crafts.c:870: error: invalid storage class for function 'craftedit_disp_menu'
crafts.c:1233: error: expected declaration or statement at end of input
Code:
/* Activate the Event */ NEW_EVENT(eCRAFT, ch, strdup(CRAFT_NAME(craft)), CRAFT_TIMER(craft) * PASSES_PER_SEC); act("You begin getting prepared to craft.", TRUE, ch, 0, 0, TO_CHAR); act("$n begins getting prepared to craft.", TRUE, ch, 0, 0, TO_NOTVICT); } /*********************************************************************** CRAFT EDITOR **********************************************************************/ static void copy_requirement(struct requirement_data * to, struct requirement_data * from) { <------640 *to = *from; } static void copy_craft(struct craft_data * to, struct craft_data * from) { struct requirement_data *from_req, *to_req; struct list_data *tmp_list; struct iterator_data Iterator; if (from == NULL) return; tmp_list = to->requirements; *to = *from; if (to->requirements != tmp_list) to->requirements = tmp_list; if (CRAFT_NAME(from)) to->craft_name = strdup(CRAFT_NAME(from)); if (CRAFT_MSG_SELF(from)) to->craft_msg_self = strdup(CRAFT_MSG_SELF(from));
Last edit: 26 Jun 2012 16:29 by Halenbane.

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

More
26 Jun 2012 18:31 #272 by Halenbane
Replied by Halenbane on topic Re: New OLC Craft System
Ok Fixed the ones from before, was missing a curly way on down the line.

Now I'm just trying to initialize obj correctly..

if (rand < crit) {
if (real_object(CRAFT_CRIT_OBJVNUM(craft)) != NOTHING && rand > crit) {
remove_components(ch, craft, TRUE);
obj_to_char(obj, ch); <
550
act(CRAFT_CRIT_MSG_SELF(craft), TRUE, ch, obj, 0, TO_CHAR);
act(CRAFT_CRIT_MSG_ROOM(craft), TRUE, ch, obj, 0, TO_NOTVICT);
}

} else {


crafts.c:550: warning: 'obj' is used uninitialized in this function

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

More
26 Jun 2012 20:28 #278 by Vatiken
Replied by Vatiken on topic Re: New OLC Craft System
Only seeing a handful of lines it's hard to tell what you've done in this function, but my guess would be "'obj' is used uninitialized in this function"...

Did you initialize it?

tbaMUD developer/programmer

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

Time to create page: 0.233 seconds