Jump to content
Sign in to follow this  
[lol]clan killer bee

Trigger assigned !

Recommended Posts

Ello  !

I have a question about a part of script !

I was looking to a mission htat had this script in it  !

Quote[/b] ]mi24 DoTarget boat2; mi24 DoFire boat2

This seemed to work nicely.

Now I want to make a trigger that can be hooked to a mgpost (press F2 and hooked the trigger to the mgpost )

I'm not a hero in scripting but I kindda came up with this

Quote[/b] ]_gunner DoTarget _x; _gunner DoFire _x

This seems not to give the result like I would like to see.

I also tried to give it a name like this

Quote[/b] ]mg1 DoTarget _x; mg1 DoFire _x

this give also errors  !

I think I need to do something with breakets, ubt have no idea is there someone wh ocan help me a hand !

Thanks ! help.gif

Share this post


Link to post
Share on other sites

Hi,

I take it you want the MG to fire at every valid target in the Trigger?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_MGPost=_This Select 0

_Trigger=_This Select 1

_Gunner=Gunner _MGPost

{_Gunner DoTarget _x; _Gunner DoFire _x} ForEach (List _Trigger)

Although you might be able to leave it to OFP to decide the best target:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_MGPost=_This Select 0

_Trigger=_This Select 1

_Gunner=Gunner _MGPost

{_Gunner Reveal _x} ForEach (List _Trigger)

Quote[/b] ]Now I want to make a trigger that can be hooked to a mgpost (press F2 and hooked the trigger to the mgpost )

If you notice the trigger is assigned to the MG post using the script. I think the F2 mission editor option will just make the trigger detect the squad it's been assigned to. Which you don't want in this case.

Share this post


Link to post
Share on other sites

Don't I have to specify the list where the script is refering too ? whistle.gif

hmm so I should make a .sqs file put in the script and activated it by putting in the mg initfield

Quote[/b] ]this exec "fire.sqs";

?

Or do I miss the point now ?

Share this post


Link to post
Share on other sites

You should call the script like

[_mgunname, _triggername] exec "fire.sqs".

Share this post


Link to post
Share on other sites

Bee,

Another more simple way of doing this.

In the on activation for the trigger put:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{mg1 reveal _x} forEach thisList

or:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{(gunner mg1) reveal _x} forEach thisList

Not sure which works better. It should not make a difference. No script required!

Share this post


Link to post
Share on other sites

why not go the whole hog smile_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{mg1 reveal _x} forEach thisList;{mg1 DoFire _x} forEach thisList

and repeat trigger. if ya let him decide tho he will scan have a look and go safe, unless they fire at him.

Share this post


Link to post
Share on other sites

I love you guys this is working great thanks Peanut and Deano's ! notworthy.gif

Is this script only for teh mg or can you use this in more stuff like  a mi24 or a zu 23-2 rebel AA ? whistle.gif

Yep it works, I had problems with it but that was because I hate my man on SetCaptive banghead.gif

Now it works fine !

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  

×