Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Andrashi

1
Andrashi's Mods / Realism mod concepts
April 26, 2012, 04:57:16 AM
QuoteAndrashi

What are these restrictions which you posted earlier ?



 




I am trying to give Mafia II a touch of realistic approach to the game. And limited inventory is one of all those small changes which will ultimately add to the feeling of realism.




However, Vito can wear an array of different clothes. And it would be strange why simple shirt with trousers can store as much weaponry in the limited inventory as a long coat. So in the idea is that different type of clothing gives Vito different options how much weapons he can have in the inventory.


 




Finally, if that was all regarding limited inventory, then player would steal coat-type clothing from the first clothes shop and would play through the entire game with it, which wouls kind of defy the intended touch of realism (who wears coat when there is summer and 35 ̡̉C outside?). So weather restrictions are introduced to give the player various disadvantages if he decides to wear an outfit which is inapproppriate to the weather of the selected mission. Of course if the outfit is chosen approppriately to the weather, no extra restrictions are applied.


 


 




zahar999




I am not surprised you didn't like the camera in the RotH mod, almost nobody appreciates it  <img src="/wp-content/uploads/invision_emoticons/tongue.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/tongue@2x.png 2x" width="20" height="20">  .




Regarding fight changes, there is an XML file named "HumanFight" or something like that. It is in tables.sds. It stores settings for close combat. Close combat is a state machine. If you figure the structure, you can add more states. That is how new possiblities in close combat were aded in the RotH mod.


 




If you talk about A.I. (they block more and counterattack more often), then again in the tables.sds there is a file called civilian.xml. That file contains settings for melee A.I.


 




I hope this helps you. If I had time, I would have updated modders's section, add various files and meaning of values stored inside. However, I curently don't have time. My apologies.
2
Andrashi's Mods / Realism mod concepts
April 22, 2012, 09:41:35 PM
zahar999




Unfortunately, none of your requests can be done through LUA commands as far as I know. All of them are doable only through trainers.


 




Also I maybe finally understand what you want to know. The clothes-realism mod is intended for Vito only. If the model is switched to non-Vito one, glitches will occur. It could be coded for all possible models in the game, but I don't think it is neccessary.


 




Samo




Some tests were done regarding dead bodies. Unfortunately, dead bodies completely lose interaction with particles, only character-character and character-environment interaction remain. However, maybe it will be possible to bypass somehow. To make the game think the character is both dead and alive (SetDemigod, messing with ".health" etc). So far please consider your request as impossible to achieve. My apologies.


 




Mike & CrAzY3AGL3




Guys, looks like 2KCzech played this trick well and all players around the world took the bait <img src="/wp-content/uploads/invision_emoticons/happy.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/happy@2x.png 2x" width="20" height="20">.




Casing is so far a bit mystery for me, probably it is a particle, so finding it and altering it s lifetime property could solve this riddle.


 




But regarding magazines and drums, it is not possible to leave them on ground. And that is because if they were to be left on ground, Vito would not have a magazine/drum model to load the weapon with <img src="/wp-content/uploads/invision_emoticons/happy.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/happy@2x.png 2x" width="20" height="20">. Seriously, this is one of the best April fools I have ever seen. Basically, almost everybody here assumed that magazines/drums FALL THROUGH floor. The reality is that magazine/drum is a part of the weapon. So when Vito throws it away, it falls down and looks like it "falls" through the foor, while in fact it gets teleported back the Vito's hand, so he has a magazine/drum 3D model to reload the weapon with! Probably done in order to save memory space.


 




Well played, 2K Czech.
3
Andrashi's Mods / Realism mod concepts
April 20, 2012, 09:31:49 PM
Zahar999 guessed it right. Karma increased.




"Ammunition loss when reloading" concept is a sheer luck. There is a LUA function




InventoryHowMuchAmmoCanAdd(weapon_id, max_ammo_to_add)




