Log in to reply
 

Trying to customize peds that spawn within archetype extensions



  • Hey guys! Currently using code walker to try to modify the peds that exist within a specific mlo interior, but unfortunately, I'm not seeing anything next to the actual area where the ped is supposed to spawn.

    The archetype extension currently lies within the .ytyp file, but no where in the extensions section does it mention anything about model name...

    Am I missing something?



  • I hate to bring you out of nowhere @a63nt-5m1th, but would you happen to know anything about interior-ped-archetype-model-modification?



  • @Wetter42
    Not edited many MLO's myself, & none to do with peds, but I would presume peds would be controlled by a scenario the same as they are for exteriors. The 'CBaseArchetypeDef/CMloArchetypeDef/CEntityDef' etc in '.ytyp' are just for the props & building parts etc.

    Switch CW dropdown to 'Mode: Scenario' & see what shows up etc, you should be able to edit what peds appear that way.

    Example:

    Edit Scenario Peds

    If not, let me know specifically what MLO/building you are editing & I'll take a closer look at it in CW.



  • Hey bud!

    Sadly, they didn't seem attached with the scenario, but instead with the prop related to the ytyp.

    One specific example seems to be the waiting section in fort zancudo waiting room. Take a look at ct_chair02 by viewing the entity first.

    Then change the view to the archetype extension and you'll notice a box within a box.

    I don't think there's a way to add it to codewalker yet, but you can take that xml entry <extension> (and everything below it) and actually copy it to pretty much any interior element.

    You can even add flags for the pedbehavior under the <flags /> category...you'll have to swap it out with actual flags found here.

    Anyways, the challenge is that even though they are spawning as peds on my ytyp entities, the model doesn't seem changable...I've tried quite a few things such as changing the pedtype to different models, and even adding entries, but I don't seem to be getting any progress sadly...



  • @Wetter42 What is it you are trying to do? Change the ped that is spawning at a specific prop? I do know that sometimes a specific ped will need to have info added in I think it's in the peds.meta that will allow it to spawn in on/at a prop. For example, in my garage mlo, i was having a difficult time getting the specific receptionist to be the only ped to spawn at the desk. I needed to add something about her ped being able to sit in the meta.

    I hope I'm telling you the correct location, it's been awhile since I've played or modded gta5. You might want to go to the codewalker discord and ask there. There is a member, i can't remember his name, that helped me get it done. He was doing a lot of stuff with peds a few years ago so knew alot of info.



  • @Wetter42 i just quickly looked at my discord and found the old conversation i had to get it to work. The member that helped me is Modifiver&Son ... and it was the ambientpedmodelset.meta i had to edit.



  • @chonkie said in [Help] Trying to customize peds that spawn within archetype extensions:

    What is it you are trying to do? Change the ped that is spawning at a specific prop?

    Exactly! Because I added peds to another chair nearby, but I can't seem to get them to spawn as anything but the s_m_m_marine_01 model which is appropriate for the area, but not the right model I'm trying to leverage...

    This peds.meta file...where can I find the metadata relating to spawning locations? (I ask this as I myself is searching..)



  • @chonkie
    Ahh! Gotcha! I'll take a look at that!

    Thanks buddy! <3



  • @chonkie hmm - interestingly enough, I don't really see much relating to the location of particular objects within ambientpedmodelsets.meta

    https://imgur.com/a/rHhNtvq

    This is about the extent of the file...
    I'll check the peds.meta, but did you see the actual object, (like the name of the meta?)



  • @Wetter42 Here are some pics from that conversation showing what i had to do to get it to work. Last pic is the area in the ambientpedmodelset.meta that i had to remove the specific ped from the can't sit down list.
    alt text

    alt text

    alt text



  • Oh
    M
    F
    G
    MAN!

    PEDTYPES AND GROUPS ARE FROM AMBIENTMODELSETS.META?!?!?!?
    I DIDN'T KNOW THAT!!!!!!!!!!!!

    You're a phenominal human being! <3
    Let me try this!



  • @Wetter42 In that first pic above, ignore the ambientpedmodelset.meta that is open next to the ytyp, that one didn't contain all the info to get the ped to spawn with the clothing and stuff in it yet, that stuff is in the second pic. The first pic i added to show you how i added the ped to my custom receptionist chair in the ytyp.



  • Watching this very interesting thread from the sidelines, eating popcorn, and smh at the convoluted garbage R* has put together.
    I sadly can't add to this conversation other than some experience I've had trying to change something that wouldn't change until I discovered one or multiple redundancies that took precedence over what I was changing. They sure don't make anything obvious and ofc the dlc and dlc patches make it even more challenging.



  • That was it!

    Although...they spawned in completely different from the specified pedname, but I'll play with it...(must be something with the group)....

    Anyways, thank you so much for the help...
    Now for the cherry on top...
    are there any known flags to make the peds invincible / fearless that you'd know of?

    If not, it's all good man!

    Thanks! <3



  • @Wetter42 Sorry, don't know of any flags to make them invincible or fearless. Although there are some chairs near the receptionist desk in my mlo and the peds that spawn there will talk sh!t if you talk to them and then they freak out if you point a gun/shoot at them. The receptionist doesn't care one bit about what's going on and just keeps doing her job.



  • Hahaa that's rockstar for yah! But this is what makes it rewarding! We got a team of a million people with a million experiences who can help each other! I don't know shite about specific meta files, but I'm an absolute UNIT when it comes to handling files, and am getting good with blender as well and may be able to help new players get started!

    It's really a beautiful thing! <3



  • @chonkie Interesting!

    So it sounds like the behavior is built into the ped itself!
    Interesting!
    Nevertheless, I have found the following flags doing some deep deep internet research.

    Here are some archetype extension flags:

    • IgnoreMaxInRange
    • NoSpawn
    • StationaryReactions
    • OnlySpawnInSameInterior
    • SpawnedPedIsArrestable
    • ActivateVehicleSiren
    • AggressiveVehicleDriving
    • LandVehicleOnArrival
    • IgnoreThreatsIfLosNotClear
    • EventsInRadiusTriggerDisputes
    • AerialVehiclePoint
    • TerritorialScenario
    • EndScenarioIfPlayerWithinRadius
    • EventsInRadiusTriggerThreatResponse
    • TaxiPlaneOnGround
    • FlyOffToOblivion
    • InWater
    • AllowInvestigation
    • OpenDoor
    • PreciseUseTime
    • NoRespawnUntilStreamedOut
    • NoVehicleSpawnMaxDistance
    • ExtendedRange
    • ShortRange
    • HighPriority
    • IgnoreLoitering
    • UseSearchlight
    • ResetNoCollisionOnCleanUp
    • CheckCrossedArrivalPlane
    • UseVehicleFrontForArrival
    • IgnoreWeatherRestrictions

    Pulled from:
    https://github.com/dexyfex/CodeWalker/blob/master/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs



  • @chonkie
    So for this post, where you have <flags />, you can replace this with any of the flags I've mentioned above (like nospawn) or stationaryresponses.

    This allows the ped to stay in their seat when scared...

    Nospawn disables the ped (for some reason) (not sure why this'd be useful if you're specifying an archetype extension, but whatever)...



  • @Wetter42 said in [Help] Trying to customize peds that spawn within archetype extensions:

    are there any known flags to make the peds invincible / fearless that you'd know of?

    I don't know if this helps, but there might not be an invincible flag, but rather a few specific ones? I don't know the meta files well enough to conclude this, but rather it's from how Menyoo handles it. (Can't find anything in meta files other than health value which don't think goes beyond 200).

    Rather than use one variable, it seems (and I could be wrong) that Menyoo sets a few parameters:

    void SetProofs(bool bulletProof, bool fireProof, bool explosionProof, bool collisionProof, bool meleeProof, bool unk1, bool unk2, bool drownProof);

    void SET_ENTITY_PROOFS(Entity entity, BOOL bulletProof, BOOL fireProof, BOOL explosionProof, BOOL collisionProof, BOOL meleeProof, BOOL steamProof, BOOL p7, BOOL waterProof) // 0xFAEE099C6F890BB8 0x7E9EAB66 b323

    void set_ped_invincible_on(Ped ped)
    {
    	SET_ENTITY_INVINCIBLE(ped, 1);
    	SET_PED_DIES_IN_WATER(ped, 0);
    	SET_ENTITY_PROOFS(ped, 1, 0, 1, 1, 1, 1, 1, 1);
    }
    


  • Ah, yes!

    That's a good idea! I should probably get the nearby peds and script out the remaining behavior!

    Absolutely lovely @JohnFromGWN!

    Thanks! <3



  • @Wetter42
    Frustrating that we can't find the metadata, but if you're going to script it's all good.

    CurrentPed.IsInvincible = true;



  • eeh, we'll give it time! I'm always willing to play the long con and wait for more people to continue reverse engineering V!

    Maybe oneday we'll get more sourcodeleaks!

    Till then, cheers @JohnFromGWN, @chonkie, and @a63nt-5m1th! I appreciate you guys! :D



  • @Wetter42 said in [Help] Trying to customize peds that spawn within archetype extensions:

    wait for more people to continue reverse engineering

    The lack of documentation really sucks and has from day one. Modding would reach incredible levels, or would have, if we had solid documentation instead of tidbits spread out all over a few forums and some github sites.

    The fact that the native function exists, from decompiled scripts, confirms that the mystery was solved by those who did the decompiling.

    Just would love to know where those variables can be found - all those "proofs". Given we can't easily search binary or encrypted files, it's a real time killer.



  • Yeah...it really does suck...I got so desparate that I found a site that dumped a machines memory within codewalker to find some additional flags!

    https://www.hybrid-analysis.com/sample/4756045215669b51524de98c65f9e65dfb09ac2051c454b3f7a9d46e322d68b5?environmentId=120



  • @Wetter42
    In regard to your general area of current ped/seating research, probably worth taking a look in 'scenarios.meta at some point, if you haven't already:

    ...\Grand Theft Auto V\mods\update\update.rpf\common\data\ai\scenarios.meta

    That's where 'PROP_HUMAN_SEAT_CHAIR' & other such archetype extension '<spawnType>'s are located.

    In the 'PROP_HUMAN_SEAT_CHAIR' 'CScenarioPlayAnimsInfo' you'll find lines to control what peds/ped groups can spawn & what restrictions/conditions/reactions the seat places on peds that spawn on it (like making it so that only females/males from a given ped group can spawn there, or what direction they move in when threatened etc). Also, there are '<Flags>' lines that you may want to have a look at too.

    Example:

        <Item type="CScenarioPlayAnimsInfo">
          <Name>PROP_HUMAN_SEAT_CHAIR</Name>
          <PropName />
          <Models ref="NULL" /> <!-- you can enter 'CAmbientModelSet's from 'ambientpedmodelsets.meta' here -->
          <BlockedModels ref="CANT_SIT_DOWN" /> <!-- if enter '<BlockedModels ref="NULL" />' here, likely remove 'CANT_SIT_DOWN' ped restriction -->
          <SpawnProbability value="1.000000" />
          <SpawnInterval value="0" />
          <SpawnHistoryRange value="50.000000" />
          <MaxNoInRange value="0" />
          <PropEndOfLifeTimeoutMS value="60000" />
          <Range value="0.000000" />
          <SpawnPropIntroDict />
          <SpawnPropIntroAnim />
          <StationaryReactHash>CODE_HUMAN_COWER</StationaryReactHash> <!-- maybe worth investigating/test removing etc -->
          <SpawnPropOffset x="0.000000" y="0.000000" z="0.000000" />
          <SpawnPropRotation x="0.000000" y="0.000000" z="0.000000" w="0.000000" />
          <TimeTilPedLeaves value="-1.000000" />
          <ChanceOfRunningTowards value="0.000000" />
          <Flags>AllowConversations AttachPed DontActivateRagdollForCollisionWithPlayerBumpImpact DontSpawnInRain DontTimeoutUntilIdleFinishes IgnoreLowShockingEvents NavmeshBlocking NoBulkyItems NoMeleeTakedowns PreferMeleeRagdoll SeatedScenario ValidateExitsWithProbeChecks</Flags>
          <Condition type="CScenarioConditionRaining">
            <Result>False</Result>
          </Condition>
    	  ...
    

    Note:
    That's just the top section of the 'PROP_HUMAN_SEAT_CHAIR' entry. It has much more to it than just that (over 2500 lines in total, mostly conditions).

    Maybe setting this:

                      <Item type="CScenarioConditionAmbientEventDirection">
                        <Result>True</Result>
                        <Direction x="0.000000" y="0.000000" z="0.000000" /> <!-- all zero etc -->
                        <Threshold value="0.707000" />
                        <FlattenZ value="true" />
                      </Item>
    

    might stop running away (if that's an issue. No vanilla entries have xyz all set to zero anyway). Might just make direction random tho, only testing would answer.

    The 'CODE_HUMAN_COWER' in the '<StationaryReactHash>' is also located further down in 'scenarios.meta' & probably also worth looking at, given it at least somewhat relates to the peds reaction to a threat etc.

    Lots of other interesting stuff in 'scenarios.meta' as well, well worth a look :thumbsup:

    Some Additional Threat/Flee etc Info:

    taskdata.meta
    Has flags like 'DisableCower' (Note: 'cower', not cover), 'DisableHandsUp', 'DisablePotentialBlastResponse' & 'DisableReactAndFleeAnimation' (don't think 'DisableReactAndFleeAnimation' will stop runnng away, just disable flailing arm animation or something most likely. Is set on animals in vanilla, they still flee etc)

    peds.ymt:

          <TargetingThreatModifier value="0.00000000"/>
    

    Used only by birds in vanilla file (presume they don't flee when aimed at etc, but never checked). All other peds set to 1.000000 anyway.

    pedpersonality.ymt:
    Has different bravery types that can be utilised in the '<PedPersonalities>' section of the same file. Say, if you ever want peds to fight back rather than flee or be less cowardly when shocking events happen etc.

    Example:

      <BraveryTypes>
        <Item>
          <Name>default</Name>
          <Flags>BF_GET_PISSED_WHEN_HIT_BY_CAR BF_PLAY_CAR_HORN BF_PURSUE_WHEN_HIT_BY_CAR BF_COWARDLY_FOR_SHOCKING_EVENTS BF_BOOST_BRAVERY_IN_GROUP BF_CAN_ACCELERATE_IN_CAR BF_ALLOW_CONFRONT_FOR_TERRITORY_REACTIONS</Flags>
          <TakedownProbability value="0.900000" />
          <ThreatResponseUnarmed>
            <Action>
              <Weights>
                <Fight value="0.300000" />
                <Flee value="0.700000" />
              </Weights>
            </Action>
            <Fight>
              <Weights>
                <KeepWeapon value="0.000000" />
                <MatchTargetWeapon value="0.500000" />
                <EquipBestWeapon value="0.500000" />
              </Weights>
              <ProbabilityDrawWeaponWhenLosing value="0.500000" />
            </Fight>
          </ThreatResponseUnarmed>
          <ThreatResponseMelee>
            <Action>
              <Weights>
                <Fight value="0.150000" />
                <Flee value="0.850000" />
              </Weights>
            </Action>
            <Fight>
              <Weights>
                <KeepWeapon value="0.000000" />
                <MatchTargetWeapon value="0.500000" />
                <EquipBestWeapon value="0.500000" />
              </Weights>
              <ProbabilityDrawWeaponWhenLosing value="0.500000" />
            </Fight>
          </ThreatResponseMelee>
          <ThreatResponseArmed>
            <Action>
              <Weights>
                <Fight value="0.000000" />
                <Flee value="1.000000" />
              </Weights>
            </Action>
            <Fight>
              <Weights>
                <KeepWeapon value="0.000000" />
                <MatchTargetWeapon value="0.500000" />
                <EquipBestWeapon value="0.500000" />
              </Weights>
              <ProbabilityDrawWeaponWhenLosing value="0.500000" />
            </Fight>
          </ThreatResponseArmed>
          <FleeDuringCombat>
            <Enabled value="false" />
            <ChancesWhenBuddyKilledWithScaryWeapon value="0.000000" />
          </FleeDuringCombat>
        </Item>
    

    There are plenty more files with threat/response/flee/react etc in them too. If you don't already use it, the best way to find stuff is with a binary search in CodeWalker ('[Tools...]' button > 'Binary search...') & search for any related keywords you can think of, & take a look in the files etc :thumbsup:


Log in to reply
 

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