Jump to content
Sign in to follow this  
dame2010

stargate multiple texture script help

Recommended Posts

Hi all i hate asking for help but im stuck on this.

i have 2 stargates which i call gate1, gate2 and exec with [gate1,gate2] exec "gate.sqf" .

Im going to use a addaction to exec it . i would of thought gate1 = _fromGate , gate2 = _togate and it would run through the textures but i cant seen to see where i went wrong.

I want to be able to reuse the same script for gate3,gate4 and so on.

Any help would be great.

Thanks

private ["_fromgate", "_togate"];

// Parameter

_fromGate = _this select 0;

_toGate = _this select 1;

// Variables

gate_start = true;

//--- gate textures ;

if (gate_start) then {

[_fromGate, _toGate] spawn {

_fromGate = _this select 0;

_toGate = _this select 1;

_textures = [

"\SGImages\gate\init1.paa", "\SGImages\gate\init2.paa", "\SGImages\gate\init3.paa", "\SGImages\gate\init4.paa",

"\SGImages\gate\init5.paa", "\SGImages\gate\init6.paa", "\SGImages\gate\init7.paa", "\SGImages\gate\init8.paa",

"\SGImages\gate\init9.paa", "\SGImages\gate\init10.paa", "\SGImages\gate\init11.paa", "\SGImages\gate\init12.paa",

"\SGImages\gate\init13.paa", "\SGImages\gate\init14.paa", "\SGImages\gate\init15.paa", "\SGImages\gate\init16.paa",

"\SGImages\gate\init17.paa"

];

{

_fromGate setObjectTexture [18, _x];

_toGate setObjectTexture [18, _x];

sleep 0.1;

} forEach _textures;

};

};

Share this post


Link to post
Share on other sites

Seems overly complicated script.

Maybe try; (untested)

_fromGate = _this select 0;
_toGate = _this select 1;

{
_fromGate setObjectTexture [18, _x];
_toGate setObjectTexture [18, _x];
sleep 0.1;
} forEach ["\SGImages\gate\init1.paa", "\SGImages\gate\init2.paa", "\SGImages\gate\init3.paa", "\SGImages\gate\init4.paa",
"\SGImages\gate\init5.paa", "\SGImages\gate\init6.paa", "\SGImages\gate\init7.paa", "\SGImages\gate\init8.paa",
"\SGImages\gate\init9.paa", "\SGImages\gate\init10.paa", "\SGImages\gate\init11.paa", "\SGImages\gate\init12.paa",
"\SGImages\gate\init13.paa", "\SGImages\gate\init14.paa", "\SGImages\gate\init15.paa", "\SGImages\gate\init16.paa","\SGImages\gate\init17.paa"];

Share this post


Link to post
Share on other sites


start = true;
gate_middle = true;







			while {start} do
{


		_textures = [
				"init1.paa", "init2.paa", "init3.paa", "init4.paa",
				"init5.paa", "init6.paa", "init7.paa", "init8.paa",
				"init9.paa", "init10.paa", "init11.paa", "init12.paa",
				"init13.paa", "init14.paa", "init15.paa", "init16.paa",
				"init17.paa" 
				];

				{
						gate1 setObjectTexture [18, _x];
						gate2 setObjectTexture [18, _x];
					sleep 0.1;
				} forEach _textures;start = false;
			};


while {gate_middle} do {






	_textures = [
	"01.paa", "02.paa", "03.paa", "04.paa",
	"05.paa", "06.paa", "07.paa", "08.paa",
	"09.paa", "10.paa", "11.paa", "12.paa",
	"13.paa", "14.paa", "15.paa", "16.paa",
	"17.paa", "18.paa", "19.paa", "20.paa",
	"21.paa", "22.paa", "23.paa", "24.paa",
	"25.paa", "26.paa", "27.paa", "28.paa",
	"29.paa", "30.paa", "31.paa", "32.paa",
	"33.paa", "34.paa", "35.paa", "36.paa",
	"37.paa", "38.paa", "39.paa", "40.paa",
	"41.paa", "42.paa", "43.paa", "44.paa",
	"45.paa", "46.paa", "47.paa", "48.paa",
	"49.paa", "50.paa", "51.paa", "52.paa",
	"53.paa", "54.paa", "55.paa", "56.paa",
	"57.paa", "58.paa", "59.paa", "60.paa",
	"61.paa", "62.paa", "63.paa", "64.paa",
	"65.paa", "66.paa", "67.paa", "68.paa",
	"70.paa", "71.paa", "72.paa", "73.paa",
	"74.paa", ""
	];


		{
			gate1 setObjectTexture [18, _x];
			gate2 setObjectTexture [18, _x];
			sleep 0.2;

		} forEach _textures;gate_middle = false;

	};







---------- Post added at 08:47 PM ---------- Previous post was at 08:27 PM ----------

thanks for the help [APS]Gnat

how would i use [gate1,gate2] exec "gate.sqf" to start the first script i posted. why dont _fromGate = _this select 0; _toGate = _this select 1; become gate1 and gate2

Share this post


Link to post
Share on other sites
I can get it to work like this, but i had to name the gates, gate1 and gate2

!! :confused: Huh?

You will always have to name the gates. The game and script are not psychic, they can't guess which objects you're wanting to pass to the script.

If you had just 2 gates on a map, maybe a special script could search the terrain for the gates, then pass those gates to a script ..... but not as simple obviously

If you have more than 2 gates then the script has no way to guess which 2 gates you want to use.

Maybe it could guess one gate is the one youre (player) is closest too, but it won't know which is the other.

Unless you have some global defined matrix/array that matches pairs of gates ..........

Share this post


Link to post
Share on other sites

as you can see from the above script i had to take the Texture out of the texture folder and put them in with the mission.sqm folder to get it to work. now it looks a mess. It seems that where the \SGImages\gate\init.paa are thats why its not working. but it will work with just init.paa. So im thinking my gate1 ,gate2 setObjectTexture [18, _x] has to be more like a object SetObjectTexture [0,"image\image.paa"]; i have tryed setObjectTexture [18,\SGImages\gate\ _x] and setObjectTexture [18,"\SGImages\gate\ _x"] but with no luck

any ideas would be great

Share this post


Link to post
Share on other sites

ok i see where i went wrong. i had a , in here "70.paa", "71.paa", "72.paa", "73.paa","74.paa" see --> , ]; and thats why it didnt work. also changed it to while { gate_start } do {

Thanks for the help Gnat

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  

×