Jump to content
Sign in to follow this  
ldnsmudge

Briefing Script - Close window on map marker

Recommended Posts

Hi Guys,

 

New to scripting and having trouble finding any info on whether its possible to close a diary record, but keep the map open, when selecting a map marker. My briefing text is fairly long and when I select the <marker> and the map moves it to the centre, the marker is covered by the text window.

 

I saw a selectDiarySubject command and wondered whether it was possible to switch from my Briefing subject "The Hub" to "Map" when the marker tag is clicked. The thinking being that this should close the larger Hub window, but I'm not sure if thats possible or what the embedded syntax looks like to achieve that.

 

Does anyone have any suggestions as to whether what I'm trying to do is possible and if so, what the right way to go about it might be.

 

player createDiaryRecord ["Diary", ["The Hub","
For the duration of your stay you will based here at <marker name=theHub>'The Hub'</marker>,a Joint Operations Centre (JOC) in Mexico.<br/>"+
"<img image='images\theHubsml.jpg' width='329' height='185' title='The Hub' /><br/>"+
"<br/>
The..."]];

 

Share this post


Link to post
Share on other sites

Either I asked a really dumb question - or a really cool difficult problem that no-one else has ever thought about
😏

Share this post


Link to post
Share on other sites

Hi, it's doable, if you don't mind loosing the blue lines pointing to the marker. You just have to script map animation youself. For that you should use execute tag, which is part of the diary system.

player createDiaryRecord ["Diary", ["The Hub","
For the duration of your stay you will based here at <execute expression='player selectDiarySubject ""Map"";mapAnimAdd [1, 0.1, markerPos ""theHub""];mapAnimCommit;'>The Hub</execute>,a Joint Operations Centre (JOC) in Mexico.<br/>"+
"<img image='images\theHubsml.jpg' width='329' height='185' title='The Hub' /><br/>"+
"<br/>
The..."]];

Share this post


Link to post
Share on other sites

Thanks @soldierXXXX the selectDiarySubject is working as expected, just the mapAnimAdd  is failing to trigger. Which gives me something to work with. The fact the diary changes means the execute expression is working, which is further than I've got so far. I'll play around with the pos, maybe switch it out for a map pos rather than the marker, see how that goes.

 

Thanks again.

Share this post


Link to post
Share on other sites

Oh, right. MapAnimAdd only works during mission, my bad 😄. Here is fixed code.
 

player createDiaryRecord ["Diary", ["The Hub"," 
For the duration of your stay you will based here at <execute expression='player selectDiarySubject ""Map"";if ((findDisplay 37) isNotEqualTo displayNull) then {
private _ctrlMap = ((findDisplay 37) displayCtrl 51); _ctrlMap ctrlMapAnimAdd [1, 0.1, getMarkerPos ""theHub""];ctrlMapAnimCommit _ctrlMap;}
 else {mapAnimAdd [1, 0.1, markerPos ""theHub""];mapAnimCommit;}'>The Hub</execute>,a Joint Operations Centre (JOC) in Mexico.<br/>"+ 
"<img image='images\theHubsml.jpg' width='329' height='185' title='The Hub' /><br/>"+ 
"<br/> 
The..."]];

 

  • Like 2

Share this post


Link to post
Share on other sites

Dude you're the best. That works perfectly. Looking at how you did that, I would have never got there in a month of Sundays.

 

Thanks very much

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×