Hello, i am working on a car drag ragdoll mod that will catch and drag NPCs that are hit with the player vehicle. Essentially leveraging the existing code examples from the mission lua script for Red Asphalt (patch\bu04.lua):
CHAR_CARLOS = "bh04_$c001"
BERGEN = "bh04_$v000"
vehicle_drag_ragdoll_start(BERGEN, CHAR_CARLOS)
Unfortunately i have a problem with dynamically detecting pedestrians in proximity of the player. I need to understand how I can refer to npc characters based on their dynamic name in game as shown by the manually declared CHAR_CARLOS variable. Is there a complete list of these possible names somewhere?
I have already tried a workaround of referencing NPCs using character_exists(NAME) by checking all character names listed in the common/character.xtbl file.
This current attached version with just player jump ragdoll is based on IdolNinja's sandbox+.
I did try and leverage the callback for on_hit_ped based on m20.lua example from saints row 3:
on_hit_ped("m20_rc_car_hit_ped_cb", M20_vehicle.rc_car)
-- Callback for the RC car hitting a ped
--
-- vehicle: (string) name of the vehicle that hit a ped
--
function m20_rc_car_hit_ped_cb(vehicle, human)
on_hit_ped is listed under the section for lua functions in SR2 for similar functionality for SR3
"The following functions are described in Kinzie's Toy Box document
and do not seem to differ between Saints Row 2 and Saints Row: The
Third." - https://www.saintsrowmods.com/forum/threads/sr2-lua-functions-list-wip.17189/
I am curious if anyone has had some success with leveraging on_hit_ped in SR2 and/or point me in the direction for referencing random npc peds in proximity to the player.
I'll keep digging in the meantime and hopefully post the final version of my mod in the coming months.
CHAR_CARLOS = "bh04_$c001"
BERGEN = "bh04_$v000"
vehicle_drag_ragdoll_start(BERGEN, CHAR_CARLOS)
Unfortunately i have a problem with dynamically detecting pedestrians in proximity of the player. I need to understand how I can refer to npc characters based on their dynamic name in game as shown by the manually declared CHAR_CARLOS variable. Is there a complete list of these possible names somewhere?
I have already tried a workaround of referencing NPCs using character_exists(NAME) by checking all character names listed in the common/character.xtbl file.
This current attached version with just player jump ragdoll is based on IdolNinja's sandbox+.
I did try and leverage the callback for on_hit_ped based on m20.lua example from saints row 3:
on_hit_ped("m20_rc_car_hit_ped_cb", M20_vehicle.rc_car)
-- Callback for the RC car hitting a ped
--
-- vehicle: (string) name of the vehicle that hit a ped
--
function m20_rc_car_hit_ped_cb(vehicle, human)
on_hit_ped is listed under the section for lua functions in SR2 for similar functionality for SR3
"The following functions are described in Kinzie's Toy Box document
and do not seem to differ between Saints Row 2 and Saints Row: The
Third." - https://www.saintsrowmods.com/forum/threads/sr2-lua-functions-list-wip.17189/
I am curious if anyone has had some success with leveraging on_hit_ped in SR2 and/or point me in the direction for referencing random npc peds in proximity to the player.
I'll keep digging in the meantime and hopefully post the final version of my mod in the coming months.