Mafia Scene - Mafia I & II Game Fan Site

Modders Corner => Mafia Editing => Mafia II mods => Topic started by: zzzzzz2 on August 13, 2012, 04:08:11 AM

Title: Some problem in setting Franceska as bodyguard
Post by: zzzzzz2 on August 13, 2012, 04:08:11 AM
Here is my way:




First run this script:







<pre class="ipsCode">game.sds:ActivateStreamMapLine("buhviprocSkyChange")

game.gfx:SetWeatherTemplate("DT11part03")

game.game:GetActivePlayer():SetPos(Math:newVector(-1385.9,1483.4,-6.1))

</pre>








And then:







<pre class="ipsCode">game.sds:ActivateStreamMapLine("buhviprocSkyChange")

game.gfx:SetWeatherTemplate("DT11part03")

Ses=game.entitywrapper:GetEntityByName("FranceskaSestra")

Ses:SetPos(Math:newVector(-1379.9,1487.4,-6.1))

Ses:Activate()

Ses:InventoryAddWeapon(11,250)

Ses:SetAggressivity(enums.AI_Aggressivity.HearGunshot)

Ses:SetCarAttackPermission(true)

Ses.invulnerability=true

game.navigation:RegisterHumanEntity("FranceskaSestra")

game.navigation:RegisterIconEntity("FranceskaSestra",0,10,"0062020006",true)

Ses:Follow(game.game:GetActivePlayer(), "RUN", 2, 4)

</pre>






 




