hi guys, i'm working on a payday2 fun mod which i will share here when it's completed
and trying to spawn civilians / gangmembers
but everytime i do the game crashes,
spawning normal enemies works fine though.
The code for one of spawning functions is:
Code:
function spawn_crackwhore(position, rotation)
local unit_name = Idstring( "units/payday2/characters/civ_female_crackwhore_1/civ_female_crackwhore_1" )
local spawn_ai = { init_state = "idle" }
local unit = World:spawn_unit( unit_name, position, rotation )
unit:movement():set_character_anim_variables()
unit:brain():set_spawn_ai( spawn_ai )
unit:brain():set_active( true )
end
it will crash the game whenever it's spawned. the same happens with other civilians
as well as bikers / gangmembers.
I've looked at the game's sourcecode but can't find anything about spawning civilians or gangmembers
i think this is coded in the maps.
Anyway i was wondering if any of you guys had any luck with spawning civs / gangmembers
and could please share with me the proper way to do it.
the original code i used for spawning enemies had a line in it like:
unit:base().tazer_1 = true
after spawning, my guess is that there must be a base set in the code for civilians and gangmembers
or somehow they must be set to have a different brain, but i can't find what it is i've tried dozens of things without any luck.
and i was also wondering if anyone here knew how to send a text message on screen to all the players.
Code:
if managers.hud then
managers.hud:show_hint( { text = "text message" } )
end
this code will only show the onscreen text to me, the host but i want to display a text for all players to see.
any help would be appreciated
thanks