foibosapolon 0 Posted May 18, 2006 Hi anybody, i need little help with scripting. I know melee script, or close combat script, but how can i make enemy to atack player with no weapon? like box, or something, in word melee combat. thanks. Share this post Link to post Share on other sites
Trapper 0 Posted May 18, 2006 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _player = _this select 0 _enemy = _this select 1 _enemy setdir (((getpos _player select 0) - (getpos _enemy select 0)) atan2 ((getpos _player select 1) - (getpos _enemy select 1))) _enemy playmove "StandStrokeFist" ~0.55 _player setdamage ((getdammage _player) + 0.25) Script call: [player,attacker] exec melee.sqs This simple script turns the ai/attacker towards the player and plays the stroke animation. At around 0.55secs after the punch it reduces player health by 25%. Ai has to be unarmed and careless. Share this post Link to post Share on other sites
ProfTournesol 956 Posted May 18, 2006 It's possible to create melee attack with fist or weapons by a small change in ofp weapons config, but you'll need to create a pbo or modify config.bin. Share this post Link to post Share on other sites
foibosapolon 0 Posted May 19, 2006 thans very much, i made it similar Share this post Link to post Share on other sites
foibosapolon 0 Posted May 20, 2006 well, i make something like melee combat; but only like script; also I make i pbo file with strokefist, which is much more better, but i cant make it, that enemy can use it too, is it possible? Whithout a script? here is my pbo (of course a copy of config.bin from flashpoint) class CfgAmmo { class default {}; class boxhit : default {}; { hit=2; indirectHit=0.500000; indirectHitRange=0.200000; file="\anitest\boxhit.rtm"; minRange=0 minRangeProbab=0.300000; midRange=1.0; midRangeProbab=0.800000; maxRange=1.5 maxRangeProbab=0.000000; model="granat"; cost=1 }; }; class CfgWeapons { class Default {}; class strokefist : Default {}; class box : strokefist { aiRateOfFire=0.500000; aiRateOfFireDistance=2 access=2 scopeWeapon=0 scopeMagazine=0 ammo="udermag"; weaponType=0; magazineType=0; displayName="box"; displayNameMagazine="boxhit"; shortNameMagazine="boxhit"; sound[]={"Weapons\grenade_launch",0.003162,1}; reloadSound[]={"",0.000316,1}; aiDispersionCoefX=2.000000; aiDispersionCoefY=2.000000; disableWeapons=0 enableAttack=1 primary=1 showEmpty=0 autoReload=1 burst=1 multiplier=1 magazines[]={"boxhit"}; reloadTime=0 initSpeed=0 canLock=0 ffMagnitude=0.100000; ffFrequency=1 ffCount=1 dispersion=0.015000; optics=0 count=100 canDrop=0 }; }; is it possible to change animation, how i tried in ammo section, not to play strokefist animation, but my own? (i make some box-like .rtm animations) and how can enemy use it? Thank very much for further help. Share this post Link to post Share on other sites