Log in to reply
 

[C#/Coding] Ped Scenarios



  • I'm attempting to use ped scenarios (as opposed to just animations, for the sole purpose of not having to mess with attaching objects to entities) but I've come across a few issues.

    1. After the scenario has been used once, it won't play if it's triggered again during the same game session.

    2. I'm unable to get multiple peds use the same scenario simultaneously.

    I've looked at the natives surrounding scenarios and found a few that might imply you cannot run the same scenario on multiple peds simultaneously, "IS_SCENARIO_OCCUPIED" being one of those. I also found "RESET_SCENARIO_GROUPS_ENABLED" which makes me think I may have to somehow 'reset' the scenario after I'm done using it to be able to re-use it again.

    I'm not sure about any of this, I'm just throwing ideas out there. If anyone can provide some further insight, I would greatly appreciate it.

    Thanks.



  • @SpickitySpock there's a few ways of setting up scenarios.
    Have you tried SET_SCENAIRO_TYPE_ENABLED clear with RESET_SCENARIO_TYPES_ENABLED?
    Check first with IS_SCENARIO_TYPE_ENABLED

    I see you use groups. What of RESET_SCENARIO_GROUPS_ENABLED
    Maybe check first with
    IS_SCENARIO_GROUP_ENABLED .

    Hope that's helpful.
    Peace, N8Gamez



  • @N8Gamez Thank you for your reply. Below is the line of code that I'm using to start the scenario, which works fine for one ped (the first time) but not the others.

    NativeFunction.Natives.TASK_START_SCENARIO_IN_PLACE(pedTwo, "WORLD_HUMAN_SMOKING_POT", 1, true);

    Based on the documentation provided on NativeDB, I tried these as suggested:

    NativeFunction.Natives.SET_SCENARIO_TYPE_ENABLED("WORLD_HUMAN_SMOKING_POT", true);
    NativeFunction.Natives.RESET_SCENARIO_TYPES_ENABLED();

    However the outcome remains the same. No more than one ped can use the same scenario, and once the scenario has ended it cannot be used again in the same game session.



  • Well sorry 'bout that. No resetting huh.

    I'm deep in my Real Western mod so I haven't looked much into scenario yet. I'll take the advice, if I learn anything else I'll let you know.
    Peace.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.