EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Task System (preliminary work) (https://www.eqemulator.org/forums/showthread.php?t=25894)

Derision 10-03-2008 01:47 PM

Quote:

Originally Posted by joligario (Post 157608)
I installed Titanium and did loadskin default old. Other than that I haven't changed it...

This is on TGC ? I don't have a character high enough level to get the task there, unless Cavedude wants to level up character Derisiondwarf, account Derision to level 12 so I can go and test it on there :) . Assuming it's not a client issue, I can put some additional debug commands in to try and isolate the cause.

Derision 10-03-2008 01:57 PM

Cavedude put it to me that the 'Stepped' column in the Tasks table is redundant. The reason it is there is to allow a sequential task to be created (where one activity must be completed before the next is unlocked) without the need to fill in the step field in the activity table.

I am proposing a change to do away with the 'Stepped' column:

Code:

Index: zone/tasks.cpp
===================================================================
--- zone/tasks.cpp      (revision 34)
+++ zone/tasks.cpp      (working copy)
@@ -204,7 +204,7 @@
                        Tasks[TaskID]->RewardMethod = (TaskMethodType)atoi(row[8]);
                        Tasks[TaskID]->StartZone = atoi(row[9]);
                        Tasks[TaskID]->ActivityCount = 0;
-                      Tasks[TaskID]->SequenceMode = (SequenceType)atoi(row[10]);
+                      Tasks[TaskID]->SequenceMode = ActivitiesSequential;
                        Tasks[TaskID]->LastStep = 0;

                        _log(TASKS__GLOBALLOAD,"TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s",
@@ -246,6 +246,10 @@
                                continue;
                        }
                        Tasks[TaskID]->Activity[Tasks[TaskID]->ActivityCount].StepNumber = Step;
+
+                      if(Step != 0)
+                              Tasks[TaskID]->SequenceMode = ActivitiesStepped;
+
                        if(Step >Tasks[TaskID]->LastStep) Tasks[TaskID]->LastStep = Step;

                        // Task Activities MUST be numbered sequentially from 0. If not, log an error

Required SQL:

Code:

ALTER TABLE `tasks` DROP `stepped` ;
The way this will work is if the step column for each activity is zero, then the task will be sequential (one activity must be completed before the next is unlocked), i.e. it will behave as if the stepped column in the task table was set to 0.

If there is a non-zero step number for any activity belonging to this task, then it will behave as if the stepped column was set to 1 (i.e. multiple activities can be being worked on at once).

I've tested this, just didn't want to commit it without posting about it first.

cavedude 10-03-2008 02:38 PM

I say commit it, the task system is your baby, nobody knows it better than you!

Derision 10-03-2008 03:37 PM

Quote:

Originally Posted by Derision (Post 157610)
This is on TGC ? I don't have a character high enough level to get the task there, unless Cavedude wants to level up character Derisiondwarf, account Derision to level 12 so I can go and test it on there :) . Assuming it's not a client issue, I can put some additional debug commands in to try and isolate the cause.

I have tried this on TGC now (thanks Cavedude) and am seeing the same thing Joligario is seeing with truncated text, so it is definitely not client related. I'll do some more investigation.

Derision 10-03-2008 04:18 PM

Quote:

Originally Posted by cavedude (Post 157618)
I say commit it, the task system is your baby, nobody knows it better than you!

I've committed this, along with a couple of changes to help try to diagnose the problem reported by Joligario (I changed #task show to output the Task Description, and also lowererd the required status to use the #task command (down to 150 from 250), since I currently couldn't use it on TGC :) )

Derision 10-04-2008 05:12 AM

Quote:

Originally Posted by joligario (Post 157474)
Next suggestion:

Alter the task table to have minlevel and maxlevel fields
Create a bool function for CheckTaskLevel()
Create perl quest function quest::istaskappropriate(taskid)

With those, we could let the system do the level checks for us. Not really a big deal, but just might be handy.

I've just committed this. There are new minlevel and maxlevel columns in the task table. If either is zero, it is ignored, so you can have no level restriction, only a minimum level, or only a maximum level, or both.

