Implemented TaskScript should execute one task per loop

Discussion in 'Client & Site Suggestions' started by Aidden, Oct 9, 2014.

  1. I think the TaskScript framework should only execute a single task each loop. Once it finds a valid task it should perform execute and then return the loop. What does everyone else think? An example being, right now my monk killer tries to loot, fails the interaction and then moves on to attacking the next monk and this happens quite often which is clearly not very human like.
     
  2. Support. I've had issues with this too. However I'll probably be demolished by someone more experienced.
     
  3. You can add a condition within your Task so that it only proceeds to attack another monk if the loot item on the ground is not valid or the length == 0.
     
  4. While this is true, its not a good thing in my opinion. The whole point of dividing things up into tasks is to make each task focus on one thing. We shouldn't have to check that other tasks shouldn't be executing.
     
  5. Technically you are not checking whether another task is executing, you are writing a condition for a particular task that will only execute when those particular conditions are true. The way i see the Task Framework is basically a series of executions where you (the scripter) create a set of rules for each particular task which do not correlate or clash with other tasks.
     
  6. I agree with OP. I can see multiple use cases in which the sequential order (or priority) of tasks is pivotal to its function and not returning to the top after an execution completely breaks it. @Cloud thoughts?
     
  7. It also currently goes against what you guys always say about each loop should only perform one action.
     
  8. Very true. Sounds like an oversight in the framework to me.
     
  9. Okay so here's how the framework will work in the next build. As most of you already know (or at least should), the task framework is built on a tree of tasks. This means that tasks can have children that are dependent on the parent tasks being validated.

    Initially only the top level tasks will be checked for validation. As soon as one is found to be valid, it will be executed. All other tasks that could be evaluated will then be ignored (one task per execution). After this the child tasks of the validated task will be evaluated. This cycle will continue recursively until there are no tasks remaining to be validated or none of the tasks are considered valid.

    In other words, TaskScript will attempt to follow a single branch of nodes out as far as possible, and as soon as it can't reach any further it will end the loop.
     
    Arbiter and Exia like this.
  10. I use this

    Code (Text):
    1.  
    2. for(Node node : nodeList) {
    3.     if(node.activate()){
    4.              node.execute();
    5.   }
    6.  
    7.  
    8. }
    9.  
    activate is a boolean.
    execute is a void.
     
  11. Although a simple implementation like that would work for some people, the current TaskScript is a more powerful framework. It's a flexible tree, not just a list of tasks.
     
    Qosmiof2 likes this.
  12. Sounds good :)
     

Share This Page

Loading...