OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: .pablo. on 26 Jun 2003, 05:43:01

Title: radio use in mp
Post by: .pablo. on 26 Jun 2003, 05:43:01
i have 8 playables who each start in one of 8 cars; everyone is in a seperate group

i want each person to be able to use the radio to instantly spawn his car 5 feet above where he is when he uses the radio.  how do i do it?
Title: Re:radio use in mp
Post by: Tactician on 26 Jun 2003, 16:41:48
You have to set up 1 radio trigger for each player.  Then, in your init, set the radio commands that don't correspond to the player to "NULL".

Example:  Your men are named driver1, driver2, driver3, etc.  Your cars are named car1, car2, car3, etc.

Radio Alpha
car1 setPos getPos driver1

Radio Bravo
car2 setPos getPos driver2

Radio Bravo
car3 setPos getPos driver3

etc. etc.

Code: [Select]
;; begin init.sqs snippet
?!(player == driver1): 1 setRadioMsg "NULL"
?!(player == driver2): 2 setRadioMsg "NULL"
?!(player == driver3): 3 setRadioMsg "NULL"
?!(player == driver4): 4 setRadioMsg "NULL"
?!(player == driver5): 5 setRadioMsg "NULL"
?!(player == driver6): 6 setRadioMsg "NULL"
?!(player == driver7): 7 setRadioMsg "NULL"
?!(player == driver8): 8 setRadioMsg "NULL"

Now, the driver only sees the radio command to return his car to him.  So driver1 would press 0-0-1, driver2 would press 0-0-2, etc.

It has to be this way because the activation of a radio command is public, and there's no way to determine who triggered the radio.  So unless you want everyone's car to return when 1 person triggers it, you have to separate them :)
Title: Re:radio use in mp
Post by: .pablo. on 26 Jun 2003, 23:16:13
thanks so much for your help, could i do it with an action command instead?
Title: Re:radio use in mp
Post by: Tactician on 27 Jun 2003, 02:58:56
You could.

(in each driver's init field)
this addAction ["Return Car","returncar.sqs"]

Code: [Select]
;; begin returncar.sqs
_driver = _this select 0
?(_driver == driver1): car1 setPos getPos _driver; exit
?(_driver == driver2): car2 setPos getPos _driver; exit
?(_driver == driver3): car3 setPos getPos _driver; exit
?(_driver == driver4): car4 setPos getPos _driver; exit
?(_driver == driver5): car5 setPos getPos _driver; exit
?(_driver == driver6): car6 setPos getPos _driver; exit
?(_driver == driver7): car7 setPos getPos _driver; exit
?(_driver == driver8): car8 setPos getPos _driver; exit
exit

Might work.
Title: Re:radio use in mp
Post by: .pablo. on 29 Jun 2003, 02:03:09
i have a trigger set to repeatable
condition: Radio Juliet
on activation: runs the nitro script

how do i make it disappear?  i can get it to not work, but it still shows up in the radio menu.  0 setradiomsg "" doesn't work...
Title: Re:radio use in mp
Post by: Chris Death on 29 Jun 2003, 02:55:58
1 setradiomsg "NULL"

will make RADIO-ALPHA disappear


2 setradiomsg "NULL"

will make RADIO-BRAVO disappear


Now guess, what will make RADIO-JULIET disappear  ;)


~S~ CD
Title: Re:radio use in mp
Post by: .pablo. on 30 Jun 2003, 00:05:52
doesn't work
Title: Re:radio use in mp
Post by: Killswitch on 03 Jul 2003, 15:39:22
Hmm... you're right - it seems that
Code: [Select]
0 setRadioMsg "null"won't work, i.e. the 0 radio menu option is still there...

Might be that it is special in some way...

EDIT: Aaaah haaa! (Gripping OFP by its neck) "Why you little..."

This, however
Code: [Select]
10 setRadioMsg "null"should do it, pablo!