Reply To: MAFIA II – melee weapons
Home / Forums / Modders Corner / Mafia Editing / Mafia Mod Request / MAFIA II – melee weapons / Reply To: MAFIA II – melee weapons
Hi there again, fellow mobsters.
zahar999: ??? ????. ??? ??? ??? ??? ??.
For everyone: Work continues on reverse engineering of the Actor file. Actor file is closely related with FrameNameTable and with those funky buffer and vertex files. Now just figure out how all this is related and we can give it a try.
In the meantime, we can play with a nice workaround. We already know that Vito can perform melee animation sets via LUA command SetAnimStyle. But with no weapon in hand, right? Well today I rediscovered (post-mortem credits to S0beit and MafiaEmpire.com) one quite useful LUA command: ModelToHands. It does exactly how it sounds – it adds chosen weapon model to each hand. Rest of the description in the spoiler.
So for example if you want to use baseball bat in close combat without breaking any other gameplay mechanic, do this:
[ol]
[*]Modify melee animsets file in ingame.sds, add melee weapons animstyles under “melee” branch. My apologies, at time of writing this post I am away from modding PC, so no closer info. For example give the name “BatStyle” to the Baseball bat animation set (set 37).
[*]In LUA file (freeride), add a function which is for example called each time Vito is attacked. Place two crucial commands inside this function:
[ul]
[*]game.game:GetActivePlayer():SetAnimStyle(“melee”,”BatStyle”)
[*]game.game:GetActivePlayer():ModelToHands(true, -1, 32)
[/ul]
[*]Test it in the game. When the function is called, you should get model in hand (seemingly no animstyle change). The model may be wrongly oriented, but will be there. Good. Go and make melee mayhem. Model fixes itself upon entering another close combat duel and furthermore, change of animstyles takes place, so you can finally beat your victim with a bat like a bo…like a Mafia wiseguy 😎
[/ol]
REMEMBER: The way described above is just a placeholder. Goal is a full imiation of close combat weapons mechanics, that means ability to drop weapons in combat when being knocked down and ability to pick them up again. And for that kind of behavior, only Actor items can help us.
Have fun, Andrashi
