Page 1 of 1

Campaign Module?

Posted: Tue Mar 24, 2020 12:52 am
by desicat
Question for Paul here.

Do you think it is possible to create a Campaign Module? If one uses an edited Choice set of 17, 34 they could be edited to;

IDS_MPS_CHOICE_17, "Fight the 'Elephant Victory', if you win select this box", takes you to the next Campaign battle
IDS_MPS_CHOICE_34, "Fight the 'Elephant Victory', if you lose select this box", takes you to an open battle using your previous army at a #'s disadvantage

I think Choice #2 could also be paired with another Choice that would simulate a loss (say 8 or 33), allowing for at least 2 Custom set piece battles to be worked into a 10 battle Campaign structure. Of course the previous and following battles would have to be 0, -1 (I think). Of course the Campaign would not record losses, but since it is single player that would not matter much.

By using a Module one could include all the set piece battles needed in a single location as desired, it could be downloaded in a single shot, and the campaign could create the rest of the random battles per normal.

Re: Campaign Module?

Posted: Tue Mar 24, 2020 10:12 am
by Paul59
desicat wrote: Tue Mar 24, 2020 12:52 am Question for Paul here.

Do you think it is possible to create a Campaign Module? If one uses an edited Choice set of 17, 34 they could be edited to;

IDS_MPS_CHOICE_17, "Fight the 'Elephant Victory', if you win select this box", takes you to the next Campaign battle
IDS_MPS_CHOICE_34, "Fight the 'Elephant Victory', if you lose select this box", takes you to an open battle using your previous army at a #'s disadvantage

I think Choice #2 could also be paired with another Choice that would simulate a loss (say 8 or 33), allowing for at least 2 Custom set piece battles to be worked into a 10 battle Campaign structure. Of course the previous and following battles would have to be 0, -1 (I think). Of course the Campaign would not record losses, but since it is single player that would not matter much.

By using a Module one could include all the set piece battles needed in a single location as desired, it could be downloaded in a single shot, and the campaign could create the rest of the random battles per normal.
Richard is the expert on Campaign creation, I just design the Epic battles. However, as far as I know, it may be possible to create what you suggest but it would need a lot of modding as the options do not exist at the moment. You should not use those Choice numbers though, as they are already used for other campaign Choices, you would have to select new unused numbers and then create scripts to determine their effect.

I am assuming that you intend that the Campaign code does not actually automatically load the Elephant Victory (or other Epic battle), the player would have to close the Campaign and open the battle himself, and then return to the Campaign and select the result that was achieved?

Re: Campaign Module?

Posted: Tue Mar 24, 2020 10:48 am
by desicat
Paul59 wrote: Tue Mar 24, 2020 10:12 am
desicat wrote: Tue Mar 24, 2020 12:52 am Question for Paul here.

Do you think it is possible to create a Campaign Module? If one uses an edited Choice set of 17, 34 they could be edited to;

IDS_MPS_CHOICE_17, "Fight the 'Elephant Victory', if you win select this box", takes you to the next Campaign battle
IDS_MPS_CHOICE_34, "Fight the 'Elephant Victory', if you lose select this box", takes you to an open battle using your previous army at a #'s disadvantage

I think Choice #2 could also be paired with another Choice that would simulate a loss (say 8 or 33), allowing for at least 2 Custom set piece battles to be worked into a 10 battle Campaign structure. Of course the previous and following battles would have to be 0, -1 (I think). Of course the Campaign would not record losses, but since it is single player that would not matter much.

By using a Module one could include all the set piece battles needed in a single location as desired, it could be downloaded in a single shot, and the campaign could create the rest of the random battles per normal.
Richard is the expert on Campaign creation, I just design the Epic battles. However, as far as I know, it may be possible to create what you suggest but it would need a lot of modding as the options do not exist at the moment. You should not use those Choice numbers though, as they are already used for other campaign Choices, you would have to select new unused numbers and then create scripts to determine their effect.

I am assuming that you intend that the Campaign code does not actually automatically load the Elephant Victory (or other Epic battle), the player would have to close the Campaign and open the battle himself, and then return to the Campaign and select the result that was achieved?
Correct, the player would have to load - that is why being in a self contained Module would make it more user friendly. The Choices that I used for an example lead to no actual Campaign battles, that is why I could find only the two examples.

