User Tools

Site Tools


dynamicmessages

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dynamicmessages [2013/10/29 08:48] – created vicdynamicmessages [2026/06/22 12:14] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ==== New Message options for DC3 ==== ==== New Message options for DC3 ====
 Synopsis: You can use new execs to set a new type of message: The dynamic message. It allows for: Synopsis: You can use new execs to set a new type of message: The dynamic message. It allows for:
 +
 *Additional scripting in the text of the message *Additional scripting in the text of the message
  
 Furthermore the following is now possible: Furthermore the following is now possible:
 +
 *3-part systemgraphic background for the message *3-part systemgraphic background for the message
 +
 *Ability to set message to a group number *Ability to set message to a group number
  
Line 37: Line 40:
 option = will add an option to the multiple choice list. Must include: [optiontitle][optionevent] and optionally: [optiontext],[optionpp] and one or multiple [optiontempvar] option = will add an option to the multiple choice list. Must include: [optiontitle][optionevent] and optionally: [optiontext],[optionpp] and one or multiple [optiontempvar]
  
-==[font][/font]==+==[fontname][/fontname]==
 This code allows you to put the name of a file inside the fonts/ directory. For example the already existing: 'FreeSans.ttf' This code allows you to put the name of a file inside the fonts/ directory. For example the already existing: 'FreeSans.ttf'
 This allows you do add fonts to the fonts/ directory and access them this way. This allows you do add fonts to the fonts/ directory and access them this way.
 There is a hardcoded limit of using 99 different combination of font,fontsize,fontstyle through DM's, but it should be more than enough. There is a hardcoded limit of using 99 different combination of font,fontsize,fontstyle through DM's, but it should be more than enough.
 +Keep in mind you have to specify the name of the file exactly and case-SenSiTive.
  
 ==[fontsize][/fontsize]== ==[fontsize][/fontsize]==
 Give the fontsize in pixels. Give the fontsize in pixels.
  
-==[fontstyle][/fontstyle]+==[fontstyle][/fontstyle]==
 Is optional. If ommited regular style will be used. Use 1 for bold and 2 for italic. Make sue the fontfile used actually has the defenitions for using these styles. Is optional. If ommited regular style will be used. Use 1 for bold and 2 for italic. Make sue the fontfile used actually has the defenitions for using these styles.
  
-==[lineheight][/lineheight]+==[lineheight][/lineheight]==
 Number of pixels between lines Number of pixels between lines
  
Line 134: Line 138:
  
 Limitations: None, will display all. This is the only window that will display the options of a dynamic message and allow the player to choose one and execute the event the option is set too. Limitations: None, will display all. This is the only window that will display the options of a dynamic message and allow the player to choose one and execute the event the option is set too.
 +
 +===Dont forget: ExecMessageNote===
 +It can be used to set a small note that will be displayed next to an officer portrait in the picture of a regular message that uses [portrait][/portrait]. Its extensively used in DC1 and DC2 upon feedback from officer after you have played one of their action cards. 
 +
 +===Reminder: Normal code for all messages, unrelated to dynamic layout coding====
 +[tempvar]nr[/tempvar]
 +
 +[tempstring]nr[/tempstring]
 +
 +[regimename]nr[/regimename]
 +
 +[hexname]x,y[/hexname]
 +
 +[unitname]nr[/unitname]
 +
 +[gamevar]nr[/gamevar] =>game var value
 +
 +[regimevar]regnr,nr[/regimevar] =>regime var value
 +
 +[hisname]hisnr[/hisname]
 +
 +[realhisname]hisID[/realhisname]
 +
 +[commander]hisnr[/commander]
 +
 +[realcommander]hisID[/realcommander]
 +
 +[portrait]hisnr[/portrait]
 +
 +[realportrait]hisID[/portrait]
 +
 +[date]roundNr[/date]
 +
 +Tempstring is always executed first. So you can put coding inside the tempstring.
 +
 +Tempvar is executed second so you can use it to give input for another tag like [portrait][tempvar]1[/tempvar][/portrait]
 +
 +Gamevar is executed third.
 +
 +====Used to generate PDF's====
 +You can use the same formatting as for dynamic messages to pass text to ExecWritePDF.
 +However there is a big difference here. Only text and picture type are implemented at moment. 
 +
 +For positioning of text you can only optionally specify x and y. [x][/x] and [y][/y] and position x,y is not the real position. position x is the offset from the left margin. position y is the offset from the previous element and is reset if new page is used. 
 +
 +For position of images you can also use width. To make sure a small image is sharp enough. If ommited it will be maximized to page width. Height is derived from your width specified. If an image is to wide or high to fit on a page it will be scaled automaticly.
 +
 +The whole process is one of just rendering one element under another and creating new pages whenever necc. 
 +
 +The pixel system is also different as your pages (excluding margin) are 475 x 682. A good font size is between 10-12 for text. Images are as sharp as their original is.
 +
 +One extra type of element is available when using ExecWritePDF and that is [type]pagebreak[/type]. Guess you know what it will do :)
 +
 +Title and page number are rendered on each page automaticly as sort of watermarks.
 +
 +===Pagebreak===
 +You can use the [element][type]pagebreak[/type][/element] as already explained.
 +You can specify a background image here... it will always be strectched to full page width & height which is: 595x842. 
 +You specify this image by adding [image]graphics/...jpg[/image] . These graphics will only temporary be loaded into memory. And you can change them for each page.
 +Furthermore if your first element is a pagebreak it will not cause a blank page, but will use the image specified for the background of the first page.
 +
dynamicmessages.1383036526.txt.gz · Last modified: 2026/06/22 12:13 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki