createDiaryLink: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(description syntax)
m (Some wiki formatting)
 
(41 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Creates a link to the section of diary given by subject. Record is selected based on given unit/object, diary record or task. |= Description
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| '''createDiaryLink''' [subject, record, text] |= Syntax
|game4= arma3
|version4= 0.50


|p1= [subject, record, text]: [[Array]] -  |= PARAMETER1
|gr1= Briefing


|p2= subject: [[String]]|= PARAMETER2
|descr= Creates a link to the given diary entry.


|p3= record: [[Object]], [[Task]] or [[Diary Record]]|= PARAMETER3
|s1= [[createDiaryLink]] [subject, record, text]


|p4= text: [[String]] |= PARAMETER4
|p1= subject: [[String]]


| [[String]] - empty string <tt>""</tt> or string in <tt>[[format]] ["<log subject<nowiki>=</nowiki>""%1"" record<nowiki>=</nowiki>""%2"">%3</log>", subject, processedRecordId, text]</tt> |= RETURNVALUE
|p2= record: [[Object]], [[Task]] or [[Diary Record]]


|p3= text: [[String]]


|x1= <code>_link <nowiki>=</nowiki> [[createDiarySubject]] ["Group", [[player]], "Player"]</code>|= EXAMPLE1
|r1= [[String]] - empty string or a string similar to the result of <sqf inline>format ["<log subject=""%1"" record=""%2"">%3</log>", subject, processedRecordId, text]</sqf>


|x2= <code>diaryRec1 = [[player]] [[createDiaryRecord]] ["diary", ["Record 1", "We can't refer to next record (("]];
|x1= <sqf>
diaryRec2 = [[player]] [[createDiaryRecord]] ["diary", ["Record 2", "Got to " + ([[createDiaryLink]] ["Diary", diaryRec1, "record 1"])]];  
_diaryRec1 = player createDiaryRecord ["Diary", ["Record 1", "We can not refer to the next record because it does not exist yet."]];
diaryRec3 = [[player]] [[createDiaryRecord]] ["diary", ["Record 3", "Got to " + ([[createDiaryLink]] ["Diary", diaryRec2, "record 2"])]];
_diaryRec2 = player createDiaryRecord ["Diary", ["Record 2", "Go to " + createDiaryLink ["Diary", _diaryRec1, "record 1"]]];
</code>
_diaryRec3 = player createDiaryRecord ["Diary", ["Record 3", "Go to " + createDiaryLink ["Diary", _diaryRec2, "record 2"]]];
|= EXAMPLE2
</sqf>


|x3= <code>funcProcessDiaryLink = {
|x2= In this example, one can go to any next record.
    [[processDiaryLink]] [[createDiaryLink]] ["diary", _this, ""];
<sqf>
TAG_fnc_processDiaryLink = {
processDiaryLink createDiaryLink ["Diary", _this, ""];
};
};
diaryRec1 = [[player]] [[createDiaryRecord]] ["diary", ["Record 1",  
DiaryRec1 = player createDiaryRecord ["Diary", ["Record 1",  
    "In this example, we can go to any next record: go to <execute expression='diaryRec2 call funcProcessDiaryLink'>Record 2</execute>"
"Go to <execute expression='DiaryRec2 call TAG_fnc_processDiaryLink'>Record 2</execute>"
]];
]];
diaryRec2 = [[player]] [[createDiaryRecord]] ["diary", ["Record 2",  
DiaryRec2 = player createDiaryRecord ["Diary", ["Record 2",  
    "Go to <execute expression='diaryRec3 call funcProcessDiaryLink'>Record 3</execute>"
"Go to <execute expression='DiaryRec3 call TAG_fnc_processDiaryLink'>Record 3</execute>"
]];
]];
diaryRec3 = [[player]] [[createDiaryRecord]] ["diary", ["Record 3",  
DiaryRec3 = player createDiaryRecord ["Diary", ["Record 3",  
    "Go to <execute expression='diaryRec1 call funcProcessDiaryLink'>Record 1</execute>"
"Go to <execute expression='DiaryRec1 call TAG_fnc_processDiaryLink'>Record 1</execute>"
]];
]];
</code>
</sqf>
|= EXAMPLE3


 
|seealso= [[processDiaryLink]] [[createDiaryRecord]] [[createDiarySubject]] [[diarySubjectExists]] [[setDiaryRecordText]]
____________________________________________________________________________________________
 
| [[processDiaryLink]], [[createDiaryRecord]], [[createDiarySubject]], [[diarySubjectExists]] |= SEEALSO
 
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 15:35, 1 July 2022

Hover & click on the images for description

Description

Description:
Creates a link to the given diary entry.
Groups:
Briefing

Syntax

Syntax:
createDiaryLink [subject, record, text]
Parameters:
subject: String
record: Object, Task or Diary Record
text: String
Return Value:
String - empty string or a string similar to the result of format ["<log subject=""%1"" record=""%2"">%3</log>", subject, processedRecordId, text]

Examples

Example 1:
_diaryRec1 = player createDiaryRecord ["Diary", ["Record 1", "We can not refer to the next record because it does not exist yet."]]; _diaryRec2 = player createDiaryRecord ["Diary", ["Record 2", "Go to " + createDiaryLink ["Diary", _diaryRec1, "record 1"]]]; _diaryRec3 = player createDiaryRecord ["Diary", ["Record 3", "Go to " + createDiaryLink ["Diary", _diaryRec2, "record 2"]]];
Example 2:
In this example, one can go to any next record.
TAG_fnc_processDiaryLink = { processDiaryLink createDiaryLink ["Diary", _this, ""]; }; DiaryRec1 = player createDiaryRecord ["Diary", ["Record 1", "Go to <execute expression='DiaryRec2 call TAG_fnc_processDiaryLink'>Record 2</execute>" ]]; DiaryRec2 = player createDiaryRecord ["Diary", ["Record 2", "Go to <execute expression='DiaryRec3 call TAG_fnc_processDiaryLink'>Record 3</execute>" ]]; DiaryRec3 = player createDiaryRecord ["Diary", ["Record 3", "Go to <execute expression='DiaryRec1 call TAG_fnc_processDiaryLink'>Record 1</execute>" ]];

Additional Information

See also:
processDiaryLink createDiaryRecord createDiarySubject diarySubjectExists setDiaryRecordText

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note