It returns how much ammo can be added till the inventory of the weapon is full. That means when Vito has a colt 1911 with 48 rounds in the inventory, this function will return 1. If Vito has 40 rounds in the inventory, it returns 9. And the deal-breaking part is that it counts ONLY with ammunition stored in the inventory, ammo stored in current clip is not counted!


 




Well Mike, here you are. Amunition loss when reloading clip/drum-fed weapons.


 




Zahar999




Modified clothing is planned to be in the story mode, not in a freeride. Modified clothing will have effect only on Vito, since Vito is the main character in the story mode. In the story mode, each mission has its unique weather. Some missions even contain changes in weather between mission checkpoints. The idea is to set weather restrictions specifically for each mission to reflect weather conditions.


 




General idea behind limited inventory is to make the game look more realistic and weather restrictions are made to force the player choose not only coat-type clothes all the time, but also other outfits.
4
Andrashi's Mods / Realism mod concepts
April 20, 2012, 07:14:43 PM
zahar999




These realism ideas are not intended for a freeride mod. I don't want to create another freeride mod. Existenz is the one who is doing freeride mod. These ideas will be used to make the gameplay in the story more realistic.


 




Mike Bruski & CrAzY3AGL3




So far RotH mod is better because RotH mod is out while this current "project" is so far nothing more than just a bunch of concepts.


 




Magazines and shell casings to remain on the floor is maybe doable. Well not exatly "remain forever", but for example disappear in five/ten minutes. However it will require digging in particle files, which is a neighbour of "Mafia II file city" I am not regularly visiting because local residents are quite confusing and not easy to understand. Such a change will most certainly cause an extra performance stress, but we are talking about PC version of Mafia II, not Xbox360/PS3.


 




Samo




Yes, drunk efect on jacket-type clothing was too much. Regarding weathers - there are lots of weather presets used throughout the story. In the design summary I used six general weathers just to give a glimpse of weather restrictions system. The idea is to customize weather vs clothing restrictions specifically for each mission. That way restrictions can reflect actual mission weather quite closely.


 




Regarding animation importing, I have not deciphered animation data format and I have no intentions to do it because of its complexity. My apologies, but that is something beyond me <img src="/wp-content/uploads/invision_emoticons/happy.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/happy@2x.png 2x" width="20" height="20">.


 




QUIZ ENDED, winner is Zahar999




Here is a small video showing ammunition loss when reloading clip/drum fed weapons. Just as it should be in a "realistic" game.


 




<div class="ipsSpoiler_header">

The_video


</div>

 
5
Andrashi's Mods / Realism mod concepts
April 19, 2012, 08:45:05 AM
Alrighty, here we go with another interation. I looked into weapon lengths (wikipedia). Let's see:


 




<div class="ipsSpoiler_header">



 


 


 




Beretta 38A




Ãâà 94.6 cm




37.2 in


 


 




Thompson 1928




Ãâà 85.0 cm




33.5 in


 


 




Thompson M1A1




Ãâà 81.0 cm




32.0 in


 


 




MP40 (stock folded)




Ãâà 63.0 cm




24.8 in


 


 




GreaseGun (stock folded)




Ãâà 57.9 cm




22.8 in


 


 




Remington 870




128.0 cm




50.5 in


 


 




M1 Garand




110.0 cm




43.5 in


 


 




Mauser 98k




111.0 cm




43.7 in


 


 


 




</div>

 




You are right, MP40 and Grease gun are noticably smaller than the rest of two-handed guns and could be easily hidden in a jacket-type clothing. So let's add an exception just for these two long guns, that in case of jacket type clothing they can be stored as a "pseudo short weapon" in the inventory, occupying short weapon slot and inducing movement limiting as you are suggesting.


 




I am yet to see if I can affect speed of movement (speed of walking, speed of running). If I can, then I would change restricting conditions on clothes and use the speed of movement as a limiters.


 




Also I remembered that there are much more weather presets than just those used in a freeride. So it would be wise do distinguish just a few remarkable weathers and place all ingame weathers into these categories.


 




