Home   Help Search Login Register  

Author Topic: creating radio commands  (Read 1434 times)

0 Members and 1 Guest are viewing this topic.

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
creating radio commands
« on: 23 Oct 2007, 15:39:41 »
how do you create a radio command in a script rather than a trigger?
Campaigns are hard, I'll stick with scripting for now!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: creating radio commands
« Reply #1 on: 23 Oct 2007, 15:51:44 »
Do you mean how to create a radio-type trigger from a script? or how to create radio commands without trigger intervention?

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: creating radio commands
« Reply #2 on: 23 Oct 2007, 17:28:42 »
without the trigger would be good :D
Campaigns are hard, I'll stick with scripting for now!

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: creating radio commands
« Reply #3 on: 23 Oct 2007, 17:54:24 »
Defining radio commands uses radio triggers; That is how they work! You can either use the mission-editor to place a global radio trigger or use createTrigger in a script to create a local radio trigger. I think that is why Mandoble was asking for clarification, since you might have meant "without a global editor-placed trigger" (the answer being: use createTrigger and configure it with the associated commands) or "without a trigger at all" (the answer being: you don't in a script, but I think you can with config in an addon).
« Last Edit: 23 Oct 2007, 18:02:04 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: creating radio commands
« Reply #4 on: 23 Oct 2007, 20:03:07 »
hi Surdus Priest,

I echo Spooner's comment, here is another way to create a radio command within a script (you will have to tweak this some obviously):

http://www.ofpec.com/ed_depot/index.php?action=details&id=413&page=0&game=ArmA&type=tu&cat=xyz

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: creating radio commands
« Reply #5 on: 23 Oct 2007, 21:27:55 »
That isn't another way to create a trigger; it is just a example script showing how to use createTrigger in a very specific way which doesn't even mention radio triggers. Also, it doesn't make sense to use that technique of turning a trigger on and off for a radio trigger, by creating and destroying it, since then it would appear and disappear on the walkie-talkie :whistle:

Sorry, I'm trying to tell Surdus Priest that this isn't a good answer for him, not say there is anything wrong with Lee's tutorial.
« Last Edit: 23 Oct 2007, 21:40:48 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: creating radio commands
« Reply #6 on: 24 Oct 2007, 10:16:32 »
Here's an example on how to create a working radio trigger. Look up each of the commands used in the comref to see what possible settings you can have:

Code: [Select]
_trig = createTrigger ["EmptyDetector", (getpos Player)]
_trig setTriggerArea [0, 0, 0, false]
_trig setTriggerActivation ["ALPHA", "PRESENT", true]
_trig setTriggerStatements ["this", "hint ""Trigger activated""", ""];
1 setRadioMsg "Alpha Radio"

This will create a repeating radio Alpha (0-0-1) radio trigger that will hint "Trigger activated" whenever used. Its radio message will be "Alpha Radio". I believe the above are the minimum statements you need to create a properly working trigger.  :)

Note: if you want to delete the trigger, you need to use deleteVehicle _trig: so if you want to access it in other scripts you might want to give it a global, not a _local name. Also, making the trigger invisible for the moment is easily done by writing 1 setRadioMsg "NULL". 1 = radio Alpha. You can have an endless amount of triggers activated by Radio Alpha, all doing different things, and wether they activate or not can be dependent on the conditions you set in the triggerStatements command.

Good luck!  :good:

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"