Aesgaard 0 Posted October 2, 2006 Hello, this is my first post and I have a few (several actually ) questions about making a mission and editing/scripting for it to be 100% fun and playable, first out : Flag: I wish to make an area that is currently controlled by Russians and Rebels and Americans (Nato) noticed by a flag, sort of CTF but still not the same. The way I want it to work is that when Russia is holding an area the flag should be repres. their forces in the area by waving a russian/eastern flag, and when Americans or Rebel forces take the area it should change to their designated faction (American/Norwegian etc. from what I decide to assign the forces as :P) First problem I have encountered is that the flagpack I downloaded from www.flashpoint1985/download/patches_flag.html tells me to type (Flag international) : this setflagtexture "\flags\Norway.jpg" to set a norwegian flag as directed in the flagpack, this returns and error message "Picture Flag" on mission start and I would love some help to work around this (Working on making Norwegian rebels :P) - and second, I am totaly new at scripting for the game but I'd love to make the game work so that when you die you respawn into either a squad on hold or a soldier in your squad. Also have some questions about how I make init files etc. since I am completely new at this, I have tried making a briefing.html but nothing comes up, also I have tried making a description.ext / sqs from a site I was studying about making a mission to modify respawns, so any help in what goes where and how when it comes to theese files and how to make them and where to put them would be deeply appreciated  Share this post Link to post Share on other sites
macguba 0 Posted October 2, 2006 Use the files in this tutorial mission as templates for your own mission. Â Â There are a lot of other tutorials at ofpec that you will find useful, especially Beginner's Guide to mission editing. I'm not an MP expert but IIRC one of the standard respawn options (set in description.ext) respawns you into an AI loon in your group. Share this post Link to post Share on other sites
Aesgaard 0 Posted October 2, 2006 Use the files in this tutorial mission as templates for your own mission. Â Â There are a lot of other tutorials at ofpec that you will find useful, especially Beginner's Guide to mission editing. I'm not an MP expert but IIRC one of the standard respawn options (set in description.ext) respawns you into an AI loon in your group. Thank you, but I have read begginers guides, what I am after is how to set up a town with flag, when currently occupied by a designated army the flag should represent their side, and I need some help triggering that Doesnt say so how to do that in your guides And also I need a workaround to designate a flag to be norwegian etc. and not the "usa_blahblah.pac" but using the flagpack, wich gives me an error message when I choose a flag "flag\norway.jpg" (international) -error message : Picture flag- currently reading : http://www.ofpec.com/ed_depot/tutes.htm Share this post Link to post Share on other sites
kutya 0 Posted October 2, 2006 Instead of Quote[/b] ]"flag\norway.jpg" use: Quote[/b] ]"\flag\norway.jpg" and you should be ok (just the backslash at the beginning). I made the same error some time ago. Share this post Link to post Share on other sites
Aesgaard 0 Posted October 2, 2006 Instead ofQuote[/b] ]"flag\norway.jpg" use: Quote[/b] ]"\flag\norway.jpg" and you should be ok (just the backslash at the beginning). I made the same error some time ago. I feel like such a noob :P Rofl, my bad :P I got it working now, thanks alot Now for my hard problem, how to make this flag change to the current side occupying the area, if there's russians present it should be russian, if there's rebels, rebellian, aka change to the "capturers" flag ? Share this post Link to post Share on other sites
macguba 0 Posted October 2, 2006 I suppose you could do it with triggers. Create two triggers over each flagpole area, set to repeatedly. Activation box: Â east present Condition: Â this and not WestHere1 On Activation: Â flag1 setflagtexture "\flag\norway.jpg"; EastHere1=true On Deactivation: Â EastHere1=false Activation box: Â west present Condition: Â this and not EastHere1 On Activation: Â Â flag1 setflagtexture "\flag\sweden.jpg"; WestHere1=true On Deactivation: Â WestHere1=false Similarly for the other area with 2s instead of 1s. In your init.sqs EastHere1=false WestHere1=false EastHere2=false WestHere2=false Syntax not guaranteed and I may even have messed up the logic a bit - its been a long day - but hopfully you get the idea. Â Â You'll need to figure out what you want to happen when both sides are present, and neither side present and make triggers accordingly. Share this post Link to post Share on other sites
Aesgaard 0 Posted October 3, 2006 I suppose you could do it with triggers.Create two triggers over each flagpole area, set to repeatedly. Activation box: Â east present Condition: Â this and not WestHere1 On Activation: Â flag1 setflagtexture "\flag\norway.jpg"; EastHere1=true On Deactivation: Â EastHere1=false Activation box: Â west present Condition: Â this and not EastHere1 On Activation: Â Â flag1 setflagtexture "\flag\sweden.jpg"; WestHere1=true On Deactivation: Â WestHere1=false Similarly for the other area with 2s instead of 1s. In your init.sqs EastHere1=false WestHere1=false EastHere2=false WestHere2=false Syntax not guaranteed and I may even have messed up the logic a bit - its been a long day - but hopfully you get the idea. Â Â You'll need to figure out what you want to happen when both sides are present, and neither side present and make triggers accordingly. Wouldnt east and west there at the same time cause some sort of problems with the game engine, but yeah, it's kind of what I'm after Ew, sweden Share this post Link to post Share on other sites
Aesgaard 0 Posted October 3, 2006 To be more spesific.. how do I make one flag for each city and towns, represented by the occupational force so that it changes to the winning side without going blank or dissapearing while fighting (remaining russian while russians are occupying so to speak for then to change to the american or whatever's side if(and only if) they win) and count them to make a game objective (capture all cities Å• x11 flags) and make an updating mission objective waypoint/log to mark the next objective on the map, I read up on the create invisible markers bit but to be honest I dont understand diddley squat Thanks to uber help I can now place flags tho :P and currently I'm experimenting with having theese triggered, but still unsure on how to count them and lock them to objectives Share this post Link to post Share on other sites
Metal Heart 0 Posted October 3, 2006 If you have a variable for each flag you could count them like: {_x==true} count [westhere1, westhere2, westhere3, westhere4] or for short (since the variables are booleans): {_x} count [wh1,wh2,wh3,wh4] Count can be used to count how many elements of some array meet certain conditions, like in this case, how many of the flag variables are true. {} inside these is the condition, like {_x > 10} or {not alive _x} _x is the current element that is being tested [wh1,wh2,wh3,wh4] is an array of the variables Share this post Link to post Share on other sites
Aesgaard 0 Posted October 3, 2006 If you have a variable for each flag you could count them like:{_x==true} count [westhere1, westhere2, westhere3, westhere4] or for short (since the variables are booleans): {_x} count [wh1,wh2,wh3,wh4] Count can be used to count how many elements of some array meet certain conditions, like in this case, how many of the flag variables are true. {} inside these is the condition, like {_x > 10} or {not alive _x} _x is the current element that is being tested [wh1,wh2,wh3,wh4] is an array of the variables Ok, and since I'm a noob I didnt understand half of what you just said  Is this connected with what's allready posted up above or a standalone sollution to my problem ? Share this post Link to post Share on other sites
Metal Heart 0 Posted October 3, 2006 I was assuming you already had two boolean variables (variable that is either true or false) for each flag. Like for 1st flag you'd have westhere1 and easthere1 variables set by the triggers and for 2nd flag westhere2 and easthere2 and so on. Quite messy but simple. So if you'd have 4 flags you'd have a trigger for west: condition: 4 == {_x} count [westhere1,westhere2,westhere3,westhere4] onActivation: hint "West holds all flags" and for east: condition: 4 == {_x} count [easthere1,easthere2,easthere3,easthere4] onActivation: hint "East holds all flags" If there was 11 flags you'd change the 4 to 11 and have more variables in the arrays (between the square brackets) Share this post Link to post Share on other sites
Aesgaard 0 Posted October 9, 2006 I was assuming you already had two boolean variables (variable that is either true or false) for each flag. Like for 1st flag you'd have westhere1 and easthere1 variables set by the triggers and for 2nd flag westhere2 and easthere2 and so on. Quite messy but simple.So if you'd have 4 flags you'd have a trigger for west: condition: 4 == {_x} count [westhere1,westhere2,westhere3,westhere4] onActivation: hint "West holds all flags" and for east: condition: 4 == {_x} count [easthere1,easthere2,easthere3,easthere4] onActivation: hint "East holds all flags" And easthere/westheare means I gotta set forces to be name west1 ? or ? how does that work ? If there was 11 flags you'd change the 4 to 11 and have more variables in the arrays (between the square brackets) Nope, I dont even have any triggers set because I am still unsure how to start, could you give me a bit by bit introduction; on how to make something easy like 2 flags wich will represent the military forces present at the location changing to the victor's side when all other personel are elliminated, and a trigger that initiates victory when one side holds all the flags ? What they would look like from start... Â I'm not very good at this but I hope to learn fast Share this post Link to post Share on other sites
ProfTournesol 956 Posted October 9, 2006 First, "flag.pbo" doesn't exist, but "flags.pbo" does. The right command is then, in the init line of the flag object : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setflagtexture "\flags\sweden.jpg" Second, the best way to learn Ofp's editor is to try...Triggers are very usefull and should be known well before trying to script anything. Look here for triggers in Ofp wiki Third, as said before, giving a name to the flag - like flag1 - allows you to change flag texture : Make a try : create yourself as a western soldier, create a flag named "flag1", create a trigger activated by west, present, repeatedly, on activation : flag1 setflagtexture "\flags\sweden.jpg" on deactivation : flag1 setflagtexture "\flags\norway.jpg" enter and get out of the trigger, and you'll see the flag changing...that should help you to begin what you want to do...we cannot help you if you don't learn a little more the editor by yourself. Share this post Link to post Share on other sites
Aesgaard 0 Posted October 10, 2006 First, "flag.pbo" doesn't exist, but "flags.pbo" does.The right command is then, in the init line of the flag object : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setflagtexture "\flags\sweden.jpg" Second, the best way to learn Ofp's editor is to try...Triggers are very usefull and should be known well before trying to script anything. Look here for triggers in Ofp wiki Third, as said before, giving a name to the flag - like flag1 - allows you to change flag texture : Make a try : create yourself as a western soldier, create a flag named "flag1", create a trigger activated by west, present, repeatedly, on activation : flag1 setflagtexture "\flags\sweden.jpg" on deactivation : flag1 setflagtexture "\flags\norway.jpg" enter and get out of the trigger, and you'll see the flag changing...that should help you to begin what you want to do...we cannot help you if you don't learn a little more the editor by yourself. Yeah, and not present means the second I move my squad out the flag will change Share this post Link to post Share on other sites
ProfTournesol 956 Posted October 10, 2006 "West" + "Present" means : as soon as a west guy enters the trigger, the trigger is activated, and what you've written in the "on activation field" will be launched. ONCE ACTIVATED, Â if the trigger is set to repeatable, it can be deactivated (west not present ANYMORE) and then will launch what is written in the "on deactivation field", then wait for a "new activation". "West" + "Not Present" means : as soon as there is no west guy in the trigger, the trigger is activated, etc. If you wanna be more specific (activation by a unit only or by a group only), you can group (F2 key in the editor then drag and drop) the trigger with a unit or a group. Share this post Link to post Share on other sites
SevenBEF 0 Posted October 10, 2006 make a little map on Desert Island, name it c&hFlags and save it; go to your user\Aesgaard\missions\ folder and open up the folder you just made (c&hFlags) by saving the mission. You'll find a file there called mission.sqm Open it with notepad, delete what's in it & replace with the following. Go back to Flashpoint & load the map c&hFlags on desert island in the editor. Have a look and preview it. It only uses triggers to make it somehow easyer. *Guess I had some spare time <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> version=11; class Mission { randomSeed=5506051; class Intel { }; class Groups { items=3; class Item0 { side="WEST"; class Vehicles { items=3; class Item0 { position[]={9890.666992,26.730000,3926.469727}; azimut=86.417931; id=0; side="WEST"; vehicle="SoldierWB"; player="PLAYER COMMANDER"; leader=1; skill=0.600000; }; class Item1 { position[]={9866.510742,26.730000,3915.536377}; azimut=86.417931; id=1; side="WEST"; vehicle="SoldierWB"; player="PLAY CDG"; skill=0.600000; }; class Item2 { position[]={9869.066406,26.730000,3943.105225}; azimut=86.417931; id=2; side="WEST"; vehicle="SoldierWB"; player="PLAY CDG"; skill=0.600000; }; }; }; class Item1 { side="EAST"; class Vehicles { items=3; class Item0 { position[]={10593.877930,26.730000,4081.475098}; azimut=265.000000; id=3; side="EAST"; vehicle="SoldierEB"; player="PLAY CDG"; leader=1; rank="COLONEL"; skill=0.600000; init="this allowFleeing 0;"; }; class Item1 { position[]={10606.008789,26.730000,4089.056885}; azimut=265.000000; id=4; side="EAST"; vehicle="SoldierEB"; player="PLAY CDG"; rank="MAJOR"; skill=0.600000; init="this allowFleeing 0;"; }; class Item2 { position[]={10608.012695,26.730000,4073.371582}; azimut=265.000000; id=5; side="EAST"; vehicle="SoldierEB"; player="PLAY CDG"; rank="CAPTAIN"; skill=0.600000; init="this allowFleeing 0;"; }; }; class Waypoints { items=4; class Item0 { position[]={10526.982422,28.304764,4079.954590}; class Effects { }; showWP="NEVER"; }; class Item1 { position[]={10317.834961,28.304764,4057.505859}; expCond="eastishere1"; class Effects { }; showWP="NEVER"; }; class Item2 { position[]={10156.431641,28.304764,4009.794678}; expCond="eastishere2"; class Effects { }; showWP="NEVER"; }; class Item3 { position[]={9917.613281,28.304764,3928.065430}; expCond="eastishere3"; class Effects { }; showWP="NEVER"; }; }; }; class Item2 { side="LOGIC"; class Vehicles { items=1; class Item0 { position[]={9889.758789,1.128411,4586.519043}; azimut=265.000000; id=14; side="LOGIC"; vehicle="Logic"; leader=1; skill=0.600000; text="Server"; }; }; }; }; class Vehicles { items=8; class Item0 { position[]={9917.593750,26.730000,3928.491455}; azimut=83.744926; id=6; side="EMPTY"; vehicle="FlagCarrier"; leader=1; skill=0.600000; text="flag1"; init="this setFlagTexture ""\flags\Belgium.jpg"";"; }; class Item1 { position[]={9915.573242,26.730000,3929.589355}; azimut=83.744926; id=7; side="EMPTY"; vehicle="Fortress1"; leader=1; skill=0.600000; }; class Item2 { position[]={10155.628906,26.730000,4010.692627}; azimut=10.669452; id=8; side="EMPTY"; vehicle="FlagCarrier"; leader=1; skill=0.600000; text="flag2"; init="this setFlagTexture ""\flags\Belgium.jpg"";"; }; class Item3 { position[]={10153.991211,26.730000,4009.080566}; azimut=10.669475; id=9; side="EMPTY"; vehicle="Fortress1"; leader=1; skill=0.600000; }; class Item4 { position[]={10317.102539,26.730000,4058.789307}; azimut=-15.729395; id=10; side="EMPTY"; vehicle="FlagCarrier"; leader=1; skill=0.600000; text="flag3"; init="this setFlagTexture ""\flags\Belgium.jpg"";"; }; class Item5 { position[]={10316.354492,26.730000,4056.615479}; azimut=-15.729372; id=11; side="EMPTY"; vehicle="Fortress1"; leader=1; skill=0.600000; }; class Item6 { position[]={10526.092773,26.730000,4080.081543}; azimut=-97.815201; id=12; side="EMPTY"; vehicle="FlagCarrier"; leader=1; skill=0.600000; text="flag4"; init="this setFlagTexture ""\flags\Belgium.jpg"";"; }; class Item7 { position[]={10528.145508,26.730000,4079.038574}; azimut=-97.815140; id=13; side="EMPTY"; vehicle="Fortress1"; leader=1; skill=0.600000; }; }; class Markers { items=4; class Item0 { position[]={9917.945313,28.304764,3928.143066}; name="Flag1"; text="Flag1"; type="Flag1"; colorName="ColorBlack"; }; class Item1 { position[]={10156.462891,28.304764,4010.731445}; name="Flag2"; text="Flag2"; type="Flag1"; colorName="ColorBlack"; }; class Item2 { position[]={10317.506836,28.304764,4058.697266}; name="Flag3"; text="Flag3"; type="Flag1"; colorName="ColorBlack"; }; class Item3 { position[]={10526.359375,28.304764,4080.833984}; name="Flag4"; text="Flag4"; type="Flag1"; colorName="ColorBlack"; }; }; class Sensors { items=12; class Item0 { position[]={9769.213867,1.128411,4526.056641}; age="UNKNOWN"; text="setting variables to false again to make sure"; expCond="true"; expActiv="westishere1 = false; westishere2 = false; westishere3 = false; westishere4 = false; eastishere1 = false; eastishere2 = false; eastishere3 = false; eastishere4 = false;"; class Effects { }; }; class Item1 { position[]={9801.070313,1.128411,4527.281738}; age="UNKNOWN"; text="setting variables to false"; expCond="true"; expActiv="westishere1 = false; westishere2 = false; westishere3 = false; westishere4 = false; eastishere1 = false; eastishere2 = false; eastishere3 = false; eastishere4 = false;"; class Effects { }; }; class Item2 { position[]={9916.720703,28.304764,3927.983398}; a=3.000000; b=3.000000; activationBy="WEST"; repeating=1; timeoutMin=3.000000; timeoutMid=3.000000; timeoutMax=3.000000; age="UNKNOWN"; expCond="this AND !(east in thislist)"; expActiv="flag1 setFlagTexture ""\flags\Belgium-Flanders.jpg""; eastishere1 = false; westishere1 = true; titleText[format[""West holds flag1""],""Plain Down""]; ""flag1"" setMarkerColor ""colorblue"";"; class Effects { }; }; class Item3 { position[]={9916.513672,28.304764,3928.053711}; a=3.000000; b=3.000000; activationBy="EAST"; repeating=1; timeoutMin=3.000000; timeoutMid=3.000000; timeoutMax=3.000000; age="UNKNOWN"; expCond="this AND !(west in thislist)"; expActiv="flag1 setFlagTexture ""\flags\Belgium-Wallonia.jpg""; westishere1 = false; eastishere1 = true; titleText[format[""East holds flag1""],""Plain Down""]; ""flag1"" setMarkerColor ""colorred"";"; class Effects { }; }; class Item4 { position[]={10155.802734,28.304764,4010.175049}; a=3.000000; b=3.000000; activationBy="EAST"; repeating=1; timeoutMin=3.000000; timeoutMid=3.000000; timeoutMax=3.000000; age="UNKNOWN"; expCond="this AND !(west in thislist)"; expActiv="flag2 setFlagTexture ""\flags\Belgium-Wallonia.jpg""; westishere2 = false; eastishere2 = true; titleText[format[""East holds flag2""],""Plain Down""]; ""flag2"" setMarkerColor ""colorred"";"; class Effects { }; }; class Item5 { position[]={10317.300781,28.304764,4058.086182}; a=3.000000; b=3.000000; activationBy="EAST"; repeating=1; timeoutMin=3.000000; timeoutMid=3.000000; timeoutMax=3.000000; age="UNKNOWN"; expCond="this AND !(west in thislist)"; expActiv="flag3 setFlagTexture ""\flags\Belgium-Wallonia.jpg""; westishere3 = false; eastishere3 = true; titleText[format[""East holds flag3""],""Plain Down""]; ""flag3"" setMarkerColor ""colorred"";"; class Effects { }; }; class Item6 { position[]={10526.470703,28.304764,4080.264160}; a=3.000000; b=3.000000; activationBy="EAST"; repeating=1; timeoutMin=3.000000; timeoutMid=3.000000; timeoutMax=3.000000; age="UNKNOWN"; expCond="this AND !(west in thislist)"; expActiv="flag4 setFlagTexture ""\flags\Belgium-Wallonia.jpg""; westishere4 = false; eastishere4 = true; titleText[format[""East holds flag4""],""Plain Down""]; ""flag4"" setMarkerColor ""colorred"";"; class Effects { }; }; class Item7 { position[]={10155.847656,28.304764,4010.118408}; a=3.000000; b=3.000000; activationBy="WEST"; repeating=1; timeoutMin=3.000000; timeoutMid=3.000000; timeoutMax=3.000000; age="UNKNOWN"; expCond="this AND !(east in thislist)"; expActiv="flag2 setFlagTexture ""\flags\Belgium-Flanders.jpg""; eastishere2 = false; westishere2 = true; titleText[format[""West holds flag2""],""Plain Down""]; ""flag2"" setMarkerColor ""colorblue"";; ""flag2"" setMarkerColor ""colorblue"";"; class Effects { }; }; class Item8 { position[]={10317.415039,28.304764,4058.043457}; a=3.000000; b=3.000000; activationBy="WEST"; repeating=1; timeoutMin=3.000000; timeoutMid=3.000000; timeoutMax=3.000000; age="UNKNOWN"; expCond="this AND !(east in thislist)"; expActiv="flag3 setFlagTexture ""\flags\Belgium-Flanders.jpg""; eastishere3 = false; westishere3 = true; titleText[format[""West holds flag3""],""Plain Down""]; ""flag3"" setMarkerColor ""colorblue"";"; class Effects { }; }; class Item9 { position[]={10526.555664,28.304764,4080.237793}; a=3.000000; b=3.000000; activationBy="WEST"; repeating=1; timeoutMin=3.000000; timeoutMid=3.000000; timeoutMax=3.000000; age="UNKNOWN"; expCond="this AND !(east in thislist)"; expActiv="flag4 setFlagTexture ""\flags\Belgium-Flanders.jpg""; eastishere4 = false; westishere4 = true; titleText[format[""West holds flag4""],""Plain Down""]; ""flag4"" setMarkerColor ""colorblue"";"; class Effects { }; }; class Item10 { position[]={9972.184570,1.128411,4530.294434}; age="UNKNOWN"; expCond=" 4 == {_x} count [westishere1,westishere2,westishere3,westishere4]"; expActiv="titleText[format[""West holds all the flags""],""Plain Down""]; westwins = true;"; class Effects { }; }; class Item11 { position[]={10080.461914,1.128411,4532.935547}; age="UNKNOWN"; expCond=" 4 == {_x} count [eastishere1,eastishere2,eastishere3,eastishere4]"; expActiv="titleText[format[""east holds all the flags""],""Plain Down""]; eastwins = true;"; class Effects { }; }; }; }; class Intro { randomSeed=6379011; class Intel { }; }; class OutroWin { randomSeed=1354243; class Intel { }; }; class OutroLoose { randomSeed=14414339; class Intel { }; }; Greetz Share this post Link to post Share on other sites
Aesgaard 0 Posted October 11, 2006 Thank you :) -more questions will follow :P- *makes map* Share this post Link to post Share on other sites
Aesgaard 0 Posted October 23, 2006 First, "flag.pbo" doesn't exist, but "flags.pbo" does.The right command is then, in the init line of the flag object : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setflagtexture "\flags\sweden.jpg" Second, the best way to learn Ofp's editor is to try...Triggers are very usefull and should be known well before trying to script anything. Look here for triggers in Ofp wiki Third, as said before, giving a name to the flag - like flag1 - allows you to change flag texture : Make a try : create yourself as a western soldier, create a flag named "flag1", create a trigger activated by west, present, repeatedly, on activation : flag1 setflagtexture "\flags\sweden.jpg" on deactivation : flag1 setflagtexture "\flags\norway.jpg" enter and get out of the trigger, and you'll see the flag changing...that should help you to begin what you want to do...we cannot help you if you don't learn a little more the editor by yourself. This worked out perfectly for my use m8 Thank you very much, now my flags are changing to fit my forces occupying the city Share this post Link to post Share on other sites