Overall check No#1 of the limited inventory design


 




[ul]




  • underwear




    [ul]




  • Inventory - no slots available




  • Hands - amount of carried ammunition for currently held weapon limited to one clip max.




  • General weather restrictions




  • [ul]




  • Winter day
     - health slowly drops till death




  • Winter day snow
     - health slowly drops till death




  • Winter night
     - health slowly drops till death




  • Winter night snow
     - health slowly drops till death




  • Summer day
     - no restrictions




  • Summer day rain
     - health regeneration disabled




  • Summer night
     - health regeneration slowed to one quarter




  • Summer night rain
     - health regeneration disabled




    [/ul]




    [/ul]








  • nojacket




    [ul]




  • Inventory - One slot total. One slot for either a one small weapon or a one special weapon




  • Hands - amount of carried ammunition for currently held NON-INVENTORY weapon limited to one clip max.




  • General weather restrictions




  • [ul]




  • Winter day
     - health regeneration disabled




  • Winter day snow
     - health regeneration disabled




  • Winter night
     - health slowly drops till death




  • Winter night snow
     - health slowly drops till death




  • Summer day
     - no restrictions




  • Summer day rain
     - health regeneration slowed to one quarter




  • Summer night
     - no restrictions




  • Summer night rain
     - health regeneration slowed to one quarter




    [/ul]




    [/ul]








  • jacket




    [ul]




  • Inventory - Two slots total. One slot for a one small weapon or one MP40/GreaseGun. Another one slot for a one special weapon.

If player has MP40/GreaseGun holstered in the inventory and has a non-long weapon in hands, then sprinting and obstacle climbing are disabled.

If player has MP40/GreaseGun holstered in the inventory and has a long weapon in hands, then sprinting, running and obstacle climbing are disabled (player forced to walk movment).




  • Hands - amount of carried ammunition for currently held NON-INVENTORY weapon limited to one clip max.




  • General weather restrictions




  • [ul]




  • Winter day
     - health regeneration slowed to one quarter




  • Winter day snow
     - health regeneration slowed to one quarter




  • Winter night
     - health regeneration disabled




  • Winter night snow
     - health regeneration disabled




  • Summer day
     - health regeneration slowed to one quarter




  • Summer day rain
     - no restrictions




  • Summer night
     - no restrictions




  • Summer night rain
     - health regeneration slowed to one quarter




    [/ul]




    [/ul]








  • coat




    [ul]




  • Inventory - Three slots total. One slot for a one small weapon. Another one slot for a one special weapon. Another one slot for a one long weapon.

If player has a long weapon holstered in the inventory and has another long weapon in hands, then sprinting and obstacle climbing are disabled.




  • Hands - no extra limits on amount of carried ammunition for currently held NON-INVENTORY weapon.




  • General weather restrictions




  • [ul]




  • Winter day
     - no restrictions




  • Winter day snow
     - no restrictions




  • Winter night
     - no restrictions




  • Winter night snow
     - no restrictions




  • Summer day
     - health regeneration disabled and "drunk effect" present




  • Summer day rain
     - no restrictions




  • Summer night
     - health regeneration slowed to one quarter




  • Summer night rain
     - no restrictions




    [/ul]




    [/ul]








    [/ul]


     


     




    Remember and bear in mind that weather restrictions are only SEMI-REALISTIC. Goal of weather restrictions is to make player wear all outfits through the game, not only coat one.
6
Andrashi's Mods / Realism mod concepts
April 17, 2012, 06:09:12 AM
Samo, I see you would like to see several changes in a police system. Me too and it will be another project, but please so far let's stay on topic of this thread.


 




At least for now it looks like we reached a consensus regarding outfits and how they should affect player's inventory. As designed now, it looks like coated outfits are the best to wear all the time. But I don't want a player to steal a coated outfit at the beginning of the game and be OK with it till the end. That would make the whole idea of tactic a bit pointless.


 




