Jump to content
Sign in to follow this  
ReStrooke

3 Questions Please Help! :)

Recommended Posts

Hi Guys,

i have 3 questions in SQF.

So here they come:

Q 1:

Is it possible to spawn a bomb with setPos [getPos this select 0, getPos this select 1, getPos this select 2] and add to the 3 values another value. (Like getPos this select 0 + 20m)

Q 2:

Is it possible to show a picture in a hint?

Q 3:

Is it possible to give the units in a c130j a hint if the c130j is damaged?

I tried:

_unit = _this select 0;

if (getDammage _unit > 0.7) then

{

hint "Engine Dammage: 80%"

};

Problems: it doesn't give me a hint and if it work, it would show the hint to all players in the server.

Thanks for your answers :)

And additional:

The best way to execute the script? :)

Share this post


Link to post
Share on other sites

1. Sort of, though createVehicle is generally used for that sort of thing:

bomb = "Bo_GBU12_LGB" createVehicle [(getPos this select 0) + x, (getPos this select 1) + x, (getPos this select 2) + x];

If you are only adding an offset on the X-axis, then:

bomb = "Bo_GBU12_LGB" createVehicle [(getPos this select 0) + 20, getPos this select 1, 0];

which will spawn it on the ground 20 meters East of whatever "this" is.

There are also some instances where using getPosATL or getPosASL would be appropriate.

Edited by Harzach

Share this post


Link to post
Share on other sites

Q2: http://community.bistudio.com/wiki/hint <- look at the examples ;)

Q3: You have to remotely execute the hint on all players in the plane. Use RE, publicVariable/publicVariableEventHandler or setVehicleInit/processInitCommands.

There are several topics about remote execution of scripts in this forum, I'm sure you'll find a method which will work for you :)

Share this post


Link to post
Share on other sites

I'm veeeeery new to arma 2 scripting... :D

I don't get it with "remote execution". :D

---------- Post added at 19:52 ---------- Previous post was at 19:34 ----------

And how do i get the "main" script to work?

So in this case this part:

_unit = _this select 0;

if (getDammage _unit > 0.7) then

{

--- SCRIPT ---

};

Share this post


Link to post
Share on other sites

Hmm okay the easiest would be using RE, but everytime I post something using RE someone pops up refuting it, saying some really meaningfull things I already forgot xD

_unit = _this select 0;

if (getDammage _unit > 0.7) then
{
   {
       if (isPlayer _x) then {
           [nil,_x,"loc",rHINT,format ["Engine Damage: %1 %", str ((getDammage _unit) * 100)]] call RE;
       };
   } forEach (crew _unit);
}; 

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  

×