Here is the effect:(//applications/core/interface/imageproxy/imageproxy.php?img=size=320%2520x%2520240&key=688b85af5a5b67990842f5221b5475c49a509a2168948374615cfde87b721c30)http://farm9.staticflickr.com/8430/7770914186_74b7648184_b.jpg (http://farm9.staticflickr.com/8430/7770914186_74b7648184_b.jpg)[/img]


 




Franceska will only appear near the Eric's place if you use my way,why?




I think we can let Franceska appear near player (just like calling Joe and Henry) at anytime.




Does somebody else has any better idea?
Title: Some problem in setting Franceska as bodyguard
Post by: zzzzzz2 on August 13, 2012, 04:36:50 AM
BTW,how to set other characters as bodyguard,like Mike,Marty,Eric,Steve,etc
Title: Some problem in setting Franceska as bodyguard
Post by: Samo on August 13, 2012, 06:39:12 AM
I dont mod mafia 2




but i think that model of char is responsible by this line


 




Ses=game.entitywrapper:GetEntityByName("FranceskaSestra")


 




but you will also have to change it here


 




game.navigation:RegisterHumanEntity("FranceskaSestra")




game.navigation:RegisterIconEntity("FranceskaSestra",0,10,"0062020006",true)


 


 




And why does it appear there?Because the coordinates of the char are set there


 




Ses:SetPos(Math:newVector(-1379.9,1487.4,-6.1))
Title: Some problem in setting Franceska as bodyguard
Post by: zzzzzz2 on August 13, 2012, 01:50:38 PM
Thanks,I tried to edit the Location,but it didn't work,and even crash my game <img src="/emoticons/huh.png.04e12a04934075c5a1e0c618a726c4d9.png" alt=" :huh: " data-emoticon="">


 




And can we let Franceska appear near player (just like calling Joe and Henry)?
Title: Some problem in setting Franceska as bodyguard
Post by: zahar999 on August 14, 2012, 03:18:43 PM
QuoteHere is my way:...



your way it completely copied my script "Freeride Mafia II recollection"


 




http://www.youtube.com/watch?v=SqRjES03b-8 (http://www.youtube.com/watch?v=SqRjES03b-8)


 




using the injector




you can perform anywhere in the city(summer)







QuoteDelayBuffer:Insert(function(l_1_0)CommandBuffer:Insert(l_6_0,{

function(l_1_0)game.game:SoundFadeOut(50)return game.hud:FaderFadeOut(50)end,




function(l_2_0)return game.sds:ActivateStreamMapLine("buhviprocSkyChange")end,




function(l_3_0)game.gfx:SetWeatherTemplate("DT11part03")




Ses=game.entitywrapper:GetEntityByName("FranceskaSestra")Ses:Activate()




Ses:SetPos(Math:newVector(0,0,0))Ses:InventoryAddWeapon(11,250)




Ses:SetAggressivity(enums.AI_Aggressivity.HearGunshot)




Ses:SetCarAttackPermission(true)Ses.invulnerability=true




game.navigation:RegisterHumanEntity("FranceskaSestra")




game.navigation:RegisterIconEntity("FranceskaSestra",0,10,"0062020006",true)




Ses:Follow(game.game:GetActivePlayer(),"RUN",2,4)game.traffic:OpenSeason(140)end,




function(l_4_0)game.game:SoundFadeIn(50)return game.hud:FaderFadeIn(50)end})end,{l_1_0},100,1,false)







Title: Some problem in setting Franceska as bodyguard
Post by: zzzzzz2 on August 16, 2012, 11:20:58 AM
Thank you very much for helping,I am not familiar with the lua script so I copy from your Freeride-main.sds
Title: Some problem in setting Franceska as bodyguard
Post by: zahar999 on August 16, 2012, 06:44:21 PM
Steve,Marty and Joe


 




http://www.youtube.com/watch?v=Cl4gx2QgA5Y (http://www.youtube.com/watch?v=Cl4gx2QgA5Y)


 




using the injector




you can perform anywhere in the city(summer)







QuoteDelayBuffer:Insert(function(l_1_0)CommandBuffer:Insert(l_6_0,{

function(l_1_0)game.game:SoundFadeOut(50)return game.hud:FaderFadeOut(50)end,




function(l_2_0)return game.sds:ActivateStreamMapLine("bar_destruct")end,




function(l_3_0)game.gfx:SetWeatherTemplate("DT08part03crazyhorse")




Joe=game.entitywrapper:GetEntityByName("Joe")Joe:SetPos(Math:newVector(0,0,0))




Joe:Activate()Joe:SetAggressivity(enums.AI_Aggressivity.HearGunshot)




Joe:InventoryAddWeapon(11,250)Joe:SetCarAttackPermission(true)Joe.invulnerability=true




Joe:Follow(game.game:GetActivePlayer(),"RUN",2,4)game.speech:LoadScriptDistrict("joe")




game.navigation:RegisterHumanEntity("Joe")game.navigation:RegisterIconEntity("Joe",0,10,"0062020002",true)




Steve=game.entitywrapper:GetEntityByName("Steve")Steve:SetPos(Math:newVector(0,0,0))




Steve:Activate()Steve:SetAggressivity(enums.AI_Aggressivity.HearGunshot)




Steve:InventoryAddWeapon(13,120)Steve:SetCarAttackPermission(true)Steve.invulnerability=true




Steve:Follow(game.game:GetActivePlayer(),"RUN",2,4)game.speech:LoadDistrictVarious("stevefoundry")




game.navigation:RegisterHumanEntity("Steve")game.navigation:RegisterIconEntity("Steve",0,10,"0062040008",true)




Marty=game.entitywrapper:GetEntityByName("Marty")Marty:SetPos(Math:newVector(0,0,0))




Marty:Activate()Marty:SetAggressivity(enums.AI_Aggressivity.HearGunshot)




Marty:InventoryAddWeapon(12,120)Marty:SetCarAttackPermission(true)Marty.invulnerability=true




Marty:Follow(game.game:GetActivePlayer(),"RUN",2,4)game.speech:LoadScriptDistrict("marty")




game.navigation:RegisterHumanEntity("Marty")game.navigation:RegisterIconEntity("Marty",0,10,"0062020008",true)end,




function(l_4_0)game.traffic:OpenSeason(140)return game.speech:LoadScriptDistrict("marty")end,




function(l_5_0)game.game:SoundFadeIn(50)return game.hud:FaderFadeIn(50)end})end,{l_1_0},100,1,false)







Title: Some problem in setting Franceska as bodyguard
Post by: zzzzzz2 on August 17, 2012, 04:46:39 AM
QuoteSteve' date='Marty[/b'] and <strong>Joe</strong> 




http://www.youtube.com/watch?v=Cl4gx2QgA5Y (http://www.youtube.com/watch?v=Cl4gx2QgA5Y)


 




using the injector





.............






You are so kind,it's very nice,thank you!  
<img src="/wp-content/uploads/invision_emoticons/smile.png" alt="(//smile.gif)" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/smile@2x.png 2x" width="20" height="20">