So, let's mix realism and game logic. What if selected outfit affects player based on the weather? Of course this should work only outside and be disabled when player enters some interier. General idea is:


 




Summer Day




[ul]




  • underwear - no penalty




  • nojacket - no penalty




  • jacket - permanent light dizziness (light drunk effect)




  • coat - permanent heavy dizziness and health regen disabled




  • [/ul]


     




Summer Day Rain




[ul]




  • underwear - health regen disabled




  • nojacket - health regen slowed down




  • jacket - no penalty




  • coat - no penalty




  • [/ul]


     




Summer Night




[ul]




  • underwear - no penalty




  • nojacket - no penalty




  • jacket - no penalty




  • coat - health regen slowed down




  • [/ul]


     




Winter Day




[ul]




  • underwear - health slowly dropping till death (by freezing)




  • nojacket - health regen disabled




  • jacket - no penalty




  • coat - no penalty




  • [/ul]


     




Winter Day Snow




[ul]




  • underwear - health slowly dropping till death (by freezing)




  • nojacket - health regen disabled




  • jacket - health regen slowed down




  • coat - no penalty




  • [/ul]


     




Winter Night




[ul]




  • underwear - health slowly dropping till death (by freezing)




  • nojacket - health slowly dropping till death (by freezing)




  • jacket - health regen disabled




  • coat - no penalty




  • [/ul]


     




    I think something like this would do the job. If player goes outside and does not choose outfit in regards to actual weather, consequences are made. Simple way to make the player choose other outfits than long coat in summer. In winter long coat is a logic choice, no problems with that. It even goes well in terms of the game progress - at the beginning of the game player is even encouraged to wear the most advantageous outfit. And as the game shifts to second phase, player is made to choose other outfits.


     


     




    Final words, the plan is to create and test several game designs and then pack all of them together into one realism modification, called Mafia II: ReCzech mod. So yes, Crash Concept Melee Weapons system is taken into account. It will have its own thread as well, since there are several changes to be made in close combat system in order to make it look less static. But that has to wait. Now we are discussing inventory system, gunfire hit reactions and weapon properties.
7
Andrashi's Mods / Realism mod concepts
April 16, 2012, 07:48:39 AM
Alright Samo, your ideas sound valid. Let's adjust the inventory system design:


 




There are four major types of outfit recognized in regards to the inventory system:




[ul]




  • underwear - duh




  • nojacket  - shirt & trousers, racing suit, maybe more?




  • jacket    - all outfits which have waist-long jacket/




  • coat      - all outfits with long coats.




    [/ul]


     




    Also, for purpose of this system, weapons are divided into following three classes:




    [ul]




  • long    - submachineguns, rifles, baseball bat, long environmental melee objects




  • short   - handguns




  • special - molotovs, grenades, baton, knife and and short environmental melee objects




    [/ul]


     


     




    Next, each type of clothing will have separate set of rules regarding inventory capacity for weapon classes:


     




    Underwear




    No inventory. Vito can only carry one item (arbitrary weapon class) and only in hands.




    Grenades/Molotovs are limited to strictly only one. If player tries to pick up more, these extra grenades/molotovs are discarded and fall back on the ground.




    Weapons are limited to strictly one magazine capacity. Excessive ammo is discarded back to the ground.


     




    nojacket




    Vito can store in his inventory either one short weapon or one special weapon class. Not both at the same time.




    Ammo limiting (only one magazine available) does not affect the short gun marked as the inventory one.




    Ammo limiting affects grenades/molotovs (limited to TWO pieces) even if they are stored as the inventory item.




    Ammo limiting does affect guns/items which are only held in hands (not marked as being in the inventory). Limited to one magazine for non-inventory guns or one picece of non-inventory molotov/grenade.


     




    jacket




    Vito can store in his inventory both one short weapon and one special weapon classes. Both at the same time.




    Ammo limiting affects only non-inventory held items, which are limited to one magazine for guns/one piece for grenades/molotovs.


     




    coat




    Vito can store in his inventory both one short weapon and one special weapon classes. Both at the same time.




    Vito can also store one long weapon in the inventory. However, storing the long weapon and picking up another long weapon to be held in hands (so Vito carries two long weapons) disables abilities to sprint and to climb over obstacles.




    No ammo limiting even for held-only weapons.


     


     


     




    So, what do you think about this concept?
