Welcome to the Builder Academy

Question Group Tanks

More
06 Jun 2020 23:27 #8763 by cunning
Replied by cunning on topic Group Tanks
trying it, i know there was some bugs, as i was crashing it testing multiple ways of doing group tank <what ever value>.

I am also working to show the tank last in any group, and to make sure that the Group tank is always last in the following list.

Also need to change group leader if a person needs to leave the game without dissolving the group.

Lots of things to work out. I also have group spell that only happens when a certain class has a spell affect going. It only works when in the group and in the same room.

Brain was definitely scrambled today. looks like they are going to reduce the dosage now.

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

More
07 Jun 2020 11:37 #8765 by WhiskyTest
Replied by WhiskyTest on topic Group Tanks
Ok let me know the specifics of any bug you find and I'll see if I can squish them.

I tried reproducing 'group tank <random stuff>' crashes but wasn't able to.
I'm running on Cygwin on Windows 10.

Also when the leader dies or quits, the leader should get assigned to someone else. At least it does for me running the latest code.

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

More
07 Jun 2020 13:16 #8767 by cunning
Replied by cunning on topic Group Tanks
This is how i re-arranged things and a few new checks.
Code:
} else if (is_abbrev(buf, "tank")) { skip_spaces(&argument); if (!GROUP(ch) ) { send_to_char(ch, "But you are not part of a group.\r\n"); return; } else if (GROUP_LEADER(GROUP(ch)) != ch ) { send_to_char(ch, "Only the group's leader can designate the tank.\r\n"); return; } else if (!*argument) { send_to_char(ch, "You have to specify the group TANK!\r\n"); return; } else if (!(vict = get_char_vis(ch, argument, NULL, FIND_CHAR_ROOM))) { send_to_char(ch, "The tank role has been removed from your group.\r\n"); GROUP_TANK(GROUP(ch)) = NULL; return; } else if (!vict) { send_to_char(ch, "There is no one by that name in this room!.\r\n"); return; } else if (GROUP(vict) != GROUP(ch)) { act("$E$u is not a member of your group!", FALSE, ch, 0, vict, TO_CHAR); return; } send_to_group(vict, GROUP(ch), "%s has been designated as the tank.\r\n", GET_NAME(vict)); send_to_char(vict, "You are the designated tank!\r\n"); GROUP_TANK(GROUP(ch)) = vict; // set_tank_followers(ch);

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

More
08 Jun 2020 00:11 #8769 by cunning
Replied by cunning on topic Group Tanks
So far so good. i now have it set up so that the follower list auto sets the Tank to last in the follow list. I have watched all the aggressives hit the tank now. Now to get the group to show the Tank last in the group list.

I think I have a few more ideas in mind. I think this is a great collaboration to add to the group.

A few other updates in act.informative.c as well.
Code:
if (GROUP(i)) { if (GROUP(i) == GROUP(ch)) send_to_char(ch, "(%s%s%s) ", CBGRN(ch, C_NRM), GROUP_LEADER(GROUP(i)) == i ? "leader" : GROUP_TANK(GROUP(i)) ? "Tank" : "group", CCNRM(ch, C_NRM)); else send_to_char(ch, "(%s%s%s) ", CBRED(ch, C_NRM), GROUP_LEADER(GROUP(i)) == i ? "leader" : GROUP_TANK(GROUP(i)) ? "Tank" : "group", CCNRM(ch, C_NRM)); } if (IS_NPC(i) && i->player.long_descr && GET_POS(i) == GET_DEFAULT_POS(i)) {


act.other.c
Code:
void set_tank_followers(struct char_data *ch, struct char_data *victim) { struct follow_type *f; struct char_data *Tank, *TempMoveChar; for (f = ch->followers; f; f = f->next) Tank = f->follower; TempMoveChar = Tank; Tank = victim; if (ch->followers) { for (f = ch->followers; f; f = f->next) { if (f->follower == victim) { f->follower = 0; } } } if (ch->followers) { for (f = ch->followers; f; f = f->next) { if (f->follower == TempMoveChar) f->follower = victim; if (f->follower == 0) f->follower = TempMoveChar; } } if (ch->followers) { for (f = ch->followers; f; f = f->next) { if (f->follower != ch) { act ("$N has reordered the follow list.", FALSE, f->follower, 0, ch, TO_CHAR); do_group (f->follower, "", 0, 0); } } } act ("You reorder the follow list.", FALSE, ch, 0, ch, TO_CHAR); } } else if (is_abbrev(buf, "tank")) { skip_spaces(&argument); if (!GROUP(ch) ) { send_to_char(ch, "But you are not part of a group.\r\n"); return; } else if (GROUP_LEADER(GROUP(ch)) != ch ) { send_to_char(ch, "Only the group's leader can designate the tank.\r\n"); return; } else if (!*argument) { send_to_char(ch, "You have to specify the group TANK!\r\n"); return; } else if (!(vict = get_char_vis(ch, argument, NULL, FIND_CHAR_ROOM))) { send_to_char(ch, "The tank role has been removed from your group.\r\n"); GROUP_TANK(GROUP(ch)) = NULL; return; } else if (!vict) { send_to_char(ch, "There is no one by that name in this room!.\r\n"); return; } else if (GROUP(vict) != GROUP(ch)) { act("$E$u is not a member of your group!", FALSE, ch, 0, vict, TO_CHAR); return; } send_to_group(vict, GROUP(ch), "%s has been designated as the tank.\r\n", GET_NAME(vict)); send_to_char(vict, "You are the designated tank!\r\n"); GROUP_TANK(GROUP(ch)) = vict; set_tank_followers(ch, vict); } else if (is_abbrev(buf, "leave")) {

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

More
11 Jul 2020 03:15 #8807 by cunning
Replied by cunning on topic Group Tanks
Ive now added the ability to autogroup charmies, change leaders, and tanks in the follow list as well as group.

I did that so if the tank was the tank, aggressive's would hit the last in the follow order. Since my char_from_room makes sure the order stays the same as it enters a new room.

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

Time to create page: 0.185 seconds