Jump to content
phronk

[Release] Addon-Free Melee Weapons Script

Recommended Posts

Guest

It's not...

If a couple setVectorDirAndUp onEachFrame are enough to even impact your performances in a regular scenario, you might wanna buy a new machine.

Okay brah if you say so. I have a good machine I just think outside the box. You wont have this only script running and it may impact the overall performance. "Just a couple setVectorDirAndUp" well as you said then.

Share this post


Link to post
Share on other sites

Well consider this :  only players will carry melee weapons and those commands can be run from clients rather than the server.

There is very little chance to see any framerate drop don't you think?

Share this post


Link to post
Share on other sites
Guest

Well consider this :  only players will carry melee weapons and those commands can be run from clients rather than the server.

There is very little chance to see any framerate drop don't you think?

The chance is little but not "very little". The server will need to sync the pos of the attached object between all clients and on the client side you run a code on each frame. So yeah it is not that ressource consuming but enough to impact in huge missions. For instance removing the onEachFrame from koth allow me to win like 5 fps whether i'm running with 20 or 80 fps (i7 4790k w/ r9 280x oc). So yeah it may be a bigger onEachFrame than the one we are talking about... Anyway any instruction will cost time and ressources so unless bohemia add a command that supports that kind of things...

Share this post


Link to post
Share on other sites

Hi Phronk,

 

I like your work, well done

 

I used your Idea and this bit of code in my mission -=LOST=- and it works well,

I don't need to carry them on my back as they are carried in the players inventory in my mission.

chopHam={
private["_me","_stam","_nearObj","_tarCond","_tar"];//"_LoS"
_me=_this select 0;
_me setAnimSpeedCoef 1.1;
_me playMove "AwopPercMstpSgthWnonDnon_end";
sleep 1.12;
_me setAnimSpeedCoef 1;
_stam=getStamina _me;_me setStamina(_stam-16);
_nearObj=nearestObjects[_me,["Man"],1.8];_tarCond=[];
{if((alive _x)&&{(_x!=_me)})then{_tarCond set[(count _tarCond),_x];};}forEach _nearObj;//Sets condition for nearestObjects
if(count _tarCond==0)exitWith{};
_tar=_tarCond call BIS_fnc_selectRandom;
_LoS=[getPosATL _me,getDir _me,90,getPosATL _tar]call BIS_fnc_inAngleSector;
if(_LoS)then{
	if((alive _tar)&&(_tar!=_me))then{
		if(_me distance _tar<1.9)then{
		_tar setDamage((damage _tar)+(0.45));
			if(_stam>=75)then{_tar setDamage((damage _tar)+(0.05));};
				if(_stam>=90)then{_tar setDamage((damage _tar)+(0.05));};
					if(_stam==100)then{_tar setDamage((damage _tar)+(0.25));};
			};
		};
	};
};

  • Like 2

Share this post


Link to post
Share on other sites

Is there a way to rebind the melee to a key on the keyboard? Right now the script is set to use any button on the mouse to launch attacks. Also the melee script does work in multiplayer. 

Share this post


Link to post
Share on other sites

I am unable to pick up items. The action, however, does disappear after making an attempt.
I am recieving an error when trying to pick up any of the melee objects with the attached code and am unable to pick up the object:

Undefined Variable in expression: dropaxeact, dropshovelact, etc.

Any help?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×