Jump to content
Sign in to follow this  
epicgoldenwarrior

Few more questions

Recommended Posts

Regarding:

-setObjectTexture

-addactions

-other questions I cant remember right now

-------

So, I put the file "digi.jpg" in the mission folder. For a unit, I put in the init "this setObjectTexture [0,"digi.jpg"];"

And whatever else I have in his init (change of weps/gear before this line)

If I go into multiplayer (it is a coop) I can see the camo on my friend yet not on me. He can't see anything different.

If I add global at the end, I get an error message before it starts and my guys are floating in air, my friend see's all black camo. How do I fix this?

----Q2

Addaction for coop - If I have "arm bomb" then "defuse" it doesnt work. The other side arms the bomb, but just like an other player, they have their "own" thing and they can arm and then defuse too. If that makes sense. Also when you arm it in the script, setobjtext is supposed to change color or arrow, yet it only does that if you arm it yourself - for the rest of the players, it's still blue.

----Q3

Any way I can throw an IR nade onto a truck and get task succeeded, rather than event handle throw?

--------

Thanks for any replies, if something isn't clear just ask. Appreciate any help :)

Share this post


Link to post
Share on other sites

#2- addActions are local unless otherwise set up with either get/set public variables, BIS_fnc_MP, or maybe a couple other ways. But in any case your going to have to interface some MP scripting into your addAction script to make it all work properly, the way you want.

Share this post


Link to post
Share on other sites

#1

what is the error you get?

#2

In this case, it might be beneficial for you to learn about publicVariable's. In the condition field of addAction, you can then check if a certain variable has a certain value. Example:

_obj addAction ["Arm Bomb",
{
GLOBAL_bomb = "DEFUSE";
publicVariable "GLOBAL_bomb";
}, [], 6, true, true, "", "GLOBAL_bomb == 'ARM'"];

_obj addAction ["Defuse Bomb",
{
GLOBAL_bomb = "ARM";
publicVariable "GLOBAL_bomb";
}, [], 6, true, true, "", "GLOBAL_bomb == 'DEFUSE'"];

Make sure you put GLOBAL_bomb = "ARM" in init.sqf

#3

You can try doing something with triggers and keeping it attached to the truck:

if (isServer) then
{
this spawn
{
	while {true} do
	{
		_this setPosATL (getPosATL myTruck);
	};
};
};

Share this post


Link to post
Share on other sites

Q1 - Use setObjectTextureGlobal

this setObjectTextureGlobal [0, "digi.paa"];

Q3 - I suppose something like this should get you in the ball park.

this addEventHandler ["fired",{ _this execVM "grenade.sqf" }];

grenade.sqf

_weapon = _this select 1;
_ammoType = _this select 5;
_projectile = _this select 6;

if (_weapon == "THROW" && {_ammoType == "I_IR_Grenade"} ) then {
waitUntil { ( speed _projectile ) == 0 };
if ( _projectile distance myTruck < 5 ) then { 
	// attach to truck and complete objective
};		
};

Edited by Iceman77

Share this post


Link to post
Share on other sites

Cant seem to find error anymore. Idk will test more.

Forget the addaction thing, too complicated I suppose, mission wasnt that important anyway

Ill test the truck one from Iceman. Does the first part go into init?

Share this post


Link to post
Share on other sites

What I posted is for the unit's init. this points to the object. In your case, an infantry.

If you want to add it to an .sqf then use

if ( !(isDedicated) ) then { 
   waitUntil { !( isNull player ) };
   waitUntil { // optional
       someCondition
   };
   player addEventHandler ["fired",{ _this execVM "grenade.sqf" }]; 
};

Share this post


Link to post
Share on other sites

Ok. Well, new question

I created my own buildings with an invisible helipad, but I want to set its height. Setting the helipads height wont work and neither will attachTo an object.

I also tried this "this setPosATL [(getPosATL this) select 0, (getPosATL this) select 1, 70];"

But that doesnt work either. The building (land_offices) won't budge.

How do I change the height of it?

Share this post


Link to post
Share on other sites

Are you saying that you used the object, invisible helipad, and put all the building creation stuff in the init field of the helipad? In that case, I would use a game logic (object) for the creation of the building, then see if the setPosATL command will work with that. You may also have to use enableSimulation as well, but I'm not sure.

Share this post


Link to post
Share on other sites
Are you saying that you used the object, invisible helipad, and put all the building creation stuff in the init field of the helipad? In that case, I would use a game logic (object) for the creation of the building, then see if the setPosATL command will work with that. You may also have to use enableSimulation as well, but I'm not sure.

Yep. I'll give it a shot then.

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  

×