OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: jphilapy on 25 Jan 2006, 11:43:35
-
I want to simulate a player making a radio call via sidechat when he enters into a trigger. Say the players name is "jphilapy" then when he enters into the trigger the sidechat will show something similar to Jphilapy: "need a chopper pickup."
Essentially this needs to be able to get the name of whatever player enters into the trigger since this is a multiplayer mission.
Thanks,
Jeff
-
try:
((list triggerName) select 0)
toget the unit that triggered it. Not 100% sure whether it will work as it will get a list of anyone in the trigger, but I'm hoping that the list will start from first to enter thru last. But I'm dreading that won't be the case.
Worth a try though ;)
-
You need one trigger:
Condition: ("Man" counttype thislist) > 0
Activation: speaker = thislist select 0; speaker sideChat format ["%1: I need a chopper", name speaker]
This is what happens:
*The trigger reacts when any man class unit enters the trigger area (it will not react to cars or air units; if you want to include cars you change "Man" to "Land").
*The unit who made the trigger "fire" is thislist select 0. The first line of the activation field labels him speaker.
*The format command checks the name used by the player who is labeled speaker and adds it to the text displayed by the sideChat.
Syntax from memory, but technique is tested and working in MP without publicVariable.
-
would this also work for radio triggers nominesine ?
what i want to do is have a radio trigger activate a script in the normal way - but for this to happen ONLY on the client/player which activates the radio trigger.
so would this work ?
radio alpha
repeatedly
condition: this
activation: activator = thislist select 0; [activator] exec "radioscript.sqs"
then inside radioscript.sqs the top line will be:
?!(player == activator): exit
hence the script has the ability to sort-out the caller from the non-callers
-
would this also work for radio triggers nominesine ?
I've never tried it, but my guess is: Yes it works.
I can't see any reason why a radiotrigger would be different.
EDIT: I would change the line inside the radioscript.sqs to
? player != activator: exit
I'm not sure if your quoted syntax will work.
-
has anyone tried this yet ?
my access to a dedicated server is still not satisfactory....
-
The List of a Radio trigger is empty when activated, so I basicly assume that this method does not work.
I have an old method using two triggers, a Delay, and a two Public Variables that can tell you who activated it.
On a side note, the application I used it for ended up resulting in INSATIABLE amounts of LAG for the server computer, to the point of AI (no matter their skill) becoming as stupid as one can get, including reaction times of up to 1 full minute.
Needless to say, I need to look into that a little more.
I'll probably post the procedure in about a day or so, when I get home.