Jump to content
Sign in to follow this  
Lucky44

Checking unit name in Radio Trigger???

Recommended Posts

I'm trying to limit the use of a radio trigger (e.g., Radio Alpha) to 3 units. I can do it using Player names, but I can't figure out how to limit it by unit names. And I can do it in an area trigger, but not a radio one.

I know there must be a way, but I can't see it! Any ideas?

Share this post


Link to post
Share on other sites

No one has any idea? I can't even tie ONE unit name to a radio trigger (i.e., limit the radio to one unit) at this point. :(

Share this post


Link to post
Share on other sites

AWESOME! That will do it, perfectly. I knew it couldn't be too hard, but for some reason, I was just missing that simple syntax. Thanks much!

For others who might be interested, here's the info:

------------------------------------------------------------------

As you've already worked out you need to allow anyone to try and use the radio but limit it to the actual unit by using the On Act box.

if (player == p36) then { hint "Roger That"};

If you want several player to use the radio then in a game logic place all the names into an array

array1= [ p34,p35,p36]

and in the On Act of the trigger

if (player in array1) then { hint "Roger That"};

---------- Post added at 05:19 PM ---------- Previous post was at 04:59 PM ----------

EXCEPT there's one problem: this doesn't seem to work in Multiplayer. Is there a way to make it work?

Share this post


Link to post
Share on other sites

I don't have MP setup so I can't test it.

Yea I can see now that would be a problem.

If any player is p34,p35,p36 then when someone else uses the radio it will be true.

This can't happen in single player.

The only thing you could do is give them an addaction command .

Or your still back to trying to find out who used the radio.

Share this post


Link to post
Share on other sites

Hmm, addAction. That should work fine. Slightly clunky on the controls, but at least it does the job.

Thanks again!

Just in case anyone else wants to know a way to do this, here's what I'm doing.

I'm putting these "two" lines of code in the Init box of the unit I'm calling my Artillery Spotter:

this addAction ["",""]; this addAction ["Call artillery strike!","boomboom.sqf"]

The first action is a fake, a place holder. If you only used the second one, the action that really lets you call the boomboom.sqf script, the option to use the action is always sitting in the middle of the unit's screen. The first one, the place holder, helps avoid that problem.

EDIT: small problem, for some situations...once you add the action to a unit, any player can walk up to the unit and activate the action! Back to the drawing board to figure a workaround!

Edited by Lucky44

Share this post


Link to post
Share on other sites

You would think it would a simple thing to find the radio operator but without a command were stuck.

I did happen across another command _uid = getPlayerUID player;

using this it may be possible to find the players ID number.

_uid = getPlayerUID p35;

Then you could check that number in the trigger rather than the units name (p35).

I can't test any of this as it will only work in multiplayer.

http://community.bistudio.com/wiki/getPlayerUID

http://armaholic.com/forums.php?m=posts&q=8700

Share this post


Link to post
Share on other sites

OK, just an update: I've put the addAction on a backpack (I prefer the UAV Terminal one), just like this:

this addAction ["Call artillery strike!","boomboom.sqf"]

This works well in MP. It gives you an object that someone can pick up and take with them, then "drop" and use. We noted that others could NOT use it when it was being worn, so someone can't accidentally fire it from behind you. It has to be dropped for the newly added Action to be functional.

We did have a little glitch once when our group (The Art of Warfare, TAW.net) ran the mission with it last night. When the big moment came to call the artillery strike, I let someone else do it, and after a few seconds, it didn't seem to be working, so I hurriedly activated it myself. But in previous MP tests, either of us could do it.

Now, on to getPlayerUID. I'm having trouble with this. I was looking at the Armaholic post you linked, F2kSel, and I can't quite follow how ablueman is using it. WHEN is he calling it? HOW is he calling it?

Is it possible to put it in a Radio Trigger? How would that need to be scripted?

Share this post


Link to post
Share on other sites

It sounds like your doing well so far.

I can see how they get the ID but I can't really see how to link it to the radio as it still involves using a trigger.

I've also been told that player in a trigger is local, that being said I can't see why it wouldn't have worked before.

You could try a little test next time to check it out.

place a radio trigger and in the on act box put

player setdamage 1

It would be interesting to see if all or just the player using the radio dies.

Share this post


Link to post
Share on other sites

place a radio trigger and in the on act box put

player setdamage 1

It would be interesting to see if all or just the player using the radio dies.

Both players died! Interesting.

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  

×