MiG 0 Posted December 22, 2004 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgTitles { access=1 titles[]={"Sphere","BISLogo","TVSet"}; class Sphere { name="$STR_CFG_TITLES_SPHERE"; model="koule.p3d"; duration=5 camera[]={0,0,4294967286}; }; class BISLogo { name="$STR_CFG_TITLES_BISLOGO"; model="bohemiaolor2.p3d"; duration=3 camera[]={0,0,4294967096}; }; class TVSet { name="$STR_CFG_TITLES_TVSET"; duration=1000 model="TVhi.p3d"; camera[]={0,0,-0.700000}; }; }; I've tryed to create more types in a standalone addon but i didn't succeed. I was testing them ingame using the command: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">CutObj ["TvSet","Plain Down",100] Any tip? Share this post Link to post Share on other sites
Junker 0 Posted December 25, 2004 i think only this will show that stuff. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">titleRsc ["BIS", "PLAIN"] Share this post Link to post Share on other sites
gwg_viper 0 Posted December 25, 2004 u should definatley be able to add more, and i f u succeed they will show up in the effects part of a trigger or WP, so u could test that way. Share this post Link to post Share on other sites
MiG 0 Posted December 27, 2004 i think only this will show that stuff.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">titleRsc ["BIS", "PLAIN"] didn't work, too Share this post Link to post Share on other sites
Junker 0 Posted December 28, 2004 This is a Simple Tut (From Daddl) to understand what ur looking for. Quote[/b] ]On images in intros:First the basics: OFP can understand two image formats: .jpg and .paa - jpg is easier to prepare then the paa files, but it has no alpha channel - therefore transparency is not possible. Also the engine has to do the jpeg decoding on the fly - which costs a lot more processing power than the native OFP texture format paa. Of course, for a squad logo, a flag or a title picture the latter is not really an issue. In OFP paa and jpg formats can always be used both. So paa files can also be used in the briefing.html or your XML (allows for transparency in squad logos - check my new one when I'm in a vehicle!). Most important: images always have to be 2^n in size for either axis (2^n values are for example 32, 64, 128, 256, 512, 1024, 2048,...). Else they won't show. So 128x128 or 512x256 are ok, but 768x512 would not work. They must NOT be compressed (jpeg at 100% quality, non-progressive). To create a paa file you need to create a tga file (graphics format - supported by photoshop and other big graphics suites - I use the free GIMP software). The resulting file (remember - no compression!) can then be converted to paa using the tool TexView, available at the official BIS website (www.flashpoint1985.com - look in the editing section) to paa. How to implement this into your mission? Well, first you need to copy the images - paa or jpg into your mission's folder. Then, in order to be able to use it later in your mission you need to declare them in the description.ext. No worries, that sounds more complicated than it is. First make sure your description.ext contains a class definition 'rscpicture'. This is the nescessary part. Just copy it in your description.ext on top of any picture declarations: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class RscPicture { type = CT_STATIC; idc = -1; style = ST_PICTURE; colorBackground[] = {0, 0, 0, 0}; colorText[] = {1, 1, 1, 1}; font = FontS; size = 0; }; Now we have to declare the pictures. We do this as Title Resources, so we can use them with the CutRsc or TitleRsc commands: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class RscTitles { titles[] = {FTCTitle1, FTCTitle2}; class FTCTitle1 { idd=-1;  // ID ... always -1 movingEnable = false; // always false duration=10;  // max time the picture shows (in seconds) name = "FTCTitle1"; // name in editor // now we declare the picture controls[]= {Picture}; class Picture : RscPicture {x = 0.25; y = 0.33; w = 0.5; h = 0.33;text = "title1.paa";}; }; class FTCTitle2 { idd=-1;  // ID ... always -1 movingEnable = false; // always false duration=10;  // max time the picture shows (in seconds) name = "FTCTitle2"; // name in editor // now we declare the picture controls[]= {Picture}; class Picture : RscPicture {x = 0.25; y = 0.33; w = 0.5; h = 0.33;text = "title2.paa";}; }; }; The above looks complicated, but is actually very easy to understand. First the 'titles' line. The brackets just contain a list of the ingame names we are going to use for the pictures in our scripts. In the above example there are two images - 'FTCTitle1' and 'FTCTitle2'. Then we declare first 'FTCTitle1' and then (after several lines of code) 'FTCTitle2'. What is important for you are just four lines in this declaration: - the 'class FTCTitle1' tells the game that now the declaration of the first Resource named 'FTCTitle1' starts. Be carefull to use the same names as in the titles line above! - the 'duration' line tells OFP how long the Resource should shown (after this time it gets removed from the screen - but you can always remove it earlier in your scripts). Time is in seconds. - the 'name' line declares a name for the editor. When you have declared the resource and the mission is loaded in the editor you can choose the resource under the effects tab of triggers and waypoints to activate it. The best is to use again the same name as above (in this example 'FTCTitle1') - the most important part is this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Picture : RscPicture {x = 0.25; y = 0.33; w = 0.5; h = 0.33;text = "title2.paa";}; in the brackets you declare the relative position and size of your image resource and you define the actual filename of your image. 'x' and 'y' are the relative position (measured from the upper left corner with values ranging from 0 to 1.0) - so 'x = 0.25; y = 0.33;' means that the image's upper left corner gets placed 25% of the screen size to the right and 33% down. This allows for correct positioning of your resource without regard for the actual screen resolution used by each player. 'w' and 'h' define width and height of our image - also relative to the screen sÃze. Note that to center an image the sum of twice the 'x' and once the 'w' has to be 1.0 (same goes for 'y' and 'h'). Remember that computer screens have a relation of width to height of 4:3 - independent of what resolution you use!!! For example the picture called title2.paa has a resolution of 512x256 - by using the above values it fits in the center of the screen without being distorted. Then the next image follows. You can add as many image resources as needed. Just remember to declare them all in the titles line and to stick with the names you declared there. The rest is mainly cosmetics. Also keep of the brackets and semicolons - they start/end any declaration, as can be easily seen in the above examle. Just keep care to conserve this structure when you cut&paste new image entries or remove old ones. Ok, so now we have finished the description ext. OFP knows where to look for the images and how to fit them on the screen. Now we only have to tell the game WHEN to show them. This is very easy. Either we can use a trigger effect, or we can call the resource from a script. If you use a script you have the commands 'cutRsc' and 'TitleRsc' - analogue to the 'cutText' and 'TitleText' commands. Example: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">  TitleRsc ["FTCTitle2","Plain",1] You see the name of the resource as we declared it in the description.ext? Well, the next thing "plain" just tells it to place it to the center - as we defined the exact position already in the description. ext we ignore it and always use "plain". the numbe after this is the time (in seconds) the image takes to fade in (and out, after it's duration is over). To remove a resource from the screen even if its duration isn't over yet, just use the corresponding Rsc or Text call. Like if you have TitleRsc displayed, you either do a CODE  TitleText  [" ", "plain"] or a <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> TitleRsc ["default","plain"] That's it. I updated 'Find The Chopper' and 'Dawn Raid' to use paa titles, so if you want to see this in a real mission, just download the new versions from my website, check them out and de-pbo them for curiosities sake. The nescessary De-PBO tool can be found using the OFP FAQ (search for 'esential tools'). I hope this helps you Share this post Link to post Share on other sites