createDiaryRecord – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
 
m (Text replacement - "‎" to "")
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
More goodies from mikey: http://www.ofpec.com/forum/index.php?topic=33468.0 --[[User:Doolittle|Doolittle]] 00:59, 27 August 2009 (CEST)
More goodies from mikey: http://www.ofpec.com/forum/index.php?topic=33468.0 --[[User:Doolittle|Doolittle]] 00:59, 27 August 2009 (CEST)
I don't understand why this command doesn't work on dedicated server? Even if unit is local to server it doesn't add record and on the other hand I can add record to any unit from client even if it is not local --[[User:Messiah2|MessiahUA]] 12:39, 6 June 2011 (CEST)
== Executing Code through createDiaryRecord ==
So after messing around with the execute tags in createDiaryRecord, I've managed to find out a few things about them.
First of all, you need to use apostrophes to surround the code, otherwise the script will break since it thinks that the diary entry ends right after the "expression="<br>
Example:
<code style="display: block"><execute expression='Code'>Text</execute></code>
Second, for using things that require strings as inputs (hint, execVM, etc...) you have to define a string beforehand, then reference the string in the expression. Otherwise you'll end up with the game thinking the createDiaryRecord ends too early. <br>
Example:
<code style="display: block">codestring = "script.sqf";
player createDiaryRecord ["diary", ["Title", "<executeClose expression='execVM codestring'>Text</execute>"]];</code> {{User|Superxpdude}} - 23:57, 26 March 2014

Latest revision as of 11:55, 26 April 2023

More goodies from mikey: http://www.ofpec.com/forum/index.php?topic=33468.0 --Doolittle 00:59, 27 August 2009 (CEST)

I don't understand why this command doesn't work on dedicated server? Even if unit is local to server it doesn't add record and on the other hand I can add record to any unit from client even if it is not local --MessiahUA 12:39, 6 June 2011 (CEST)

Executing Code through createDiaryRecord

So after messing around with the execute tags in createDiaryRecord, I've managed to find out a few things about them.

First of all, you need to use apostrophes to surround the code, otherwise the script will break since it thinks that the diary entry ends right after the "expression="
Example: <execute expression='Code'>Text</execute>

Second, for using things that require strings as inputs (hint, execVM, etc...) you have to define a string beforehand, then reference the string in the expression. Otherwise you'll end up with the game thinking the createDiaryRecord ends too early.
Example: codestring = "script.sqf"; player createDiaryRecord ["diary", ["Title", "<executeClose expression='execVM codestring'>Text</execute>"]]; Superxpdude - 23:57, 26 March 2014