8
Mafia Mod Request / MAFIA II - melee weapons
February 02, 2012, 03:05:43 PM
Hi fellow modders,


 




Long story short - watch this:


 




<div class="ipsSpoiler_header">








<div class="ipsEmbeddedVideo"><div></div> </div>

</div>

 




And here we go with some explanations:


 




<div class="ipsSpoiler_header">



 




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.


 




</div>

 


 


 




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   <img src="/wp-content/uploads/invision_emoticons/tongue.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/tongue@2x.png 2x" width="20" height="20">  ), 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".
9
Mafia Mod Request / MAFIA II - melee weapons
January 23, 2012, 12:03:27 AM
???   ??? ???? ??  ??? ????????? ?  ??? ????  ??? ???, ? ?  ??? ?????  ??? ???????????  ??? ???????.




???   ??? ????  ??? ?????  ??? ????  ??? ???????????  ??? ???????  ???   ??? ?????????.




??? ???:




NPCentity = game.entitywrapper:GetEntityByGUID("Joe")




NPCentity:SetMeleeArchetype("Loser")


 




?  ??? ???????, Joe  ??? ???? ??  ??? ????.  ???   ??? ???,  ???   ???   ??? ????,  ??? ??? <img src="/wp-content/uploads/invision_emoticons/happy.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/happy@2x.png 2x" width="20" height="20">.
10
Mafia Mod Request / MAFIA II - melee weapons
January 19, 2012, 05:22:53 PM
MafiaEmpire wiki is a good touch, but we need something more complete. I am currently working on a list of HumanMessages enumerations as you requested, it should be done today or tomorrow.


 




SetDamageMultiplier does not work on player, because player character does not use melee archetype from civilian.xml in "tables.sds". Well to be correct it uses, but it takes only melee animset from it. Damage dealt by player character is set in human2config.xml in "ingame.sds". Blame 2K for this mess  :lol: .


 




Another issue you mention is simply something we will have to put up with. "Prazdne ruce" (empty hands) is the one and only weapon capable of entering a melee duel. Any other weapon breaks melee duel. I guess you are using "squeegee" item as a trigger to change faked melee weapon in hands. Well that will also break melee duel and currently I have no workaround up my sleeve. Will try some luck with HEXstuff, snooping in human_items.tbl file.


 




BTW we are yet to tackle another issue - what if we want melee weapons to be changed dynamically in a fight? On NPC side there are no problems, but player character has to be something diferent again and does not adjust animset immediately but has to go outside of close combat, switch animsets, enter close combat again. Now that will be something to solve...


 




Andrashi
11
Mafia Mod Request / MAFIA II - melee weapons
January 18, 2012, 07:54:01 AM
My, my, what a mayhem   <img src="/wp-content/uploads/invision_emoticons/tongue.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/tongue@2x.png 2x" width="20" height="20">


 




Everybody, listen. While this little discovery looks and plays nice, it is still miles away from full emulation of melee weapon mechanics, which were once present in the game. No need to praise me that much. Praise me all you want after I deliver something worth it.


 




Now for something interesting regarding GDS 2009 video:


 




<div class="ipsSpoiler_header">



 




I carefully watched once again the infamous GDS 2009 demo, part where melee weapon is being used in combat (guard with baton). For me it seems to that even 2K Czech used some sort for workaround for melee weapons at that time. Several playthroughs of that mission exist, yet in none of them is shown one (for us) crucial feature: ability to PICK UP THE BATON and use it against the guard. Now why not to present such a feature to the press, media and public, when the demo was basically stuffed with demonstrations of as much gameplay mechanics as possible?


 




