Five Elite Mercenaries are send to an Island in middle of the 1980'. The Task: Find and Eliminate a local Drug Baron. Features: new Physic, real Sunmovement, Day/Night Change, Hunger/Food system, realistic (!) Weather system, Light/Dark viewing system for AI, 5 different Fractions on the Island. Complete Realistic simulation of nearly all things, including Sleep. New weapons, new Vehicles. Vehicles driving system is now exact (!) like GTA IV , FireSystem,... this mod is Heavily inspired by GTA, IGI, FarCry.

Forum Thread
  Posts  
realtime wpnstats (Games : Far Cry : Mods : FarCry Operation Clearing : Forum : Technical Discussion for OP CL Devkit : realtime wpnstats) Locked
Thread Options
pvcf
pvcf Germany
Mar 11 2015 Anchor

devkid have a realtime info box for weaponstats, this is basically how its done,
first with weaponparams (for damage_drop_per_meter)

---pvcf-------------
local wpnname = _localplayer.cnt.weapon.name;
local dmg_dropmeter = 0;
if WeaponsParams[weaponname] and WeaponsParams[weaponname].Std[1] and WeaponsParams[weaponname].Std[1].damage_drop_per_meter then
dmg_dropmeter = WeaponsParams[weaponname].Std[1].damage_drop_per_meter;
end
---pvcf-------------

and this is how it would be done with fireparams for ammotype:

local ammotype = _localplayer.cnt.weapon.FireParams[_localplayer.cnt.firemode+1].AmmoType;

things you should know:
as you know you can define not only in weaponparams.lua the params, you can also define the same in each weaponscript. the code above
reads out the one from weaponparams.lua.
in basicweapon.lua , during a init procedure, this tables will be merged to one table. the same thing happens also for the MP table, but i'm not very
familiar with the MP table handling, but insteat of

WeaponsParams[weaponname].Std[1]

you should use

WeaponsParams[weaponname].MP[1]

this is how to read out the AI recognition for weapons:

---pvcf-------------
local weaponname = _localplayer.cnt.weapon.name;
local statsVolumeRadius = 0;
local statsThreat = 0;
local statsInterest = 0;
		
if AIWeaponProperties[weaponname] then
		 	statsVolumeRadius = AIWeaponProperties[weaponname].VolumeRadius;
			statsThreat = AIWeaponProperties[weaponname].fThreat;
			statsInterest = AIWeaponProperties[weaponname].fInterest;
end
---pvcf-------------

Edited by: pvcf

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.