Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Spudnut

CreateDiaryRecord Trigger

Recommended Posts

Hi everyone!

 

I'm new to scripting in Arma but I've been getting back into editing Arma 2 recently and have been having trouble with CreateDiaryRecord through triggers.

I've been able to make diary entries show up fine through the briefing.sqf with


player createDiaryRecord ["Diary", ["Jackal's Location", "The Jackal's farm house is located coordinates 044124."]];

 

but I am trying to have the diary be blank at mission start and then have the Diary entry from a trigger. But when I use


player createDiaryRecord ["Diary", ["Jackal's Location", "The Jackal's farm house is located coordinates 044124."]];

 

in the On Act. of a trigger I get the message "Type Diary record, expected nothing". When I searched createDiaryRecord the two syntax I see are 

 

createDiaryRecord [subject, [title, text](, task(, state))];     AND    createDiaryRecord [subject, text(, task(, state))]

 

I've played around entering different things for "task" and "state" but I'm not exactly sure whats suppose to fill those spaces. Am I simply using the wrong script to fill the diary with a trigger so it appears the same way as when I use the briefing.sqf?

Share this post


Link to post
Share on other sites

'expected nothing' is because the OnAct field of a trigger must return nothing.  The command createDiaryRecord returns a string.

 

Try with a defined variable used, something like:

record0 = player createDiaryRecord ["Diary", ["Jackal's Location", "The Jackal's farm house is located coordinates 044124."]];

Share this post


Link to post
Share on other sites

That makes sense now that you point out the need for a defined variable.

 

This works perfectly! Thank you so much for the help!

Share this post


Link to post
Share on other sites

×