Hi Mandoble!
My T-key problem is more complicate as I thought, so I move our discussion from PM to here the forum.
It's a little bit OFF topic, but I hope you could help me.
I stole one of your script from Mando Missile example, when you triggered the missile to a laser target with pressing T-key.
In ArmA mission editor it's work fine. If I save the mission as Single Mission, it's work fine. But when I PBO as a campaign, doesn't work.
A thought: OK, preesing a key doesn't work in campaign, so I will change the triggering mechanism to Action Menu. And I made a new menu item, which triggered the same script, except the 'if' pressing button. And the effect was same: in editor or single mission works fine, but in campaign doesn't. So the problem is in the script not the triggering mechanism.
This is the script (I rework it a little bit):
_launcher = launcher;
_dirini = 0.0;
_lasers = [];
_firstlaser = objNull;
if (rockets > 0) then
{
_lasers = (getPos player) nearObjects["LaserTarget",1000];
if (count _lasers > 0) then
{
player sideChat format["%1 I have a target for you", name gunner _launcher];
Sleep 2;
_firstlaser = _lasers select 0;
gunner _launcher sideChat format["Roger %1, missile on the way, keep the laser lock.", name player];
if (!isNull _firstlaser) then
{
_missilebody = "Bo_GBU12_LGB";
_dir = getDir _launcher;
_pos = _launcher modelToWorld [0,2,1.25];
_vangle = 30;
_speedini = 5;
_speedmax = 150;
_acceleration = 1;
_target = _firstlaser;
_boomrange = 2;
_activerange = 600;
_modeinit = 0;
_cruisealt = 180;
_boomscript = "mando_missiles\warheads\mando_missilehead2a.sqf";
_smokescript = "mando_missiles\exhausts\mando_missilesmoke1a.sqf";
_soundrsc = "";
_sounddur = 29;
_endurance = 60;
_terrainavoidance = true;
_updatefreq = 999;
_delayinit = 0;
_timetocontrol = 0;
_detectable = false;
_debug = false;
_launchscript = "";
_res = [_launcher, _missilebody, _pos, _dir, _vangle, _speedini, _speedmax, _acceleration, _target, _boomrange, _activerange, _modeinit, _cruisealt, _boomscript, _smokescript, _soundrsc, _sounddur, _endurance, _terrainavoidance, _updatefreq, _delayinit, _timetocontrol, _detectable, _debug, _launchscript]execVM"mando_missiles\mando_missile.sqf";
rockets = rockets - 1;
}
else
{
gunner _launcher sideChat format["Sorry %1, there is no laser signal.", name player];
};
}
else
{
gunner _launcher sideChat format["Sorry %1, there is no laser signal.", name player];
};
}
else
{
gunner _launcher sideChat format["Sorry %1, we ran out of missiles.", name player];
};
And this is the line in the init.sqs:
player addAction ["Tomahawk", "tomahawk.sqf", [], 5, false, false, "T"]