Welcome to the Builder Academy

Question Changing dependency in Zedit

More
14 Dec 2016 23:02 #6402 by Halenbane
I asked a similar question but in a different section of the forums. I wanted to ask again but try to be more clear with my question. What would be the most efficient way to have the Zedit_if_flag to ask for which command it should be dependent on instead of the previous one.

Right now it asks, "Should this be dependent on the previous one."
Of course now you simply answer yes or no.

I would prefer it rather ask you about the dependency but then allow you to choose which command it is dependent on instead of only the previous one.

Should this be dependent? If Yes , WHICH current command. So if the mob an obj load is dependent on is #2 in that zedit, you would enter 2.

A bit of the code that is related..

case ZEDIT_COMMAND_TYPE:
/* Parse the input for which type of command this is, and goto next quiz. */
OLC_CMD(d).command = toupper(*arg);
if (!OLC_CMD(d).command || (strchr("MOPEDGRTV", OLC_CMD(d).command) == NULL)) {
write_to_output(d, "Invalid choice, try again : ");
} else {
if (OLC_VAL(d)) { /* If there was a previous command. */
if (OLC_CMD(d).command == 'T' || OLC_CMD(d).command == 'V') {
OLC_CMD(d).if_flag = 1;
zedit_disp_arg1(d);
} else {
write_to_output(d, "Is this command dependent on the success of the previous one? (y/n)\r\n");
OLC_MODE(d) = ZEDIT_IF_FLAG;
}
} else { /* 'if-flag' not appropriate. */
OLC_CMD(d).if_flag = 0;
zedit_disp_arg1(d);
}
}
break;



Thanks in advance!

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

More
15 Dec 2016 22:12 - 15 Dec 2016 22:13 #6403 by thomas
Replied by thomas on topic Changing dependency in Zedit
This a Good Question (tm).

It is possible to make the system do what you want, but not as easy as just mucking a bit about in zedit.c.

First off - the commands are stored per zone. This means you need to do some counting to check that the dependencies make sense. And if a line is removed, you'll need to check that the target line isn't altered. The list is maintained for the zone, but adjusted per room - which will make this slightly interesting.

Next, you'll need to do take care of the dependency in the zone reset structures. This means saving and loading another variable for each zone. Or repurposing the if_flag variable.

And finally (?) you'll need to alter the zone loading code to track which zone commands loaded anything. Particularly, in reset_zone() ( github.com/tbamud/tbamud/blob/2f12752373...9f8a4/src/db.c#L2557 ) you'll need to change the way the if_flag is used.

As you can imagine, this is quite a lot of work, and most certainly too much to try to write as browser code. That's probably the reason noone has answered you in the other thread.
Last edit: 15 Dec 2016 22:13 by thomas.

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

More
16 Dec 2016 04:35 #6406 by Halenbane
I see. Thanks for the response Thomas :)

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

More
16 Dec 2016 04:37 #6407 by Halenbane
The biggest reason I was interested in this is because right now with my % loads, I can't really set multiple items at different %'s on one mob, since if a previous dependency doesn't happen, IE: Item 1 at 10% doesn't load, then item 3 at 90% doesn't even get the chance to run the rand 1,100

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

More
16 Dec 2016 04:39 #6408 by Halenbane
I want to clarify - This is more of an issue if you actually don't have the mob on a 100% load. I know most of this can be done with scripts but since I had % loads in and working for the most part I was trying to take it a bit further.

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

More
16 Dec 2016 21:58 #6409 by thomas
Replied by thomas on topic Changing dependency in Zedit
Oh, don't think I don't know WHY you want it ;)
The following user(s) said Thank You: Halenbane

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

Time to create page: 0.185 seconds