OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: James Spence on 13 Aug 2008, 00:29:03

Title: Player name in groupChat, titleText etc.
Post by: James Spence on 13 Aug 2008, 00:29:03
Hi, I'm making a campaign where the player would play as himself (I mean with his username). Is it possible, when i'm having a person talking to him on the radio or in titletext, for him to say the username of the player playing?

i.e. I would have my officer say, "X, you can drive."

X being the player's user name.

Thanks, Jamoose.
Title: Re: Player name in groupChat, titleText etc.
Post by: bedges on 13 Aug 2008, 08:28:21
You would have to construct a dialog with a text box and show it at the beginning of the mission. Whatever the player typed into the box would be held in a global variable and used in the radio/titletext messages -

Code: [Select]
sergeant_loon sidechat format["%1, you can drive!", player_name]
There are tutorials in the Editors Depot on constructing dialogs.
Title: Re: Player name in groupChat, titleText etc.
Post by: James Spence on 13 Aug 2008, 11:45:17
Cool, thanks alot Bedges.  :D
Title: Re: Player name in groupChat, titleText etc.
Post by: Acecool on 13 Aug 2008, 23:12:38
Depends how you call it...

You can use name _unit which should output Acecool

name Player might work too...
Title: Re: Player name in groupChat, titleText etc.
Post by: Sparticus76 on 12 Sep 2008, 08:45:16
How about

Code: [Select]
sergeant_loon sidechat format ["%1 you can drive!", name player]