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
Update
Making melee weapons fully working via their respective weapons/items is in my opinion highly unprobable.
I downloaded Skidrow version for research purposes (I have my own legal copy of Special Extended Edition).ÃâàApplied mafiaII.exe and free ride from you guys, SuperMcTiger/MetalCat. Other other files from your package were not used.
Results of experiments unfortunately confirm my theories. Melee weapons are taken as normal weapon slots. That means you can for example change “Pendrek” (baton) into Thompson1928 and it will work (only the HUD icon of the baton stays). However, I haven’t found a way how to force the engine into accepting these items as melee weapons.
Table entry “Prazdne ruce” (“Empty hands”) in human_items and for example table entry “Pendrek” (“Baton”) in the same table have the exactly same flag bits – only the one is set, and that is “small firearm”. Yes, “Prazdne ruce” has “small firearm” flag set. Surprisingly, police does not recognize “Prazdne ruce” as an offence and there is no ammo counter visible when player has “Prazdne ruce” as a currently held weapon. On the other hand, Baton is recognized as a “small firearm” and has ammo counter visible. That means human item of index 0 (Prazdne ruce) is treated somehow special by Mafia II engine, whereas melee weapons are treated as standard weapon-type items.
Conclusion is not pleasant – this way of restoring melee weapons would be the best, but unfortunately, we cannot do it unless somebody reverse-engineers MafiaII.exe and changes/writes in some neccessary code.
Making melee weapons somehow working via LUA scripting is plausible.
The key is this LUA command: SetAnimStyle(selector, AnimSet)
There is OnEvent in Freeride, which is triggered each time some event calls. One of the events is “push the enemy” event (so far I don’t know exactly how to detect it).
If we find how to detect the “Push the enemy” event, then we can add multi-choice menu (similar to police bribing menu) and according to the chosen response we can change Vito’s moveset and damage multiplier to fake a selected melee weapon. Big issue of this way is no model of the wepon being present in hands. However that can by maybe cicuuvised by using RegisterActorItem(float, float) and ActorItemToHands (UNTESTED SO FAR) Question is wheter is is doable.
Andrashi
