Jump to content
Sign in to follow this  
=101AD=Richard

Popup Target Reset Script

Recommended Posts

I am using one of Doolittles example scripts but its not working correctly, I took varouis targets and put them in building and on roofs using

this setPos [ getPos this select 0, getPos this select 1, (getPos this select 2) +2.6]; doopopup = doopopup + [this]

I tried to see if the first code messed up the 2nd which is the popup coding, only part of it. But it did not. So The only different from it working to not working is it is technically in or on a building. The problem is they fall and stay down which I want but when you try to reset them with the flag they do not reset

Share this post


Link to post
Share on other sites

This just adds the target into an array, an additional script has to be running.

If you didn't forget to include it please post it here so I we can have a look.

Share this post


Link to post
Share on other sites

Ok yes there are several files Ill post them all here

Popup.sqf

_this addeventhandler ["hit", "if (_this select 0 animationphase ""terc"" == 0) then {_this select 0 spawn {_this animate [""terc"", 1]; sleep 5; _this animate [""terc"", 0]}}"];

Resetpopup.sqf

{
_x animate ["terc", 0];
} foreach doopopup;
hint "Targets reset";

init.sqf This is also combined with the init.sfq for Doolittles Skeet script

enablesaving [false, false];

nopop = true;

if not isserver exitwith {};

launchskeet = false;
[] spawn {
while {true} do {
	waituntil {launchskeet};
	launchskeet = false;
	[] spawn {
		private ["_v", "_vel", "_i"];
		_v = "SkeetDisk" createvehicle getpos skeetmachine;
		_v setpos (skeetmachine modeltoworld [0, -0.6]);
		_v setvelocity [-9 * sin getdir skeetmachine, -9 * cos getdir skeetmachine, 10 + random 2];
		sleep 1;
		_vel = velocity _v;
		_i = 0;
		while {getpos _v select 2 > 0.1 and alive _v} do {
			_v setvelocity [(_vel select 0) / (1 + (_i / 10)), (_vel select 1) / (1 + (_i / 10)), (_vel select 2) / (1 + _i)];
			_i = _i + 0.1;
			sleep 0.1;
		};
		deletevehicle _v;
	};
};
};

Share this post


Link to post
Share on other sites

Unless I'm missing something you aren't using the first (Popup.sqf) script at all.

Where do you execute the second script from ?

BTW, what type of targets do you use? The red ones or the simpler blue ones?

Share this post


Link to post
Share on other sites
Unless I'm missing something you aren't using the first (Popup.sqf) script at all.

Where do you execute the second script from ?

BTW, what type of targets do you use? The red ones or the simpler blue ones?

I got it to work, I had to replace all the pop up targets for some reason

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  

×