Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Equip militia with guns/armour/etc.
|
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #316681]
|
Thu, 28 March 2013 18:32
|
|
PasHancock |
|
Messages:720
Registered:February 2011 Location: Estonia,Tallinn |
|
|
Would be awesome to see if you could somehow make Militia Generate random equipment + take equipment from sector, because Militia at early stages of the game is useless, because there won't be many weapons, i know this feature increases realism but its kinda annoying sometimes, to get Equipment and drop it in sector
Would love to see something like:
1 - Militia generates their own Equipment
2 - Militia has weapons/equipment from Sector Inventory, but if there is not enough weapons to distrube, generate for the rest
3 - Militia only uses equipment from Sector inventory
OR maybe a Feature where you can equip every Militiamen individually? like Open their Inventory and give Gun, Ammo, Grenades etc. for each of them? and their Equipment is saved til they will die or move from Sector or drop items you gave to them after leaving sector?
[Updated on: Thu, 28 March 2013 18:34] by Moderator Report message to a moderator
|
First Sergeant
|
|
|
|
|
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #317116]
|
Sat, 06 April 2013 14:43
|
|
PasHancock |
|
Messages:720
Registered:February 2011 Location: Estonia,Tallinn |
|
|
ok ok, here how it works:
I trained Militia in C13 sector
They Took all Weapons and Items they could take
I decided to attack D13 with my Militia
When we arrived, Militia had no Weapons and no Items
Then, i reloaded game
did Militia inspection ( drop all their items )
attacked D13
Militia had their Weapons and Items
P.S:
after i took D13 sector, i tried to return militia to C13 sector with all their stuff, but when i did that, they had no weapons, they were all gone, and to get their items back, i must do Militia Inspection and drop items in that sector
[Updated on: Sat, 06 April 2013 14:45] by Moderator Report message to a moderator
|
First Sergeant
|
|
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #317119]
|
Sat, 06 April 2013 15:17
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
If possible, veteran militia chooses first (this is not always possible due to the weird way in which we load maps).
Militia/Enemy traits are chosen depending on the gear they get, not the other way around (apart from the 2nd handgun for ambidextrous). Has always been so
Item selection is deterministic. We rate every item we find with a simple 'fitness' function. The higher the value, the more we like it:
// determines how good an item is
UINT32 ItemFitness( OBJECTTYPE* pObj, UINT8 idx )
{
UINT32 value = 0;
if ( Item[ pObj->usItem ].usItemClass & IC_ARMOUR )
{
value = Armour[ Item[ pObj->usItem ].ubClassIndex ].ubProtection * Armour[ Item[ pObj->usItem ].ubClassIndex ].ubCoverage * (*pObj)[idx]->data.objectStatus;
}
else if ( Item[ pObj->usItem ].usItemClass & IC_FACE )
{
if ( Item[ pObj->usItem ].gasmask )
value = (*pObj)[idx]->data.objectStatus;
else if ( Item[ pObj->usItem ].hearingrangebonus )
{
value = Item[ pObj->usItem ].hearingrangebonus;
}
else
{
value += (NightTime() ? Item[ pObj->usItem ].nightvisionrangebonus : Item[ pObj->usItem ].dayvisionrangebonus );
}
}
else if ( Item[ pObj->usItem ].usItemClass & (IC_BLADE|IC_PUNCH) )
{
value = (*pObj)[idx]->data.objectStatus * Weapon[ Item[ pObj->usItem ].ubClassIndex ].ubImpact;
}
else if ( Item[ pObj->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) )
{
// value is damage * range * firing rate, modified by number of attachments and accuracy
value = GetDamage(pObj) * GunRange(pObj, NULL) * max(1, GetAutofireShotsPerFiveAPs(pObj));
value = value * (10 + (UINT32)GetGunAccuracy(pObj)) / 10;
value = value * (10 + (*pObj)[0]->AttachmentListSize()) / 10;
value *= (*pObj)[idx]->data.objectStatus;
}
// default
else
{
value = (*pObj)[idx]->data.objectStatus * Item[pObj->usItem].ubCoolness;
}
return value;
}
Guns are a special case, as we multiply their value with the percentage of needed ammo for it we find:
// how much ammo does this item need?
UINT32 GetNeededTotalAmmo( UINT16 usItem )
{
// determine what amount of ammo is deemed 'enough' for this gun
return max(gGameExternalOptions.usMilitiaAmmo_Min, min(gGameExternalOptions.usMilitiaAmmo_Max, gGameExternalOptions.usMilitiaAmmo_OptimalMagCount * Weapon[ usItem ].ubMagSize));
}
// special version of ItemFitness() that takes ammo count into consideration
UINT32 ItemFitness_WithAmmo( OBJECTTYPE* pObj, UINT8 idx, UINT32 uiBullets )
{
return (ItemFitness(pObj, idx) * uiBullets) / max(1, GetNeededTotalAmmo(pObj->usItem));
}
So for guns, we call ItemFitness_WithAmmo() with the number of available bullets. Best rating wins. Coolness is irrelevant for that item category.
Edit: From looking at it, I should propably take object status into account for face vision items, and limit the influence of uiBullets by GetNeededTotalAmmo(pObj->usItem)... will do later.
[Updated on: Sat, 06 April 2013 15:22] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #317122]
|
Sat, 06 April 2013 15:30
|
|
Sam Hotte |
|
Messages:1966
Registered:March 2009 Location: Middle of Germany |
|
|
IIRC AI never suffers from weapon's jam, no.
[Updated on: Sat, 06 April 2013 15:31] by Moderator Report message to a moderator
|
Sergeant Major
|
|
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #317130]
|
Sat, 06 April 2013 18:40
|
|
PasHancock |
|
Messages:720
Registered:February 2011 Location: Estonia,Tallinn |
|
|
oh, about equipping militia
You know about this, restric Militia from picking up certain items, what if you could make an option, where you can only allow certain type of Militia to pick up a weapon, like, TAB + RMB to choose between Green, Blue and Violet militia, so if i choose Violet, only Veteran militia can pick up such Item(s)
Report message to a moderator
|
First Sergeant
|
|
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #317135]
|
Sat, 06 April 2013 19:31
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
PasHancockok ok, here how it works:
I trained Militia in C13 sector
They Took all Weapons and Items they could take
I decided to attack D13 with my Militia
When we arrived, Militia had no Weapons and no Items Well, I just did that, and it works for me. Both when attacking from strategic and from manully entering the sector from tactical. What is the revision of your exe?
They also avoid tear gas pretty well when I drop it in their path. Need more info.
[Updated on: Sat, 06 April 2013 19:34] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #317329]
|
Thu, 11 April 2013 20:16
|
|
PasHancock |
|
Messages:720
Registered:February 2011 Location: Estonia,Tallinn |
|
|
hmm, maybe it would be more realistic if you could make something with Militia's health? for example, if Militia was Hurt during a fight, he will have the same HP after battle, so if Militiaman's state was Critical during a battle, and battle is over, that Militiaman's health will still be Critical, and his hp will regenerate faster than Mercs HP for obvious reason, regeneration will be faster if Merc with Doctor trait is in the sector
Same to do with Enemies, if i hurt alot of Enemies during a fight and i retreated, i want to send my Spy back to that sector to finish everyone who he can
Dying Enemies/Militia HP after battle will be changed to Critical
Is this possible to implement? it's just increases Realism and what i like in Equip Your Militia feature, is that you would equip them by yourself, as if it was real war where you must provide soldiers with equipment
Report message to a moderator
|
First Sergeant
|
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #317400]
|
Sat, 13 April 2013 21:13
|
|
Kafouille |
|
Messages:9
Registered:May 2006 |
|
|
FlugenteA savegame would be good, as I cannot reproduce the error you get.
I have reproduced this error, and have savegames : First savegame, merc is in sector, militia get to keep the weapons, second one, the merc has just left the sector, the guns are not back in sector inventory, when you load that savegame and go back in that sector the militia has lost all their guns. This is on exe 5996 from Depri's builds.
Also, a suggestion : Instead of disapearing from sector inventory, weapons in use by militia should get an overlay like the one you get on inacessible items, at "In use by militia" tooltip, and an associated visibility filter, it would be much more user friendly, the current way is rather confusing when you get a lot of militia and can't quite remember just what you gave them.
https://docs.google.com/file/d/0B7ZZcFqBHX1cdi1YM3NONUYzYmM/edit?usp=sharing
Report message to a moderator
|
Private
|
|
|
Re: New feature: Equip militia with guns/armour/etc.[message #317404]
|
Sat, 13 April 2013 22:53
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
I am unable to load your savegames. The first one crashes, upon loading the second, crash occurs when entering a sector (due to weird placement of corpses).
Do you use other than the vanilla maps? Other tilesets? What ini-changes (would be best to just upload your ini)?
The sector inventory shows what is on the floor in the sector. We cannot display soldier inventories there, and it wouldn't make any sense imho.
[Updated on: Sat, 13 April 2013 22:55] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 19 06:42:38 GMT+3 2024
Total time taken to generate the page: 0.02320 seconds
|