EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::General Support (https://www.eqemulator.org/forums/forumdisplay.php?f=598)
-   -   Group Tasks (https://www.eqemulator.org/forums/showthread.php?t=38070)

Esildor 04-17-2014 09:09 PM

Group Tasks
 
Hola!

Preface: Wasn't sure where to post this, so, when with a general area!

Making some tasks for group missions, so, when I'm assigning these tasks via NPC I'm using the string:

Code:

plugin::AssignTask("group",275,($npc->GetID()));
This gets the task assigned to everyone in the group I'm in that's in the zone when I request it.

What I'm wondering is am I able to somehow make the task updates universally for the group? I have some explores that have to be individually explored(which isn't a big deal. Although, right now I'm trying to put a collect portion in that is updated for the entire group when a group member loots the item. Currently when I loot the item it only updates the task for the person who looted it.

Is there a way to do this?

In addition, is there anyway to have the task be assigned to everyone in the group regardless of if they're in the same zone or not? Tried putting qglobal to 1 and that didn't do it.

Thanks

Kayen 04-17-2014 09:23 PM

If you want to update all group members at once.

You need to basically get all the clients in the zone with the same groupid and update their tasks WHEN the primary person completing the task gets their update.

Cross zone updates and assignments are even more tricky which can be done with custom database tables and cross zone signalling code or other methods using qglobals.

The amount of code needed to accomplish either is beyond the scope of this post.

Akkadius has some tools for this he will be releasing shortly though.

Esildor 04-17-2014 09:27 PM

Quote:

Originally Posted by Kayen (Post 229649)
If you want to update all group members at once.

You need to basically get all the clients in the zone with the same groupid and update their tasks WHEN the primary person completing the task gets their update.

Cross zone updates and assignments are even more tricky which can be done with custom database tables and cross zone signalling code or other methods using qglobals.

The amount of code needed to accomplish either is beyond the scope of this post.

Akkadius has some tools for this he will be releasing shortly though.

Same group ID?

Is it safe to assume that everyone in the same group will have the same group ID?(Probably a silly question, but, haven't dealt with this yet)

If so, would I then do a player.pl file or something and when a task activity is updated have it grab like Getnpc->groupid(or something) and update everyone with that group ID?

Kayen 04-17-2014 10:12 PM

This is one method, there are other methods.

Code:

$Group_ID = $client->GetGroup()->GetID();
               
my @clientlist = $entity_list->GetClientList();
       
foreach $cur (@clientlist)
{
        if ($cur)
        {
              if ($Group_ID)
                        {
                                if ($cur->GetGroup())
                                {
                                        $Client_GroupID = $cur->GetGroup()->GetID();
                                      {
                                        Shout("We are in the same group");
                                        }
                                }
}}}}


Esildor 04-17-2014 10:16 PM

Quote:

Originally Posted by Kayen (Post 229652)
This is one method, there are other methods.

Code:

$Group_ID = $client->GetGroup()->GetID();
               
my @clientlist = $entity_list->GetClientList();
       
foreach $cur (@clientlist)
{
        if ($cur)
        {
              if ($Group_ID)
                        {
                                if ($cur->GetGroup())
                                {
                                        $Client_GroupID = $cur->GetGroup()->GetID();
                                      {
                                        Shout("We are in the same group");
                                        }
                                }
}}}}


Thanks abunch, I'm going to play a bit of Smite with my bud for an hour or so then play with this and see if I can get it to work. I've got some ideas for how I'll do it, and, this will definitely help.

demonstar55 04-17-2014 10:32 PM

Live has shared tasks for this, do we have these working (I don't know that code well enough...)

Esildor 04-17-2014 10:41 PM

Quote:

Originally Posted by demonstar55 (Post 229654)
Live has shared tasks for this, do we have these working (I don't know that code well enough...)

I haven't seen anything anywhere about shared tasks, so, I'm assuming not and it's done through assigning a task to an entire group right now(?)

Kayen 04-17-2014 10:44 PM

Live shared tasks are not implemented in emu.

Esildor 04-18-2014 02:10 AM

Been playing with this for a bit and still haven't been able to get anything to work.

I don't understand enough of what's going on in what you posted previously Kayen in order to work in what I'm trying to get done.

I've tried this, and I know it's specific to this ID, I was just trying to see if I could get it to work. Also, yes, 4001 was the GroupID assigned to the group my guys were in while testing it.

Code:

sub EVENT_LOOT {
  if ($Group_ID == 4001) {
    if($looted_id == 132611) {
      quest::updatetaskactivity(275,7,1);
      }
    }
}

I found elsewhere the if ($Group_ID == #) so I assume that is valid? If so, how come this won't work? I have confirmed that this works:

Code:

sub EVENT_LOOT {
  if($looted_id == 132611) {
    quest::updatetaskactivity(275,7,1);
    }
 }

I took a complete shot in the dark on this:

Code:

my $GroupID = $client->GetGroup();

sub EVENT_LOOT {
  if ($looted_id == 132611) {
    if ($GroupID == ()) {
      quest::updatetaskactivity(275,7,1);
      }
    }
}

Lastly on a whim I tried using signals. I used:

Code:

##In the player.pl

sub EVENT_LOOT {
  if ($looted_id == 132611) {
    quest::signalwith(4280015,200,0);
    }
}

##In a Controller.pl

sub EVENT_SIGNAL {
  if ($signal == 200) {
    quest::updatetaskactivity(275,7,1);
    }
}

I really don't see why the last option didn't work with signals, it's a shitty way to do it but in theory should work .. right?

Any help is appreciated. Or, if someone could help break down the snippet of code that Kayen posted, if I understood it better I could probably get it to work for what I want.

Kayen 04-18-2014 02:58 AM

I was missing an if statement in the code I initially posted.
Code:

//Define the variable '$Group_ID'  by getting the client's (ie person getting the primary task update) actual group ID. THIS is your groups ID.
$Group_ID = $client->GetGroup()->GetID();

//This pulls all clients in the zone and puts it into an array.               
my @clientlist = $entity_list->GetClientList();

//Now go through the array and ONLY select other clients IN your group.       
foreach $cur (@clientlist)
{
      //Make sure client exists
        if ($cur)
        {
              //Make sure you got a group ID
              if ($Group_ID)
                        {
                              //Check if this client is in a group
                                if ($cur->GetGroup())
                                {
                                       
                                        $Client_GroupID = $cur->GetGroup()->GetID();
 //Now if the primary group ID (as first defined) is the same as THIS clients group id, you are in the same group. Now do whatever.
                                      if (Client_GroupID == $Group_ID)
                                      {
                                        Shout("We are in the same group");
                                        cur->UpdateTaskActivity(275,7,1); // example
                                        }
                                }
}}}}

The reason your signal code won't work is because your signaling an NPC it looks like and having it do the task update on that it. You need to have the task updates on the client, so it needs to be in player.pl IF your not directly interacting with the npc like hailing it ect. In other words the NPC has to know who it is updating some how and just a signal does not provide that alone.

Akkadius 04-18-2014 03:22 AM

Quote:

Originally Posted by Esildor (Post 229665)
Been playing with this for a bit and still haven't been able to get anything to work.

I don't understand enough of what's going on in what you posted previously Kayen in order to work in what I'm trying to get done.

I've tried this, and I know it's specific to this ID, I was just trying to see if I could get it to work. Also, yes, 4001 was the GroupID assigned to the group my guys were in while testing it.

Code:

sub EVENT_LOOT {
  if ($Group_ID == 4001) {
    if($looted_id == 132611) {
      quest::updatetaskactivity(275,7,1);
      }
    }
}

I found elsewhere the if ($Group_ID == #) so I assume that is valid? If so, how come this won't work? I have confirmed that this works:

Code:

sub EVENT_LOOT {
  if($looted_id == 132611) {
    quest::updatetaskactivity(275,7,1);
    }
 }

I took a complete shot in the dark on this:

Code:

my $GroupID = $client->GetGroup();

sub EVENT_LOOT {
  if ($looted_id == 132611) {
    if ($GroupID == ()) {
      quest::updatetaskactivity(275,7,1);
      }
    }
}

Lastly on a whim I tried using signals. I used:

Code:

##In the player.pl

sub EVENT_LOOT {
  if ($looted_id == 132611) {
    quest::signalwith(4280015,200,0);
    }
}

##In a Controller.pl

sub EVENT_SIGNAL {
  if ($signal == 200) {
    quest::updatetaskactivity(275,7,1);
    }
}

I really don't see why the last option didn't work with signals, it's a shitty way to do it but in theory should work .. right?

Any help is appreciated. Or, if someone could help break down the snippet of code that Kayen posted, if I understood it better I could probably get it to work for what I want.

I'd honestly wait, I'm working on posting my Expedition/Shared tasks this weekend.

Esildor 04-18-2014 04:51 AM

Sounds good Akka, wasn't sure on your time frame with that. I'll work on just getting my group mission layout set up with signals etc and worry about putting a task over top of it once I see your exp system.

I appreciate the heads up.

Akkadius 04-18-2014 04:59 AM

Quote:

Originally Posted by Esildor (Post 229673)
Sounds good Akka, wasn't sure on your time frame with that. I'll work on just getting my group mission layout set up with signals etc and worry about putting a task over top of it once I see your exp system.

I appreciate the heads up.

If you're feeling eager, I have it all posted here:

http://wiki.eqemulator.org/p?The_Exp...(Perl_Version)

I plan on detailing it out more here when I wake up

moofta 04-18-2014 09:11 AM

Quote:

Originally Posted by Kayen (Post 229657)
Live shared tasks are not implemented in emu.

Yet ;)

Of course it's one of many things yet to implement...

Esildor 04-18-2014 04:00 PM

Quote:

Originally Posted by Akkadius (Post 229674)
If you're feeling eager, I have it all posted here:

http://wiki.eqemulator.org/p?The_Exp...(Perl_Version)

I plan on detailing it out more here when I wake up

This looks awesome Akkadius, I can't wait to test it when I get the time later tonight or tomorrow. Great work!


All times are GMT -4. The time now is 10:27 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.