Quantcast

Jump to content

» «
Photo

ScriptHookV.net TaskSequence Ordering

No replies to this topic
blo0oddrunk
  • blo0oddrunk

    Player Hater

  • New Members
  • Joined: 13 Oct 2017
  • Germany

#1

Posted 4 weeks ago

Hey Guys,

 

I just found out something about how TaskSequences work and thought you might be interested.

 

When you are using TaskSequences you have to be very careful about when you create which instance.

Always follow this order:

TaskSequence seq = new TaskSequence();


seq.AddTask....;
seq.AddTask....;
seq.AddTask....;

mPed.Task.PerformSequence(seq);


TaskSequence seq2 = new TaskSequence();

seq2.AddTask....;
seq2.AddTask....;
seq2.AddTask....;

mPed2.Task.PerformSequence(seq2);

The General rule is:

-> create an instance of TaskSequence

-> fill the sequence with different Tasks

-> call PerformSequence.

 

You can create another TaskSequence afterwards.

 

YOU CAN NOT:

create two or more instances of TaskSequence and fill them at the same time.

 

Any created Tastsequence MUST start performing before you can create a new one.

 

Not following the rule will cause TaskSequence.Handle = 0 which pretty much means not executable.

 

 

Thats what i found out after several hours of testing. In case you find anything wrong about this article or you find a Thread already mentioning this please Post below or Pm me





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users