It would be great to have actual campagin choices, say 36, 37; and 38, 39. With 36 being fight Scenario Battle #1 and 38 being fight Scenario Battle #2 then advance to the next battle in the campaign if you win, and 37 and 38 dealing with player submitted loss with a subsequent Campaign generated battles. This way the Campaign tally board would also be accurate with wins and losses, just not scores.

Re: Campaign Module?

Posted: Tue Mar 24, 2020 4:50 pm
by rbodleyscott
Not something I have tried, but it ought to be possible, using the following script command:

StartBattle([scenario]);

//start a battle. No params means start currently set up Skirmish battle. scenario is the name of the mission (as per the CAMPAIGN.TXT chunks). Only useful from custom campaign UI.

See Documents/My Games/FieldOfGlory2/AUTODOCS/Battlescript.txt

Re: Campaign Module?

Posted: Tue Mar 24, 2020 6:05 pm
by desicat
rbodleyscott wrote: Tue Mar 24, 2020 4:50 pm Not something I have tried, but it ought to be possible, using the following script command:

StartBattle([scenario]);

//start a battle. No params means start currently set up Skirmish battle. scenario is the name of the mission (as per the CAMPAIGN.TXT chunks). Only useful from custom campaign UI.

See Documents/My Games/FieldOfGlory2/AUTODOCS/Battlescript.txt
I am not sure how scripts work, how/where would this be inserted in a Custom Campaign? Where the [SERT1] is? So Replace [SERT1] with; STARTBATTLE([ELEPHANT_VICTORY])

Then this will start the Elephant Victory Scenario and then when complete it will go back to the Campaign and continue with the next battle, [SERT2]?
---------------------------------
/ Global chunk:
STRENGTHMULTIPLIER 300 // Default percent multiplier for reported unit strengths
ARMYLIST0 A_SPANISH_SERT // Side 0 default army list
ARMYLIST1 LR_ROMAN // Side 1 default army list
HERO 1 // HERO n in the global chunk gives the name index of the player's eponymous general, who lives a charmed life.
MAPX1 200 // Map marker locations - pixel locations in EpicMap_Ptolemy.dds (up to 4 sets of coordinates)
MAPY1 600

[SERT1] // Each chunk represents one battle. They can in fact be named any way you like
INTRO IDS_MPS_SERT1 // String needs to be in campaign text1.txt. Does not have to be named the same as the chunk
CHOICE1 0
CHOICE2 -1
MAPTYPE 13
SIZE 0
GENERAL0 1 2 // Name index of new side0 C-in-C to be added - followed by quality - great commander
GENERAL1 2 1

[SERT2]
INTRO IDS_MPS_SERT2
CHOICE1 0
CHOICE2 -1
MAPTYPE 0
SIZE 1
GENERAL1 3 1

Re: Campaign Module?

Posted: Tue Mar 24, 2020 6:39 pm
by rbodleyscott
Nothing as simple as that I am afraid. It is not something you would be able to do without scripting it. CustomCampaign.txt is just a text file, not a script. It requires scripts (CScript program code in .bsf files) to interpret it, and the current scripts won't do what you want.
I am not sure how scripts work
Unless you are willing to devote a great deal of time to learning how they work, I would suggest forgetting about this idea.

I do know how scripts work, and it would be a major exercise for me to implement what you want myself. Sadly the development time that woould be required for me to do so isn't justifiable, because the replay value would be almost nil, compared with the procedurally generated battles in the current campaign system.

However, there is nothing to prevent such a campaign being written as a normal epic battles module, with a popup at the end of each scenario telling you what do do if you win and what to do if you lose.

Re: Campaign Module?

Posted: Tue Mar 24, 2020 7:20 pm
by desicat
rbodleyscott wrote: Tue Mar 24, 2020 6:39 pm Nothing as simple as that I am afraid. It is not something you would be able to do without scripting it. CustomCampaign.txt is just a text file, not a script. It requires scripts (CScript program code in .bsf files) to interpret it, and the current scripts won't do what you want.
I am not sure how scripts work
Unless you are willing to devote a great deal of time to learning how they work, I would suggest forgetting about this idea.

I do know how scripts work, and it would be a major exercise for me to implement what you want myself. Sadly the development time that woould be required for me to do so isn't justifiable, because the replay value would be almost nil, compared with the procedurally generated battles in the current campaign system.

However, there is nothing to prevent such a campaign being written as a normal epic battles module, with a popup at the end of each scenario telling you what do do if you win and what to do if you lose.
Thanks for the reply, too difficult for the time investment it seems.