Jump to content
Sign in to follow this  
SUPR3ME KILL3R

Useweapon, frustrating.

Recommended Posts

I have a video work in progress which features a scene of a civilian wounded next to a car, and an SLA soldier walking up and firing 3 rounds at him at close range, killing him.

That all works, except using the "USEWEAPON" code presents problems. This is the code to the script, no matter what I do to the loop, the SLA soldier fires only once, where I want him to fire 3 times.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_shooter = executer1

_logic = logic1

deadciv1 switchmove "ActsPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon_Injured3"

executer1 playmove "ActsPercMstpSnonWrflDnon_ArrestingSoldier"

~5

deadciv1 switchmove "AdthPsitMstpSlowWrflDnon"

_shots = 0

#FireAuto

_logic action ["useWeapon", _shooter, _shooter,0]

~0.5

_shots = _shots + 1

?_Shots >= 3:exit

goto "FireAuto"

Simply using the USEWEAPON code 3 times doesn't work

Loop doesn't work

But, adding 3 triggers and having them each use the USEWEAPON code with a delay inbetween works. I dont like this, because  I need to use the USEWEAPON code about 50 more times for this video (getting soldiers to fire during animations), and I dont want to add several hundred triggers just to get this to work...

Share this post


Link to post
Share on other sites

there is something wrong with your script, unrelated to the useWeapon line, maybe ?_Shots >= 3:exit

this script works as expected for me in a test mission :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit2 switchmove "ActsPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon_Injured3";

unit1 playmove "ActsPercMstpSnonWrflDnon_ArrestingSoldier";

sleep 5;

unit2 switchmove "AdthPsitMstpSlowWrflDnon";

gameLogic action ["useWeapon", unit1, unit1,12];

sleep 0.2;

gameLogic action ["useWeapon", unit1, unit1,12];

sleep 0.2;

gameLogic action ["useWeapon", unit1, unit1,12];

Share this post


Link to post
Share on other sites

I tried it without the loop and it still doesn't work.

EDIT: I've noticed that after using the Useweapon code in a script, everything that is supposed to happen afterward, fails to.

Well I got it to work, mostly... mad_o.gif

Sometimes it works and sometimes it doesn't it seems

Share this post


Link to post
Share on other sites

Try SQF:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_shooter = executer1;

_logic = logic1;

deadciv1 switchmove "ActsPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon_Injured3";

executer1 playmove "ActsPercMstpSnonWrflDnon_ArrestingSoldier";

sleep 5;

deadciv1 switchmove "AdthPsitMstpSlowWrflDnon";

_shots = 0;

while {_shots <= 3} do

{

_logic action ["useWeapon", _shooter, _shooter,0];

_shots = _shots + 1;

sleep 0.5;

};

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
Sign in to follow this  

×