The level restrictions are enforced in the TaskSelector (a Task won't be sent if it doesn't meet the restrictions).

To augment this, I have slightly altered the way Task Sets work. Previously you had to enable/disable tasks in a set on a per player basis.

Now, if you put a TaskID of zero in a Task Set (which is an invalid TaskID), all the tasks in that set will automatically be available for a player, subject to a level restrictions.

This means you can create a task set for an NPC with a bunch of tasks with different level ranges and just call quest::tasksetselector(set number), and let the task system decide which tasks to offer the client based on the level restrictions.

I have also added quest::istaskappropriate(taskid) if you want to have an NPC tailor what it says to a player based on that.

joligario 10-05-2008 06:05 AM

Table Alter?
 
Just checking what new table is going to look like. Am I correct in assuming the following alter?

Code:

ALTER TABLE tasks ADD (minlevel int(3) not null default 0, maxlevel int(3) not null default 0);

Derision 10-05-2008 06:16 AM

I made them unsigned TINYINT on the assumption that level will never go past 255.

Required SQL:
ALTER TABLE `tasks` ADD `minlevel` TINYINT UNSIGNED NOT NULL DEFAULT '0',
ADD `maxlevel` TINYINT UNSIGNED NOT NULL DEFAULT '0';

Derision 10-05-2008 03:33 PM

I should have also mentioned that the Task Selector now checks to see if the player has any of the tasks it is being asked to offer already active and won't display them. If none of the tasks the Selector is asked to offer meet the required level range, or the client already has all those that do as active tasks, then the Selector window won't display.

This means that you don't need to check for tasks the client already has in your Perl quest, unless you want the NPC to say something in those circumstances.

ChaosSlayer 10-08-2008 12:46 AM

question: does reward has to be a specific item/items OR can system be set up to choose and give a random item from a list?

also: can system handle an ongoing bounty? Like Gnoll Fang quest - which tecnicly NEVEr ends - you keep bringing in gnol fangs- you keep geting reward- there is no set/max number of fang to bring

trevius 10-08-2008 01:06 AM

I imagine you could set that part up with a hash in a quest for when the task is completed. I wouldn't mind if there was a way to set rewards based on class, but I am pretty sure that can all be done with quests as well. I am going to make one really soon and will report if there are any issues. But, the system is already pretty complicated as it is lol. No reason to complicate it any further if the rest can be done with quests.

ChaosSlayer 10-08-2008 01:22 AM

well I am not complaning- I am simply poundering if it worth the effort for me to move from standart perl quests to tasks =)

At the end the only thing you are getting are:
-progress tracking window
-ability to track mobs killed count
-ability to automaticly turn in LARGE number of quest items over any give time frame (otherwise you can only give NPC 4 items at a time OT set up a global variable to count your turn ins)

prety much everything else I am allready doing with standart quests.

Yeah the friendly user interface is nice, specialy for players - but CODING IT into DB going to be a pain for ME =)

KLS 10-08-2008 06:25 AM

It'll prolly be considerably faster to make a task than a quest after people develop decent tools to help it along. It's a little imposing when you have to do all the SQL yourself I noticed. I started to work on a tool incidentally, but who knows if I'll ever get around to finishing it.

trevius 10-08-2008 06:52 AM

Ya, I do think a tool would make a HUGE difference. But I also think that practice would make tasks go quicker as well. I know I didn't write quests as quickly and easily when I first started as I do now.

And yes, everything that can be done with the task system can be done with quests. But, having the option for variety is great! And being able to easily track progress of multi-stepped quests is awesome! I already made a task for my starter zone for new players. For people not used to the EQ Quest system, I think tasks could help them get used to it quicker.

steve 10-08-2008 10:47 AM

Does the task system currently allow you to choose between multiple rewards? On Live, I've encountered a task that had as many as 3 choices. Each showed as their own tab in the reward window, and each tab listed a combination of these: Faction, Experience, Quest Item Reward, and plat. You then were able to pick which option suited you at the moment.


All times are GMT -4. The time now is 08:08 AM.

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