OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Trasher on 17 Aug 2004, 10:07:59

Title: action-prob
Post by: Trasher on 17 Aug 2004, 10:07:59
ok i just want W2 to have the action but anyone near him gets it heres the scripts

W2s init;

W2 addaction ["Call for air strike","Bombing.sqs"]

Bombing.sqs;

onMapSingleClick {[_pos] exec "airstrike.sqs"}; strikePilot sideChat "Give me a target"

and then the airstrike scrips goes

plz help its very anoying because i just want the radio operator to use it =(
Title: Re:action-prob
Post by: Mud_Spike on 17 Aug 2004, 10:11:45
One solution, which does not remove the action from other units though (dont know if thats possible):
Code: [Select]
if (_this select 1 != myRadioOperator) then { myRadioOperator GroupChat "HEY, GET YOUR FILTHY HANDS OFF MY RADIO"  ; exit }
[foo] exec "airscript.sqs"

Syntax not guaranteed.
Title: Re:action-prob
Post by: macguba on 17 Aug 2004, 11:02:56
This is a "feature" of actions:   they are available to any unit who is close to the object (namely you) that has the action attached to it.      

There is nothing you can do about it appearing, though as Mud_Spike suggests you can prevent other units from using the action.
Title: Re:action-prob
Post by: Trasher on 17 Aug 2004, 11:17:49
but when you play Cti only the commander have the Build menu even if you are close to him you dont get it!  if nobody knows how this is working i try the hands of radio thingy  ;)  anyways thx
Title: Re:action-prob
Post by: macguba on 17 Aug 2004, 11:24:41
Well, if you know a mission where it works then unpbo it and see how its done.    I'd be delighted to be proved wrong on this.
Title: Re:action-prob
Post by: Trasher on 17 Aug 2004, 11:28:02
i will check this out but it will be hard because cti i just a script-mess  :-[
Title: Re:action-prob
Post by: Trasher on 17 Aug 2004, 11:42:11
sry macguba it to advanced for me i dont understand a s**t  it just execs new scripts all the time =( sry i let you down  :'(
Title: Re:action-prob
Post by: macguba on 17 Aug 2004, 11:55:54
Lol don't worry m8, at least you tried.    :thumbsup:
Title: Re:action-prob
Post by: Trasher on 17 Aug 2004, 12:07:36
well well cant you explain that "Get your hands of the radio" thingy a little bit more detailed i give it a try  :D
Title: Re:action-prob
Post by: LCD on 17 Aug 2004, 14:53:15
easy just like that (ill put the script in beter way w/ explenation ;))

Code: [Select]
if (_this select 1 != _this select 0) then { _this select 0 GroupChat "HEY, GET YOUR FILTHY HANDS OFF MY RADIO"  ; exit }
[foo] exec "airscript.sqs"

if (_this select 1 != _This select 0) : this part checks the condition.... so if the man that choose the action (_this select 1) is not the man that theaction is attached 2 (used the addaction on, _This select 0) the man who got the radio (_this select 0) will say the groupchat and then the script will exit.... else it will continue w/ watever u put in the script

:cheers:

LCD OUT
Title: Re:action-prob
Post by: Trasher on 17 Aug 2004, 18:01:28
ok should i put in the units name somewhere ?? and they are not in the same group so can i change to Sidechat ?? anyway that helped =)
Title: Re:action-prob
Post by: Mud_Spike on 17 Aug 2004, 18:38:50
Quote
ok should i put in the units name somewhere ??
No, with LCD's addition you dont need to keep track of who owns the action.

Quote
and they are not in the same group so can i change to Sidechat
Changing it to a SideChat, GlobalChat, or whatever will work just fine.
Title: Re:action-prob
Post by: Trasher on 19 Aug 2004, 15:04:42
ok this is a little bit embarrasing but that part
with foo who is he??? i dont get it??? this is a little bit to hard to me im a "semi-n00b"  ;)

[foo] exec "airscript.sqs"
Title: Re:action-prob
Post by: Planck on 19 Aug 2004, 20:28:47
Just replace 'foo' with whatever name you gave your unit or group.


 foo was just an example name.

Planck
Title: Re:action-prob
Post by: Trasher on 20 Aug 2004, 17:12:29
ok heres one of the final parts i dont get should this be another script or should it be in the Bombing.sqs ?? anyways thx
Title: Re:action-prob
Post by: Mud_Spike on 20 Aug 2004, 18:16:30
W2s init;

W2 addaction ["Call for air strike","Bombing.sqs"]

Bombing.sqs;
Code: [Select]
if (_this select 1 != _this select 0) then { _this select 0 GroupChat "HEY, GET YOUR FILTHY HANDS OFF MY RADIO"  ; exit }

onMapSingleClick {[_pos] exec "airstrike.sqs"}; strikePilot sideChat "Give me a target"
Title: Re:action-prob
Post by: General Barron on 20 Aug 2004, 20:36:12
but when you play Cti only the commander have the Build menu even if you are close to him you dont get it!  if nobody knows how this is working i try the hands of radio thingy  ;)  anyways thx

I believe that if you add an action to a unit when they are in a vehicle, then only that person or people in the vehicle can use the action. You'll also notice that when you get into a vehicle, all your actions that were added will go away until you get back out. Could be wrong though.
Title: Re:action-prob
Post by: Trasher on 20 Aug 2004, 22:56:00
but you doesnt start in a vehicle!  ???  anyone who knows mike melvin cant you ask him  ;) anyways thx
Title: Re:action-prob
Post by: General Barron on 21 Aug 2004, 02:38:42
but you doesnt start in a vehicle!  ???  anyone who knows mike melvin cant you ask him  ;) anyways thx

No, but you can detect when you get into the vehicle via a script, and add the action then, and also remove it if needed by detecting when you get out of the vehicle.
Title: Re:action-prob
Post by: Trasher on 21 Aug 2004, 10:49:38
maybe you get in and out of the Hq tank in the beginning when the map is up =)