Jump to content

Recommended Posts

Posted

Hi everyone!

Been a while since I had time to write any script... missed it.

 

I think there is lack of knowledge about ped task ids. Which ones do you know?

I'm talking about the task index parameter for this native function:

I know only that 399 = is ped hogtied. (Thanks to LMS)

 

Which ones do you know?

 

To be more specific, I'm looking (for a lot of time actually) for a way to find out whether the player holds up a ped with his lasso, and which ped it is.

I am not aware of any built-in way to do it, so I've implemented a workaround in one of my mods (TieYourLasso). But it is a bit flakey and could work much better.

 

Thanks! 

Posted

It will be much harder to gather the IDs in RDR2 unfortunately, as the tasks no longer have their RTTI names available. The way I did it so far was match them to natives or have a loop with all task IDs, printing out the active ones, and then guessing which one is which based on what the ped is doing. Also note that 399 is now 400, quoting myself from a conversation with @DoctorBones:

 

  Quote

what happened in the last update was that task 0x266 became task 0xF and hence all task IDs starting from 0xF have shifted up by one. Why the ID was changed and what the task does, I am not sure. It was also modified a bit.

 

The easiest way to get the numbers is to loop from 0 to 999 on a given ped and run GET_IS_TASK_ACTIVE. If you trial and error a bit you should be able to assign a specific ped assign to a task ID.

Expand  

 

This is what I have:

 

7 - CTaskPersistentCharacter

76 - CTaskSwapWeapon

152 - CTaskScriptMelee

154 - Ped being dragged down?

223 - Horse task, whether they are part of a wagon

341 - Ped being tackled on the ground

400 - Is hogtied

451 - CTaskCarriable

  • Like 1
Posted
  On 10/8/2020 at 6:55 PM, LMS said:

It will be much harder to gather the IDs in RDR2 unfortunately, as the tasks no longer have their RTTI names available. The way I did it so far was match them to natives or have a loop with all task IDs, printing out the active ones, and then guessing which one is which based on what the ped is doing. Also note that 399 is now 400, quoting myself from a conversation with @DoctorBones:

 

 

This is what I have:

 

7 - CTaskPersistentCharacter

76 - CTaskSwapWeapon

152 - CTaskScriptMelee

154 - Ped being dragged down?

223 - Horse task, whether they are part of a wagon

341 - Ped being tackled on the ground

400 - Is hogtied

451 - CTaskCarriable

Expand  

Thanks, this is a lot.

And I have to admit that I didn't think about this technique to find them out. Although it's still guessing.

Also, in one of my mods I'm using the is hogtied, and it is still working for me (after the last patch). Strange. 

Posted
  On 10/9/2020 at 3:39 PM, Shtivi said:

Thanks, this is a lot.

And I have to admit that I didn't think about this technique to find them out. Although it's still guessing.

Also, in one of my mods I'm using the is hogtied, and it is still working for me (after the last patch). Strange. 

Expand  

 

Perhaps what is now 399 is also related to being hogtied and hence it still works. I know for RDRFR I had to change the ID as it did not quite do what we needed anymore. If you guess a few, it'd be great if you could post them here. I am always looking for more.

Posted

399 is now having a PED lassoed but not hogtied.

  On 10/9/2020 at 5:12 PM, LMS said:

 

Perhaps what is now 399 is also related to being hogtied and hence it still works. I know for RDRFR I had to change the ID as it did not quite do what we needed anymore. If you guess a few, it'd be great if you could post them here. I am always looking for more.

Expand  

 

  • Like 1
Posted
  On 10/9/2020 at 5:12 PM, LMS said:

 

Perhaps what is now 399 is also related to being hogtied and hence it still works. I know for RDRFR I had to change the ID as it did not quite do what we needed anymore. If you guess a few, it'd be great if you could post them here. I am always looking for more.

Expand  

Don't worry, I will 🙂

 

  On 10/11/2020 at 6:07 AM, DoctorBones said:

399 is now having a PED lassoed but not hogtied.

 

Expand  

Cool, I'll check this one out.

  • 1 month later...
Posted

Do we know what the task for the arterial bleeding stumbling is? (I want to check if a ped is in this bleeding mode)

What does this mean: CTaskPersistentCharacter

 

Posted
  On 11/17/2020 at 12:57 PM, HughJanus said:

Do we know what the task for the arterial bleeding stumbling is? (I want to check if a ped is in this bleeding mode)

What does this mean: CTaskPersistentCharacter

 

Expand  

 

No idea, the list I posted above is all I have currently. Try the method I explained though to log tasks and see if you can narrow it down.

