yogdogz 11 Posted April 9, 2011 Hi, i'm working on a campaign that have 2 way story. i.e in mission 1, I got 2 choice, kill the HVT or not. Then later in the mission 3, if I got killed the HVT, I won't get reinforcements, and vice versa. thanks. Share this post Link to post Share on other sites
galzohar 31 Posted April 9, 2011 I think this is what you need: http://community.bistudio.com/wiki/saveVar Share this post Link to post Share on other sites
yogdogz 11 Posted April 9, 2011 so, how you use that anyway? the wiki does'nt explain much :\ Share this post Link to post Share on other sites
mankyle 418 Posted April 9, 2011 You know that there are endmission triggers. You can set the campaign so that, depending on which endmission triggers, one mission or another is the next mission of the campaign. Then, what you have to do is create different versions of the same mission but with the altered paramethers. For example, Harvest Red campaign. If you look at the description.ext in the Addons\missions\campaign folder: class C6B: MissionDefault { end1 = C7A; end2 = C7B; end3 = C7C; end4 = C7D; end5 = C6; end6 = C7EF; lost = C6; template = C6B_DogsOfWar.Chernarus; }; class C6: MissionDefault { end1 = C7A; end2 = C7B; end3 = C7C; end4 = C7D; end5 = C6; end6 = C7EF; lost = C6; template = C6_DogsOfWar.Chernarus; }; There are two versions of Dogs of war. In one you fight with the NAPA against Russians and Chedakis and in the other I think that also against CDF You can see that there are lines that say end1 = C7A; and such. In the mission editor you can set different endigns depending on the action of the player(s) so a different mission is select as the next mission. So, for example, if in one mission the end activates when the players have achieved 2 out of 3 objectives you could set different missions depending on if the player achieved: END1: Objective 1 and 2 END2: Objective 1 and 3 END3: Objective 2 and 3 END4: Objective 1, 2 and 3 Hope it helps Share this post Link to post Share on other sites
Melmarkian 11 Posted April 9, 2011 so, how you use that anyway? the wiki does'nt explain much :\ You could for example do it like this: In the first mission put this somewhere: hello = "hello world"; saveVar "hello"; In the next mission you can type: hint hello; And the hint will say: hello world Here is an example http://www.mediafire.com/?j9n7stryi9v484j In the player units init-field is the saveVar defined and in the second mission you return it via radio bravo Share this post Link to post Share on other sites
yogdogz 11 Posted April 9, 2011 You know that there are endmission triggers. You can set the campaign so that, depending on which endmission triggers, one mission or another is the next mission of the campaign.Then, what you have to do is create different versions of the same mission but with the altered paramethers. For example, Harvest Red campaign. If you look at the description.ext in the Addons\missions\campaign folder: class C6B: MissionDefault { end1 = C7A; end2 = C7B; end3 = C7C; end4 = C7D; end5 = C6; end6 = C7EF; lost = C6; template = C6B_DogsOfWar.Chernarus; }; class C6: MissionDefault { end1 = C7A; end2 = C7B; end3 = C7C; end4 = C7D; end5 = C6; end6 = C7EF; lost = C6; template = C6_DogsOfWar.Chernarus; }; There are two versions of Dogs of war. In one you fight with the NAPA against Russians and Chedakis and in the other I think that also against CDF You can see that there are lines that say end1 = C7A; and such. In the mission editor you can set different endigns depending on the action of the player(s) so a different mission is select as the next mission. So, for example, if in one mission the end activates when the players have achieved 2 out of 3 objectives you could set different missions depending on if the player achieved: END1: Objective 1 and 2 END2: Objective 1 and 3 END3: Objective 2 and 3 END4: Objective 1, 2 and 3 Hope it helps Oh so I see, it can be useful when you're going to make multiple ending right? yeah I was thinking about the same thing like this. But I still wonder, there must be a simpler way to do this right? You could for example do it like this:In the first mission put this somewhere: hello = "hello world"; saveVar "hello"; In the next mission you can type: hint hello; And the hint will say: hello world Here is an example http://www.mediafire.com/?j9n7stryi9v484j In the player units init-field is the saveVar defined and in the second mission you return it via radio bravo omg omg thank you so much melmarkian for your nicest help + example too! Share this post Link to post Share on other sites
dalia 13 Posted April 24, 2011 (edited) Hi, People know how we do for ammo crates and vehicle like in pmc campaign with the SUV. And, do you know how do for the dead status? exemple : you have 4 guys 2 dies, but the save status dont recognize the death, guys are on the next mission. Save status work good for people but not for ammo crates and vehicle. thanks Edited April 24, 2011 by Dalia Share this post Link to post Share on other sites
Melmarkian 11 Posted April 24, 2011 Hi,People know how we do for ammo crates and vehicle like in pmc campaign with the SUV. And, do you know how do for the dead status? exemple : you have 4 guys 2 dies, but the save status dont recognize the death, guys are on the next mission. Save status work good for people but not for ammo crates and vehicle. thanks I am working on this at the moment, will let you know what I find. Share this post Link to post Share on other sites
AZCoder 921 Posted April 24, 2011 The easiest way to save the equipment (guns, ammo, everything) of a unit from mission to mission: Escobar saveStatus "EscobarState"; and in the next mission: Escobar loadStatus "EscobarState"; Replace Escobar with the name of the unit of course ;) For saving if they lived or died: AZC_Escobar = alive Escobar; // repeat above line for each member of the group AZC_GROUP_STATUS = [AZC_Escobar,AZC_Domingo,AZC_Oates,AZC_Kazari,AZC_Carson]; saveVar "AZC_GROUP_STATUS"; then in the following mission in the init.sqf: // AZC_Escobar is true or false, alive or dead if (AZC_Escobar) then { // do this only if you saved status before Escobar loadStatus "EscobarState"; } else { [Escobar] joinSilent grpNull; deleteVehicle Escobar; }; This method is used from the missions Infiltrator to Maelstrom in Gambit Royale. Share this post Link to post Share on other sites
dalia 13 Posted April 25, 2011 Thanks AZC :) I ll trie today. @Melmarkian http://www.cfr-arma.net/forum/viewtopic.php?f=13&t=1550&p=10986#p10986 Here there is tip for ammo crate and vehicle, so normally we have all, player, Ia, ammo crate and vehicle :) enjoy !!:D Share this post Link to post Share on other sites
Melmarkian 11 Posted April 25, 2011 Thank you, Dalia. This will help me Share this post Link to post Share on other sites
dalia 13 Posted April 25, 2011 no problem, when you find give news because, loas status for player and ia works but with AZC and the save ammocrate and vehicle don't work together. I dont find solution for moment. Share this post Link to post Share on other sites
AZCoder 921 Posted April 27, 2011 In the 2nd Zargabad PMC mission, there is an exitsave.sqf script that starts with this line: [_this,[bis_suv1,bis_suv2,bis_suv3]] call bis_pmc_fnc_exitMission; The function bis_pmc_fnc_exitMission exists if you have PMC. You can find it by invoking the function library (needs the function module): []call BIS_fnc_help; When the functions viewer up, in the 2nd box on the left, scroll down to BIS_PMC, and in the lower left it should be highlighting BIS_PMC_fnc_exitMission. You can copy & paste that somewhere to read it better. Most of it is very specific to PMC campaign only, but it gives some idea on how to implement weapon crate handling. The mission after that (cp03.zargabad) has this in the init.sqf: ["CP03",bis_suv1] call bis_pmc_fnc_initMission; which can also be found in the functions viewer. However that function is really big, so I will paste the part of it that you want: if (count _this > 1 && isserver) then { _veh = _this select 1; if (!isnull _veh) then { //--- Delay in order to have weapons available in briefing clearmagazinecargo _veh; clearweaponcargo _veh; _veh spawn {sleep 0.01; putWeaponPool _this;}; }; }; I hope this helps. Share this post Link to post Share on other sites
dalia 13 Posted April 27, 2011 i hope too :) thanks for your research. i ll try these times Share this post Link to post Share on other sites
dalia 13 Posted April 28, 2011 (edited) @AZC i couldn't find a way with your script for check if they alive or not so i found another way, it's like your script but one by one. 1 mission :déclencheur : If not alive robert : robertdead = true ; saveVAr "robertdead"2 mission declencheur : robertdead : deletevehicle robert For the fonction you gave, it's strange, it works but i have 2 m8 and 6 g36 ammo inside my ammo crate else i have another things. Edited April 28, 2011 by Dalia Share this post Link to post Share on other sites
igneous01 19 Posted December 31, 2011 I know this topic is a little old but still a relevant question: If you save a variable using saveVar or saveStatus, does it also save any variables that were set on the object using setVariable? Can I in a later mission simply use CampaignVar getVariable "variable" ? Share this post Link to post Share on other sites
mr_centipede 31 Posted December 31, 2011 You could for example do it like this:In the first mission put this somewhere: hello = "hello world"; saveVar "hello"; In the next mission you can type: hint hello; And the hint will say: hello world Here is an example http://www.mediafire.com/?j9n7stryi9v484j In the player units init-field is the saveVar defined and in the second mission you return it via radio bravo Sorry for asking this, but how do you use this testCampaign? Do I need to pbo it first? or I can test it in the editor? Share this post Link to post Share on other sites