Jump to content

How to clean up scenario props


SAC
 Share

Recommended Posts

 

_TASK_START_SCENARIO_IN_PLACE works fine at making peds start scenarios. However, some scenarios generate props (brooms, buckets etc) which get left behind when the ped finishes the scenario, eventually leading to prop clutter.

 

Question is, how to script the props / peds / scenarios whatever to clean up the props when the scenario ends?

 

TY

 

 

My Fallout 4 and Skyrim mods: SAC - LoversLab

 

Link to comment
Share on other sites

 

DM-ed the author of Rampage, because Rampage ends the scenarios gracefully, and got this guidance

 

void PlayScenarioFunc(std::string scenario)
{
Ped PlayerPed = PLAYER::PLAYER_PED_ID();
TASK::CLEAR_PED_TASKS_IMMEDIATELY(PlayerPed, false, false);
TASK::TASK_START_SCENARIO_IN_PLACE_HASH(PlayerPed, StringHash(std::move(scenario)), 0, true, 0, 0.0f, false);
}
 
To directly abort scenarios use TASK::CLEAR_PED_TASKS_IMMEDIATELY(PLAYER::PLAYER_PED_ID(), false, false);
 
To end the scenario normally use TASK::CLEAR_PED_TASKS(PLAYER::PLAYER_PED_ID(), true, true);

 

Haven't checked it yet, I am busy tracing a game crash (most likely something related to rope physics)

 

My Fallout 4 and Skyrim mods: SAC - LoversLab

 

Link to comment
Share on other sites

On 12/29/2021 at 5:53 AM, SAC said:

 

DM-ed the author of Rampage, because Rampage ends the scenarios gracefully, and got this guidance

 

void PlayScenarioFunc(std::string scenario)
{
Ped PlayerPed = PLAYER::PLAYER_PED_ID();
TASK::CLEAR_PED_TASKS_IMMEDIATELY(PlayerPed, false, false);
TASK::TASK_START_SCENARIO_IN_PLACE_HASH(PlayerPed, StringHash(std::move(scenario)), 0, true, 0, 0.0f, false);
}
 
To directly abort scenarios use TASK::CLEAR_PED_TASKS_IMMEDIATELY(PLAYER::PLAYER_PED_ID(), false, false);
 
To end the scenario normally use TASK::CLEAR_PED_TASKS(PLAYER::PLAYER_PED_ID(), true, true);

 

Haven't checked it yet, I am busy tracing a game crash (most likely something related to rope physics)

 

This is true for the task the npc is executing. I dont know if it will make spawned objects vanish, though.

Link to comment
Share on other sites

  • 1 month later...

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.

 Share

×
×
  • Create New...