While I am not entirely sure what CTaskPersistentCharacter is, it seems to be used for "scenario/stationary" peds for the most part, such as the sheriff in town.

Posted (edited)
  On 11/18/2020 at 12:51 AM, LMS said:

 

No idea, the list I posted above is all I have currently. Try the method I explained though to log tasks and see if you can narrow it down.

While I am not entirely sure what CTaskPersistentCharacter is, it seems to be used for "scenario/stationary" peds for the most part, such as the sheriff in town.

Expand  

 

582 and 594 seem to be fleeing tasks.

When someone is drawing his weapon and fighting me, there are tasks in this order: 343, 355, 364 and 428 (I think the 428 is the fighting one, the others are for drawing guns or going into some stance, I suppose).

When NPCs are walking around and I shoot them, tasks I get are 47 and 320 (I guess 320 is the walking one and 47 is being hit or so?).

Have not found the bleeding one yet 😕

 

Edit: 603 seems to be writhing on the ground. 121 is in a chain of multiple tasks when someone is dying. 608 seems to be the last task in a chain when dying on the ground while writhing. When someone is burning, its 39 then 588.

 

I suppose bleeding out (at least some versions of them) is one of those: 56, 57, 243 (more tests necessary, though - cant say anything right now)

 

Here is the code for drawing the tasks on screen, in case anyone wants to try stuff (draws a list of tasks on the screen, the ped you are aiming at is doing):

char c[40];
std::string text = "NPC Task ID: ";
Player player = PLAYER::PLAYER_ID();
Ped playerPed = PLAYER::PLAYER_PED_ID();

strcpy(c, text.c_str());
DrawText(0.15, 0.15, c);

if (WEAPON::IS_PED_WEAPON_READY_TO_SHOOT(playerPed))
{
	Entity playerTarget;
	if (PLAYER::GET_ENTITY_PLAYER_IS_FREE_AIMING_AT(player, &playerTarget))
	{
		for (int g = 0; g < 999; g++)
		{
			if (g != 582 && g != 594 && AI::GET_IS_TASK_ACTIVE(playerTarget, g))
			{
				if (text.find("," + std::to_string(g) + ",") == string::npos)
				{
					if (text == "NPC Task ID: ") text += std::to_string(g);
					else text += "," + std::to_string(g);
					strcpy(c, text.c_str());
					DrawText(0.15, 0.15, c);
				}									
			}
		}
	}
}

 

 

Edit 2: Could it be that there is no task for the artery shot behavior? It seems to me that every time I think I have the right task id, it turns out not being it^^

Edited by HughJanus
Posted

It could be that the artery shot behavior is part of a "parent" task and has no individual task. Hence you cannot find it.

Posted
  On 11/21/2020 at 3:14 PM, LMS said:

It could be that the artery shot behavior is part of a "parent" task and has no individual task. Hence you cannot find it.

Expand  

 

Thats unfortunate :/

  • 1 year later...
Posted

Does anybody know the task id of the "hands up" task?

I figured its 532 out of some tests fitfondue did and recorded, but I am not sure.

Posted

I'm getting these tasks as active when they're idle compared to when I make them do the hand up task with TASK_HANDS_UP:

 

2021-11-27 15:48:42.==== player idle =====
2021-11-27 15:48:42. - 18
2021-11-27 15:48:42. - 21
2021-11-27 15:48:42. - 25
2021-11-27 15:48:42. - 48
2021-11-27 15:48:42. - 53
2021-11-27 15:48:42. - 320
2021-11-27 15:48:42. - 332
2021-11-27 15:48:42. - 335
2021-11-27 15:48:44.==== npc idle =====
2021-11-27 15:48:44. - 48
2021-11-27 15:48:44. - 53
2021-11-27 15:48:44. - 244
2021-11-27 15:48:44. - 266
2021-11-27 15:48:44. - 270
2021-11-27 15:48:44. - 291
2021-11-27 15:48:44. - 320
2021-11-27 15:48:44. - 335
2021-11-27 15:48:46.==== pl hands up =====
2021-11-27 15:48:46. - 0
2021-11-27 15:48:46. - 47
2021-11-27 15:48:46. - 320
2021-11-27 15:48:46. - 335
2021-11-27 15:48:47.==== npc hands up =====
2021-11-27 15:48:47. - 0
2021-11-27 15:48:47. - 47
2021-11-27 15:48:47. - 320
2021-11-27 15:48:47. - 335

 

So 0 or 47 maybe? Or maybe it's a different task when they do it "naturally" and not with TASK_HANDS_UP...

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...