OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: _Ross_ on 25 Sep 2003, 05:18:47

Title: format
Post by: _Ross_ on 25 Sep 2003, 05:18:47
how do you use the format command? like for an example use it to show variable contents in a hint.

thanks! ;D
Title: Re:format
Post by: dmakatra on 25 Sep 2003, 07:36:29
Like if you wanna have the damage of a vehicle:

hint format ["Yoooooo! Here's your bloody number!!! 1%", getdammage vehicle]

Sumthin like that, syntax's probably wrong.

:beat: *Gets Shot* :beat:
Title: Re:format
Post by: Artak on 25 Sep 2003, 07:55:54
Syntax is right ;)
Title: Re:format
Post by: Chris Death on 25 Sep 2003, 09:16:53
Quote
syntax's probably wrong.

Quote
Syntax is right

Analysis from Armsty himself was correct, syntax is wrong
but not too much;

it's %1, and not 1%

So it should look like:

hint format ["~S~ %1", name player]

would look like:

loud ping sound, followed by top-left white hint:

~S~ [BF] ChrisDeath

Title: Re:format
Post by: macguba on 25 Sep 2003, 10:35:31
There are a couple of examples in the online version of the command reference in the Ed Depot.   (It's called COMMANDS in the left hand menu.)  I wrote them there myself so that I could check the syntax myself whenever I have the same problem as you, which is frequently.
Title: Re:format
Post by: dmakatra on 25 Sep 2003, 16:10:59
A good thing about format is that you can get the name of the player. This is good in MP games and in dialouges. Like this:

titletext ["Man on Drugs(Armsty) - Yo! Whazzzzzzzzzzzzzzzzzzup Dude!", "PLAIN DOWN"]

titletext [["%1 - Not much man, just the ordinary Hollywood/Game routines. Saved the world, beat up an evil wizard, saved the blond chick.", "PLAIN DOWN"], name player]

Don't think Syntax is right on this one either, but you get the picture?

:beat: *Gets Syntax Errors* :beat:
Title: Re:format
Post by: Black_Feather on 25 Sep 2003, 17:55:03
should be like this Armstrong for tittletext

Titletext [Format ["%1", name player],"Plain Down"]