OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: dth47 on 19 Mar 2004, 15:24:11

Title: Player Names in Multiplyer
Post by: dth47 on 19 Mar 2004, 15:24:11
Hi there, sur one of you gurus can help me out :).

Made a MP mission with a cutscene start focusing along the playable units. All i want is a script to display their name on screen:

eg player 1s Multiplyer name is BAM and he is unitname op1.

Also a way to make the text scripts stop after a desegnated amount of time?

titletext ["text","PLAIN"]

then what????


Much Appreciated
Dave
Title: Re:Player Names in Multiplyer
Post by: Artak on 19 Mar 2004, 16:11:49
titleText [format ["%1",name op1],"PLAIN DOWN"]

The above would print the name of op1 on screen.

I don't understand your second question. Stop how? Desegnated time?

You can exit scripts with the command exit. You can set delays in scripts with ~time ie. ~5 would wait for 5 seconds. if your runnig a loop you can do like this

_count = 0
_max = 10

#loop
hint format ["Number of times looped: %1",(_count) +1]
~5
_count = _count +1
?_count == _max: exit
goto "loop"
Title: Re:Player Names in Multiplyer
Post by: Harkonin on 19 Mar 2004, 16:51:16
format format

Operand types:
format: Array
Type of returned value:
String
Description:
First argument of array is format string. Format string may contain references to following arguments in form %1, %2, etc. Each %x is replaced by corresponding argument. %x may appear in the format string in any order.

Example:
format ["%1 - %2 - %1", 1, "text"]

Title: Re:Player Names in Multiplyer
Post by: Solom on 22 Mar 2004, 11:56:47

>Also a way to make the text scripts stop after a desegnated amount of time?

if u take the exaple above  
...
titleText [format ["%1",name op1],"PLAIN DOWN"]
...
... and u want to limit the time the text is shown to 3 seconds try ...
titleText [format ["%1",name op1],"PLAIN DOWN", 3]


sometimes the "timeing" of OFP is ....

if u need exact timeing go for

titleText [format ["%1",name op1],"PLAIN DOWN"]
~3
titleText [format [" ","PLAIN DOWN"]

~3 == wait 3 seconds