0
MetalCat

MAFIA II - melee weapons

Recommended Posts

Hi fellow modders,

 

Long story short - watch this:

 

 

And here we go with some explanations:

 

 

Currently, we as a community use the command ModelToHands for the melee weapons emulation. It works well, but it is also very restricted, because it is nothing more than an eye candy. If we say "close combat weapon system", I dare to say we most definitely mean a whole mechanic: characters should be able to pick up and use weapons as well as there shoudl be a possiblitiy to force the weapon out of opponent's hand, pick it up and use it against him.

 

What you see in the video is what was predicted a few months ago - CrashObjects are the key. CrashObjects are entities which have physical interactions with the world (so they are not static, immobile obstacles) and, luckily for us, can be bound to human entity's hands. Examples of CrashObjects are thrash cans, lamp posts, mail boxes, fences and of course many cutscene items - for example Derek's fork and knife or the wine bottle used by Vito to hit Erik.

 

The code is moderately complex, using comparsion of position vectors to determine if the item can be picked up or not. NPCs have automatic pickup, player has to peform a taunt to trigger the pickup. There is no animation for picking the weapon and there probably won't be any, because so far any attempt to make player or the NPC duelist play some pickup animation causes break of the melee duel session.

 

There is also primitive A.I. routine, which check whether the item is free (not registered to the player or opponent). If item is free, "Fightguard" LUA command is utilized to make NPC duelist go to the weapon. It is not the best solution (as the character then tends to stay at the place and "guard" it) but it uses vector for setting up the location and it does not break melee duel.

 

And the most interesting is - why a thrashcan? Well, to test this mechanics I need GUID or the name of some CrashObject. And since we don't have enough knowledge to add a CrashObject to freeride's Actor file (so no name), I had to use some way to get at least some CrashObject's GUID. And the method is to take a car and register it for message CARCRASH_WITH. the message has the property "GetSecondEntityGuid()". So by crashing the car into some thrashcan, I was able to get its GUID.

 

 

 

 

This is in my opinion roughly 95% emulation of the original (beta) close combat weapon mechanics. I don't think we can take this matter any further.

 

Also, overall working with Mafia II LUA scripting is a pain and I mean it seriously. Almost every second command works either only for the player entity OR only for the human entity (usually it is for the opposite of what would modder want :P ), unexpected glitches happen and behavior is sometimes quite fickle. This part of IllusionEngine clearly shows results of the post-Dec2009 rush, when it was decided the game has to be finished quickly, no matter what the "costs".

Share this post


Link to post
Share on other sites

Homeless fight! :lol:

 

That is a cool video, I heard and read many time's prior to release of Mafia II, that the environment could be used as a weapon, we were promised things like, smashing plates, and braking chairs, and using them on people.

Straight from the horses mouth, watch this video, Denby Grace AKA"Sort of" ;) , says we can use a chair or a plate to beat people up with...

 

Share this post


Link to post
Share on other sites

Andrashi

 

??? ? ??? ?? ??? ??????? ??? ???? ??? ??? ????

?? ? ??? ? 3 ??? ??? ??? ?????

??? ??? ???? ? ??? ??? ??? ??? ?? ??? ??? ?????

?? ??? ??? ??? ??? ?? ??? ??? ??? ??????? ? ??? ? ??? ??? ??? ??? ??? ??? ?????

??? ? ?? ??? ??? ??? ?? ? ??? ????? ??? ? ??? ????

 

Share this post


Link to post
Share on other sites

Awesome vid, it shows that there really is alot that Vito can hold in his hands, and the flashlight was something I heard about for ages before release, and well nice to see it partially work in that vid.

Share this post


Link to post
Share on other sites

-CrAzY3AGL3

 

no but the person did give me the rights to the mod, and I changed several things on it. You still don't like me because i'm on this site, so could you just ignore me; if you do not have anything good to say then don't say anything at all.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0