OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: RDX on 10 Jan 2005, 23:40:33

Title: Making a other client see text
Post by: RDX on 10 Jan 2005, 23:40:33
Hi
In my mission I need to make a player trigger a script and then display a TitleText  to all the players.

This is how I have solved it.
Code: [Select]
init.sqs:
TextMsg=""; PublicVariable "TextMsg"
>all are running this script and declare a public varible.


A player trigger a script through the action menu
Code: [Select]
Strike.sqs:
TextMsg= format["Airstrike in %1 sec!", _Count]; publicVariable "TextMsg"
~1.5
>This change the text from "" to "Airâ€Â¦"

all clients is runing the script ShowMsg.sqs, it is started from the init.sqs
Code: [Select]
ShowMsg.sqs:
#loop
@TextMsg!=""
TitleText [TextMsg,"PLAIN DOWN"]
~1
TextMsg=""
GoTo "Loop"
Exit
>This should wait until the varible TextMsg is set to a sting and then display the text.

â€Â¦but it don't work. When you play it on the server, the text shows to the player that activated it, but not to the rest. I have no idea how to make it work, but I am not so experienced in scripting (or scripting for multiplayer for that matter ;) )

if you would like to see the mission and have a look at the script you can download it through the link.
http://www.geocities.com/rdxgames/rdxgunship.zip (http://www.geocities.com/rdxgames/rdxgunship.zip)
Title: Re:Making a other client see text
Post by: Artak on 10 Jan 2005, 23:49:42
Strings can't be send with publicvariable. You'll have to build it in another way. Publicvariable a boolean instead to continue the client script and build the hint string there.  :)
Title: Re:Making a other client see text
Post by: RDX on 10 Jan 2005, 23:57:25
Thanks, that would explain some logical errors I have been getting ::)