Jump to content
Sign in to follow this  
lexxer

Global hint when a player enters a trigger

Recommended Posts

This should be fairly simple...but Ive tried about everything i could find with no luck. I've also searched just about everything and although ive found some basic ideas I've had no luck with them.

All i want to do is announce globally via hint or some other method when a player enters a trigger area. If possible it should be the players name (not the units name) so for exmple: "Playername has reached waypoint One".

Thanks in advance.

Share this post


Link to post
Share on other sites

Multiplayer or Singleplayer?

Both work with the "list" function though. Just locality is the "issue" here.

Share this post


Link to post
Share on other sites

Multiplayer - thanks.

Share this post


Link to post
Share on other sites

I'm also having this issue...I'm trying to add an action to start a conversation (since i cant figure out the conversation scripting) so I want the hint to appear to all players in MP when someone clicks the converstaion action.

I'm using this addAction ["My Question", "Myanswer.sqf"]; hint works perfectly just cant get it to all players....

also in the beginning I have a hint within an Units init

hint "Blahblahblah"; the hint also works perfect just not to all players

Share this post


Link to post
Share on other sites
I'm also having this issue...I'm trying to add an action to start a conversation (since i cant figure out the conversation scripting) so I want the hint to appear to all players in MP when someone clicks the converstaion action.

I'm using this addAction ["My Question", "Myanswer.sqf"]; hint works perfectly just cant get it to all players....

also in the beginning I have a hint within an Units init

hint "Blahblahblah"; the hint also works perfect just not to all players

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

---------- Post added at 06:50 PM ---------- Previous post was at 06:48 PM ----------

Multiplayer - thanks.

Right locality says that each player is local to his own pc. Thus you had to execute it on the client himself and not on the server.

Also it's not hard but a little tricky to keep track on who already had the message and who hadn't.

The thing that I would do is to do it like this on the client

waitUntil{player in list triggerName};

hint "You have reached waypoint x";

that will work.

Share this post


Link to post
Share on other sites

That will work but not exactly what Im trying to do. I want a global message with the name of the player that has reached the specified waypoint (marker). It also needs to fire off for anyone that enters the trigger area.

So:

player x has reached the first location

player y has reached the first location

etc etc.

Share this post


Link to post
Share on other sites

Oh my fault sorry :D

waitUntil{player in list triggerName};

hint format ["%1 has reached waypoint x",name player];

And yes it will show the name of every single one as player is local to the machine of the player.

Edited by Joshii

Share this post


Link to post
Share on other sites

That will only hint about your own unit, not all units. Hint is a local command.

Share this post


Link to post
Share on other sites

This is what I use

tText = "Yellow wpt5"; {tText = tText + "\n" + (name _x);} forEach thisList; hint tText;

Set trigger to bluefor present

on Act: put the above code. You can change Yellow wpt5 to whatever you want. That will be the hint. In this case it says the yellow wpt5 then the name of player, that is in the trigger. If you want to reverse that and say "player name" "Yellow wpt5" you would change it to this

tText = "Yellow wpt5"; {"\n" + (name _x) + tText = tText + "\n";} forEach thisList; hint tText;

I think thats right anyway. I know the first one works. We use it in our training map.

Share this post


Link to post
Share on other sites

That was exactly what I needed. Thank you!

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  

×