My answer is: simply because the baton was faked somehow and it was not possible to pick it up.




Important question is: are we able to go even further then devs themselves?


 




</div>

 


 




And here we go with reactions & replies:


 




<div class="ipsSpoiler_header">



 




Meaning of values in LUA command ModelToHands:




ModelToHands(visible true/false, left hand weapon_ID, right hand weapon_ID)




If "-1" is for either left or right hand item, said hand remains empty. Weapon IDs are inside "tables.sds" file, in "table0_bin", in a table which is named "Weapons.tbl".


 


 




MikeBruski




I am working with Czech Special Extended Edition version of Mafia II. That means I run latest patches which remove some JA DLC content (Rocco's hotel, Printery) and disable some stuff. But that ensures these mods are playable even with official Steam Mafia II.


 




There is no way to play Steam Mafia II basic version. I tried, but Steam forces update. You can cancel the update, but Steam then disables the game (you cannot play it) and shows you warning that the game needs to be updated for your convenience before you can run it.


 




Also Mike, ROTH mod will be updated only if I gain access and knowledge large enough to modify and rescript storyline missions.


 


 




MetalCat




CZ:




NevÃÆím, na co narÃÆáÃâ¦Ã¾ÃÆíÃâ¦Ã¡   <img src="/wp-content/uploads/invision_emoticons/smile.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/smile@2x.png 2x" width="20" height="20">  . Jestli na to co myslÃÆím, tak to nelze vylou?it, ale siln? pochybuji, Ãâ¦Ã¾e hra hra sama vybÃÆírÃÆá vhodnÃÆé anima?nÃÆí sety "dle zbran?" jen kv?li pouÃâ¦Ã¾itÃÆí p?ÃÆíkazu ModelToHands. Ten p?ÃÆíkaz pouze a jenom p?i?adÃÆí model do ruky, nic vÃÆíc. Zm?na AnimSetu se d?je p?ÃÆíkazem SetAnimStyle.


 




EN:




No idea what you are talking about. I cannot rule it completely out, but I firmly doubt in this case (ModelToHands used) engine automatically picks AnimSets based on a weapon model in character's hand. ModelToHands only makes a selected model show in a selected hand, nothing more. AnimSet is changed via SetAnimStyle command.


 


 




eXistenZ34




I will help you as soon as I get back to modding PC. For starters: CLOSE_COMBAT_START and CLOSE_COMBAT_STOP do not work the way it seems they should, at least that is conclusion of my experiements   <img src="/wp-content/uploads/invision_emoticons/sad.png" alt="" data-emoticon="" srcset="/wp-content/uploads/invision_emoticons/sad@2x.png 2x" width="20" height="20">  . But since 2K used them (Butcher brawl, Eric brawl), they should be working. That means there's probably some trick behind their use.


 




</div>

 


 




Andrashi
12
Mafia Mod Request / MAFIA II - melee weapons
January 16, 2012, 05:47:19 PM
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.


 




<div class="ipsSpoiler_header">



 




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]




    [/li]




  • 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   :cool:  




  • [/ol]


     




    </div>

     


     


     




    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
13
Mafia Mod Request / MAFIA II - melee weapons
January 06, 2012, 08:39:57 AM
My apologies for non constructive topic reply.


 




At risk of sounding too harsh - CAN WE PLEASE FINALLY STOP WITH THIS SILLINESS?




I made a few posts about melee weapons, their animations and overall our chances of bringing back melee weapons.




Posts are seeimgly ignored, because I did not backed them with nice YouTube videos, right?


 




Sigh, so...if Mafia1860 found anything new, then how did I managed to write post Post 1820, second paragraph? Ah yes, I forgot to add YouTube video, right? OK, so let's fix it. Here is a nice eye candy video which tells us nothing about how to achieve what we want but looks pretty cool]aaa[/url]


