OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 28 Jun 2005, 17:21:38

Title: the percent sign
Post by: 456820 on 28 Jun 2005, 17:21:38
okay ive seen a few things using this like this or something close
%,_arrayvalue
and you can use that in hints and radio messages and it will show what the _arraycalue is like if i was using a function wich returned the exact distance from the player and an object the returned value is something like
_dist
then i want to be able to get what that distance is and put it in a radio message
how wil i do this i did have a quick look in the comref but couldnt really find the right thing
Title: Re:the percent sign
Post by: bedges on 28 Jun 2005, 17:49:31
format command (http://www.ofpec.com/editors/comref.php?letter=F#format).

Title: Re:the percent sign
Post by: 456820 on 28 Jun 2005, 17:53:55
thanks alot but how about multiple things would use %1 %2 and so on then at the end just state all the right things in order and with commas also can i use
_dist and things like that ?
Title: Re:the percent sign
Post by: qqqqqq on 28 Jun 2005, 18:44:27
The example in the link shows you how to use multple things.

Yes.
Title: Re:the percent sign
Post by: bedges on 28 Jun 2005, 18:44:47
quoted directly from the comref

Quote
format ["%1 - %2 - %1", 1, "text"]

looks like multiple things to me. and yes, you can also use local variables and global variables too. it's a very handy command.
Title: Re:the percent sign
Post by: 456820 on 28 Jun 2005, 18:45:48
thanks alot i think ive done it just havent tested
Title: Re:the percent sign
Post by: CopyrightPhilly on 28 Jun 2005, 20:00:44
another example...

Code: [Select]
_value1 = "hello"
_value2 = "bye"

hint format ["%1 --- %2",_value1,_value2]

exit