FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visitView your postsView unanswered posts

Spawn cars or actors

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
WRP_Beater

New Member
New Member


Joined: 26 May 2020
Posts: 2

7 Bank Notes
Items

PostPosted: Fri Aug 14, 2020 10:41 am    Post subject: Spawn cars or actors Reply with quote

Is there a way to write a script that can spawns in a given human actor or car? I know I can create an empty model with model_create (but that's only a frame), or I can duplicate an existing actor. I would however like to spawn a car or actor that's not already present on the map, just like you can with MafiaCon.
Back to top
View user's profile Send private message
ASM.

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 10 Jan 2014
Posts: 327

677 Bank Notes
Items

PostPosted: Sat Aug 15, 2020 6:03 pm    Post subject: Spawn cars or actors Reply with quote

From what I know the game does not expose actor spawning via the script system, at least not directly. In the vanilla missions all required actors are typically already present in the mission file with some getting deactivated via init scripts in case they're only needed at a later point in mission. In some cases the designers didn't even bother with deactivation but simply put those actors in unreachable places and relocate them for 'activation'.

That being said you should be able to spawn actors indirectly via *.chg files. Depending on your use-case this could be a workable solution. Note however that the game only supports one active differences-file at a time; loading an additional *.chg file removes all actors from the previous one. You can patch this behavior via Mafia Patcher, though (option AllowMultipleDiffs).
Back to top
View user's profile Send private message
WRP_Beater

New Member
New Member


Joined: 26 May 2020
Posts: 2

7 Bank Notes
Items

PostPosted: Mon Aug 17, 2020 11:20 am    Post subject: Spawn cars or actors Reply with quote

Alright, this seems to work fine with some limitations. Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.012 | Queries: 18