</div>

 




And here's one outrageous new discovery - Joe's melee animations are those which have prefix "39-" in basic_anims2.sds. What a big surprise, given the fact Joe's moveset is labeled as set 39 in animengine_groups and the fact this is known since summer 2010's demo. Seriously, can we start massively celebrating because I claim to be the first one to mention it? Oh I forgot to add another eye candy YouTube video, now everybody will ignore the post. Wait wait, here you go:


 




<div class="ipsSpoiler_header">

aaa


</div>

 


 




OK, I hope the message is clear now. We need to move FORWARD if we want  to have fully working melee weapons, not to stay at one place and glorificate everybody who can alter a few numbers in a HEXeditor. As I already wrote (post was ignored, no fancy YouTube video, I know): since melee weapons slots are disabed via engine and the only weapon slot which works for close combat is slot "Prazdne ruce", there is the only way to have melee weapons back - LUA script and actor items. However, I am yet to discover how to add actor item to .sds structure. So far my knowledge is incomplete and all of my attempts are crashing down the game. But that means THIS is the issue we should be intensely investigating right now. Not "how to change a few numbers with HEXeditor", but "How to add CrashObject entity to freeraid_main.sds file".


 




Cheers, Andrashi


 


 




P.S.: I also found a way how to make A.I. enemies break away from grabs and with some other changes A.I. can even reverse grab you! But you know, no YouTube video, so feel free to ignore this PostScriptum.[/size]
14
Mafia Mod Request / MAFIA II - melee weapons
December 18, 2011, 06:46:58 AM
Update


 




Another update, mainly focused on the matter of Actor entities.


 




<div class="ipsSpoiler_header">



 




Melee duel with "invisible cold weapons" was sucessfully emulated via Lua scripting. Still pretty basic, but looks OK nevertheless.


 




"Actor item" mechanics were looked into. So far no success, but interesting discoveries. In Mafia II, designer defines actors (entities to be used) in the "Actors" file in the *.SDS. Actors can be:




[ul]




  • Script




  • Human entity




  • Item entity




  • Particle entity




  • [/ul]




    Counting out Script and Particle entities, Human and Item "actors" are referencing actual models i.e. "CITGA3" (regular gangster from his .sds file) or "Palka" (baseball bat from weapons.sds file). Actor has its unique name given by the designer and contains the name of the referenced model as well (duh).




    In Lua scripting, actors are then referenced by their name. That is why are mission-specific enemy entities referenced in Lua scripts by strange names. So when for example "sp1d0" (fictional name) is called, engine has it listed as a Human actor entity which references CITGA3 model. Thus such an actor is known and can be operated with (given weapons, set aggresivity etc).


     




    Exact structure of actor profiles is so far not completely known due to low amount of time available for research. If anybody can fill us up (means if anybody already messed with Actors), it would be helpful. If structure of Actors profiles is decrypted, in theory we, modders, can start creating our own missions with unique mission specific NPCs. Of course so far only within freeraid_main.sds file.


     


     


     




    As a side effect of this research, during the inspection of a file named something like "02-foundry.sds" (in "Script" folder), number of sc_ animations were found (these are the anims used with AnimPlay). From names of them it looks like one of my early theses is correct - instead of plain CrazyHorse destruction, there was probably (still not certain) supposed to be a large melee brawl, ending in a CrazyHorse destruction and Greasers packing off to foundry (where shootout occured).


     




    </div>

     
15
Mafia Mod Request / MAFIA II - melee weapons
December 03, 2011, 09:25:00 PM
Update


 




Making melee weapons fully working via their respective weapons/items is in my opinion highly unprobable.


 




<div class="ipsSpoiler_header">



 




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.


 




</div>

 


 


 




Making melee weapons somehow working via LUA scripting is plausible.


 




<div class="ipsSpoiler_header">



 




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.


 




</div>

 


 




Andrashi