CarryOver Mechanics ?
Moderators: Slitherine Core, BA Moderators
CarryOver Mechanics ?
Pip,
Is there a way to carryover data from one scenario to the next other than just units? If so, can you provide an example?
I'm looking at starting a script for the random missions and I want to carryover the players victory results that will modify the next scenario parameter's.
Thanks in advance!
Is there a way to carryover data from one scenario to the next other than just units? If so, can you provide an example?
I'm looking at starting a script for the random missions and I want to carryover the players victory results that will modify the next scenario parameter's.
Thanks in advance!
-
pipfromslitherine
- Site Admin

- Posts: 9937
- Joined: Wed Mar 23, 2005 10:35 pm
There is a system (though I will confess it's not been given a robust workout because we don't make use of it yet...). There are things called Campaign Variables which can be set and got using the script commands Get/SetCampaignVar. Each var is actually any 8 entry array. You can have a maximum of 64 of them (so 512 values in total, if you used them all).
They are loaded and saved along with all the other data. They are designed to do exactly what you are thinking of if I understand you correctly.
So give them a try, but feel free to let me know if you don't think it's working, as I say - it's not something we have made use of yet, so it could easily have broken since I wrote it way back when!
Cheers
Pip
They are loaded and saved along with all the other data. They are designed to do exactly what you are thinking of if I understand you correctly.
So give them a try, but feel free to let me know if you don't think it's working, as I say - it's not something we have made use of yet, so it could easily have broken since I wrote it way back when!
Cheers
Pip
-
pipfromslitherine
- Site Admin

- Posts: 9937
- Joined: Wed Mar 23, 2005 10:35 pm
Pip,
Whats the TAG parameter?
Whats the TAG parameter?
Code: Select all
//return the value of the campaign var, if index is not provided 0 is used. index must be [0, 8]
GetCampaignVar(tag, [index])
//set the value of the campaign var, if index is not provided 0 is used. index must be [0, 8]
SetCampaignVar(tag, value, [index])
-
pipfromslitherine
- Site Admin

- Posts: 9937
- Joined: Wed Mar 23, 2005 10:35 pm
Pip,
I'm back to fiddling with this and I came across a roadblock and I was wondering if there was something on your end that could be added. I know that you are problably not in the neighborhood of the carryover scripts but I figured I'd throw something at you and see if it's on your "to-do" list.
Ok ... I was wondering if it's possible to add a (universal) function that can add a parameter to a unit so it can be carried over.
Currently, I figured out that you can only CarryOver a unit's status and the number of men. I peaked at the CURRENT.CSF and the part that was interesting is as follows ;
First of all, I can see (best guess), the unit name (C_N), status (C_S) and number of men (C_M).
Would it be possible to add the functionality where we can add another parameter to this carryover list?
For example, lets say that we wanted to carryover a medal that was awarded to a unit during the scenario. So, a function example would look like this ;
SetCarryoverUnitData (tag,missionindex, index, value)
Also, I see the [BONUS] section in the CSF .... Is this functional and what can be saved here? I was thinking I could create a bonus that contained scripts for extra stuff and use the [BONUS] section to carryover the extra garbage
Anyway, I'm just throwing stuff at you ... I'm more curious on any ideas you have in the future about carryover.
I'm back to fiddling with this and I came across a roadblock and I was wondering if there was something on your end that could be added. I know that you are problably not in the neighborhood of the carryover scripts but I figured I'd throw something at you and see if it's on your "to-do" list.
Ok ... I was wondering if it's possible to add a (universal) function that can add a parameter to a unit so it can be carried over.
Currently, I figured out that you can only CarryOver a unit's status and the number of men. I peaked at the CURRENT.CSF and the part that was interesting is as follows ;
Code: Select all
[BONUS]
[CAMPAIGN]
C_N0000000 M4
C_S0000000 1
C_M0000000 1
Would it be possible to add the functionality where we can add another parameter to this carryover list?
For example, lets say that we wanted to carryover a medal that was awarded to a unit during the scenario. So, a function example would look like this ;
SetCarryoverUnitData (tag,missionindex, index, value)
Also, I see the [BONUS] section in the CSF .... Is this functional and what can be saved here? I was thinking I could create a bonus that contained scripts for extra stuff and use the [BONUS] section to carryover the extra garbage
Anyway, I'm just throwing stuff at you ... I'm more curious on any ideas you have in the future about carryover.
-
pipfromslitherine
- Site Admin

- Posts: 9937
- Joined: Wed Mar 23, 2005 10:35 pm
Yes, that's a much better idea (tagging attributes) .... This way, all I need to do is either (AddAttrib in script) or add it to the squads file.pipfromslitherine wrote:It's a great idea. Ideally I would make it so you could tag any attribute to be carried over from a mission to the next one. I will definitely add it to my todo list
Cheers
Pip
Thank you!
