On and off trigger script
Moderator: Moderators
-
bodybagger
- Sergeant
- Posts: 52
- Joined: Mon Jan 06, 2003 5:27 pm
On and off trigger script
Can someone help me with a small script?
I have a plane that does a bomb run. there is a radio with a trigger use and targetnamed bombertrigger.
Now i want the allies to activate the trigger and call an air strike and the axis to be able to de-activate it,
Could some please help,
Thanks
I have a plane that does a bomb run. there is a radio with a trigger use and targetnamed bombertrigger.
Now i want the allies to activate the trigger and call an air strike and the axis to be able to de-activate it,
Could some please help,
Thanks
Just a few variables will do it, but you can't use a 'bombertrigger' in this case, for it doesn't allow a team check. Give the trigger a key 'setthread' with value for example 'airstriketrigger'.
In your script, type something like this:
In your script, type something like this:
Code: Select all
airstriketrigger:
local.triggerer = parm.other
if(local.triggerer.dmteam == axis)
{
// deactivate the trigger
$<triggername> nottriggerable
}
else
{
// must be allies
// airstrike code here (or use script to trigger a $bombertrigger)
}
end
-
bodybagger
- Sergeant
- Posts: 52
- Joined: Mon Jan 06, 2003 5:27 pm
I am still having problems, nothing seams to happen!!!
I have the trigger set up as follows:
$triggername airstrike
$setthread airstriketrigger
Which trigger should i use. I tried bot trigger_use and trigger_multiple
Here's my code:
I have the trigger set up as follows:
$triggername airstrike
$setthread airstriketrigger
Which trigger should i use. I tried bot trigger_use and trigger_multiple
Here's my code:
Code: Select all
/////////////////////////////
//// airstrike ////
////////////////////////////
airstriketrigger:
local.triggerer = parm.other
if(local.triggerer.dmteam == axis)
{
// deactivate the trigger
$airstike nottriggerable
iprintlnbold_noloc "The Axis have called of the air strike!"
}
else
{
// must be allies
thread callairstrike
iprintlnbold_noloc "The Allies have called an air strike!!"
}
end
//////////////////////
/// call air stike///
/////////////////////
callairstrike:
wait 1.0
thread global/bomber.scr::bomb 40
wait (randomint(50) +20)
goto callairstrike
endmore
I think you need to explain better what you want to happen. Do you want the bombs to drop until the axis turn it off, or do you want there to be a timer the axis can turn off before the airstrike begins?
Here is what I have so far, but I'm not sure it is what you want.
You should take out the "setthread" from the trigger_use, and put "thread airstriketrigger" under "level waittill prespawn" for the above script to work.
Here is what I have so far, but I'm not sure it is what you want.
Code: Select all
////////////////////////////
//// airstrike ////
////////////////////////////
airstriketrigger:
level.airstriketimer = 0
level.controllingteam = "axis"
while (1) // This line has been changed....
{
$airstrike waittill trigger
local.player = parm.other
if ((local.player.dmteam == "axis") && (level.controllingteam == "allies"))
{
iprintlnbold_noloc "The Axis have aborted the air strike!!"
goto airstriketrigger
break
}
if ((local.player.dmteam == "allies") && (level.controllingteam == "axis"))
{
iprintlnbold_noloc "The Allies have called an air strike!!"
level.controllingteam = "allies"
}
if (level.airstriketimer >= 60)
{
thread callairstrike
iprintlnbold_noloc "Bombers on the way!!"
$airstrike nottriggerable
break
}
level.airstriketimer ++
iprintln ("60 second timer = " + level.airstriketimer)
wait 1
}
waitframe
end
//////////////////////
/// call air stike///
/////////////////////
callairstrike:
wait 1.0
thread global/bomber.scr::bomb 40
wait (randomint(50) +20)
goto callairstrike
end
Last edited by tltrude on Mon May 05, 2003 1:51 pm, edited 6 times in total.
-
bodybagger
- Sergeant
- Posts: 52
- Joined: Mon Jan 06, 2003 5:27 pm
Tom, yeah i like your idea of having a timer, never thought of that.
I will try it out later.
I want the allied to call an airstrike which randomly happens with re-peat bombing and the axis have to switch of the airstrike radio.
Just some questions, when ever the game starts or re-starts the trigger some how activates depending on which side you are on without doing anything. Thats what i got from using the script that i posted above.
The other q? is which would be the right trigger to use?
I will try it out later.
I want the allied to call an airstrike which randomly happens with re-peat bombing and the axis have to switch of the airstrike radio.
Just some questions, when ever the game starts or re-starts the trigger some how activates depending on which side you are on without doing anything. Thats what i got from using the script that i posted above.
The other q? is which would be the right trigger to use?
re-read
I have been updating the script while you were posting, so re-copy it. Use a trigger_use (no setthread) and targetname it "airstrike". And, put "thread airstriketrigger" under "level waitill prespawn".
key: targetname
value: airstrike
And, check my spelling in the script because I keep misspelling airstrike!!! LOL!
Is this an objective in an objective match?
key: targetname
value: airstrike
And, check my spelling in the script because I keep misspelling airstrike!!! LOL!
Is this an objective in an objective match?
-
bodybagger
- Sergeant
- Posts: 52
- Joined: Mon Jan 06, 2003 5:27 pm
-
bodybagger
- Sergeant
- Posts: 52
- Joined: Mon Jan 06, 2003 5:27 pm
-
bodybagger
- Sergeant
- Posts: 52
- Joined: Mon Jan 06, 2003 5:27 pm

