OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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
-
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:
-
Syntax is right ;)
-
syntax's probably wrong.
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
-
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.
-
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:
-
should be like this Armstrong for tittletext
Titletext [Format ["%1", name player],"Plain Down"]