add ons in scenerios etc.
Moderator: Jason Petho
add ons in scenerios etc.
So I added a unit to one side in a scn., but when I played the game the units did not move...I was under the impression the objectives enemy held obj.s were always the default, that is units added to a scen. will naturally go after the closest enemy held objectives?
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
Is it an existing scenario?
Your scenario?
Details, details.
Your scenario?
Details, details.
Re: add ons in scenerios etc.
If the side is scripted, without assigning SAI orders to any new units they will likely not move. Why? It's because a standard opening (in the scenario .lua script) is to
hold(<all side units>) -- don't do anything, not even fire
or
halt(<all side units>) -- don't move, but may shoot
After that, units -- including any newly added ones -- would be assigned orders on an individual or parent formation basis.
Note that you can override the hold() or halt() orders by means of
unleash(<trackid #>) -- follow the EAI (Engine AI) orders
in which case such unleashed units will, as you suppose, pursue objectives, else enemy units, in the former unscripted Campaign Series manner.
We will start a forum thread/series explaining the ins & outs of the CSEE/SAI scripting sometime soon.
hold(<all side units>) -- don't do anything, not even fire
or
halt(<all side units>) -- don't move, but may shoot
After that, units -- including any newly added ones -- would be assigned orders on an individual or parent formation basis.
Note that you can override the hold() or halt() orders by means of
unleash(<trackid #>) -- follow the EAI (Engine AI) orders
in which case such unleashed units will, as you suppose, pursue objectives, else enemy units, in the former unscripted Campaign Series manner.
We will start a forum thread/series explaining the ins & outs of the CSEE/SAI scripting sometime soon.
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
Re: add ons in scenerios etc.
Jason yes it was an existing scn...sorry for not adding that.
Berto-
are you saying I can add this verbiage to the lua;
unleash(<trackid #>) -- follow the EAI (Engine AI) orders
where would I add that?
does it go somewhere in ;
function battle_plan_b (turn, side)
-- standard orders, uncomment as necessary:
if turn == 1 then
-- all Side B units hold initially (or maybe use halt())
hold(ALLB)
end
Berto-
are you saying I can add this verbiage to the lua;
unleash(<trackid #>) -- follow the EAI (Engine AI) orders
where would I add that?
does it go somewhere in ;
function battle_plan_b (turn, side)
-- standard orders, uncomment as necessary:
if turn == 1 then
-- all Side B units hold initially (or maybe use halt())
hold(ALLB)
end
Re: add ons in scenerios etc.
Yes. Imediately after that, you might add something likecarll11 wrote: Sun Mar 20, 2022 2:02 am
are you saying I can add this verbiage to the lua;
unleash(<trackid #>) -- follow the EAI (Engine AI) orders
where would I add that?
does it go somewhere in ;
function battle_plan_b (turn, side)
-- standard orders, uncomment as necessary:
if turn == 1 then
-- all Side B units hold initially (or maybe use halt())
hold(ALLB)
end
if turn == 1 then
unleash(215)
end
if the unit in question has a trackid # of 215. (And is a Side B unit. Add that code in battle_planb_() or battle_plan_a() as appropriate.) (unleash({215}) would also work, and is more formally correct. To be explained in future.) Thereafter, that unit would be totally free of the SAI, would follow the dictates of the game engine EAI (over which you have no control).
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
Don't forget the new unit needs to be added to the scenario lua file as well (where all the other units are listed).
Re: add ons in scenerios etc.
Jason.....Holy
I added an entire NVA regt.....
I would have to add teach coy. as, wiht the hex #'s etc.?;
ex;
C1_D1_R33_NVA_RIFLE_COY_64_AK_A_SVN_176
do local units = difference(_C1_D1_R33_NVA_RIFLE_COY_64_AK_A_SVN_176,{181,182})
I added an entire NVA regt.....
I would have to add teach coy. as, wiht the hex #'s etc.?;
ex;
C1_D1_R33_NVA_RIFLE_COY_64_AK_A_SVN_176
do local units = difference(_C1_D1_R33_NVA_RIFLE_COY_64_AK_A_SVN_176,{181,182})
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
Yes, that is correct. You need any of the text that is after -- on the unit line, those are commented out anyway. But the name and id in the same format as the others will be important.
But unit, I thought you were just adding a platoon! *chuckles* Sorry!
But unit, I thought you were just adding a platoon! *chuckles* Sorry!
Re: add ons in scenerios etc.
well I tried the lua edit, but as jason said, ti appears if the units arent in there they wont respond and haven't.
Can I cut the lua loose from the scn.?
Can I cut the lua loose from the scn.?
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
I presume you renamed the scenario to something other than the original file?
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
If you show me the org file, I can help with adding the units to your lua file
Re: add ons in scenerios etc.
HI J;
No I didnt rename it.
I made copys of the scn and all the other files ( LZ albany) for safe keeping naturally.
Then I add an NVA regt. to the org. Placed them on the map, extended the scn. length ( I figured out you had to do that numerous times in the scn. lines or it would error out).
I made the code change Berto suggested and viola', the units I added are moving and attacking.....my bad earlier was trying to change it mid scn. instead of starting the game all over again, I should have known better but I haven't worked with the CS data/code scenario creation in a very long time....
Further Q- if I add other objectives I 'assume' the units will take those into consideration too or are there Lua code changes I need to make? OR, Does the AI or game engine figure out objective priorities as well?
No I didnt rename it.
I made copys of the scn and all the other files ( LZ albany) for safe keeping naturally.
Then I add an NVA regt. to the org. Placed them on the map, extended the scn. length ( I figured out you had to do that numerous times in the scn. lines or it would error out).
I made the code change Berto suggested and viola', the units I added are moving and attacking.....my bad earlier was trying to change it mid scn. instead of starting the game all over again, I should have known better but I haven't worked with the CS data/code scenario creation in a very long time....
Further Q- if I add other objectives I 'assume' the units will take those into consideration too or are there Lua code changes I need to make? OR, Does the AI or game engine figure out objective priorities as well?
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
Unfortunately, if you add additional Objectives, it will mess with the Objective count in the Lua file, making the current scripts and objectives be broken.
Unless you go in and renumber all "OBJECTIVES[1]" (and all the other objectives) to whatever the new Objective number might be (which you could identify using MAP HINTS.
Unless you go in and renumber all "OBJECTIVES[1]" (and all the other objectives) to whatever the new Objective number might be (which you could identify using MAP HINTS.
Re: add ons in scenerios etc.
do you mean adding Obj. hexes etc. ;
from the :Lua;
OBJECTIVES = {}
OBJECTIVES[1] = "40,22" -- 1-12[20/10] 21
my add line example;
OBJECTIVE[2]_AREA= add my hex # --what does the rest of the code mean? 1-12? and 21 ( the 20/10 are the points values I believe? I can a keep them what I want based on what I want them to take re; priority?)
And from the lua;
LZ_ALBANY_AREA = hexes_within(OBJECTIVES[1], NODIR, 2)
my add line example;
LZ_ALBANY_AREA = hexes_within(OBJECTIVES[2], NODIR, 2)
from the :Lua;
OBJECTIVES = {}
OBJECTIVES[1] = "40,22" -- 1-12[20/10] 21
my add line example;
OBJECTIVE[2]_AREA= add my hex # --what does the rest of the code mean? 1-12? and 21 ( the 20/10 are the points values I believe? I can a keep them what I want based on what I want them to take re; priority?)
And from the lua;
LZ_ALBANY_AREA = hexes_within(OBJECTIVES[1], NODIR, 2)
my add line example;
LZ_ALBANY_AREA = hexes_within(OBJECTIVES[2], NODIR, 2)
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
When you an objective, you will change the numbering of how the objectives are listed in the lua file.
Which means you'll need to change the numbering to suit (only if you add new objectives)
Here is an example from the giong dinh scenario on how to identify the numbers.
Which means you'll need to change the numbering to suit (only if you add new objectives)
Here is an example from the giong dinh scenario on how to identify the numbers.
- Attachments
-
- Screenshot 2022-03-20 100749.jpg (346.3 KiB) Viewed 722 times
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
So, if you add a new one, you will need to most likely RENUMBER the old ones so they are still relevant.
Looking at the Objectives in the Giong Dinh lua file, you will see how they are organized. The ID, the location and the values.
If you add a new one, you have to renumber the Objectives (they are number from left to right and top to bottom)
So if you added an objective to the west, then
OBJECTIVES[1] = "10,31" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21
Would become
OBJECTIVES[2] = "10,31" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21
in the modified file.
Looking at the Objectives in the Giong Dinh lua file, you will see how they are organized. The ID, the location and the values.
If you add a new one, you have to renumber the Objectives (they are number from left to right and top to bottom)
So if you added an objective to the west, then
OBJECTIVES[1] = "10,31" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21
Would become
OBJECTIVES[2] = "10,31" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21
in the modified file.
- Attachments
-
- Screenshot 2022-03-20 102033.jpg (36.47 KiB) Viewed 719 times
Re: add ons in scenerios etc.
Ahhhh, I see....when I am done with this play thru, I'll tinker, thank you!!!!
Oh hold up; in your typing you wrote;
OBJECTIVES[2] = "10,31" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21
shouldnt 10 31 be the new hex # 12 29?
Oh hold up; in your typing you wrote;
OBJECTIVES[2] = "10,31" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21
shouldnt 10 31 be the new hex # 12 29?
- KEYSTONE0795
- Posts: 91
- Joined: Thu Aug 21, 2014 12:01 am
Re: add ons in scenerios etc.
"We will start a forum thread/series explaining the ins & outs of the CSEE/SAI scripting sometime soon."
Please do. For me, I get the most enjoyment from tinkering with a scenario after I've played it. A comprehensive lua/event engine tutorial will add years to the longevity of this title and create more anticipation for DLC's and new titles.
I've been playing Campaign Series since the original Talonsoft release. So pleased to be still playing it even after my retirement!!!!!!!
Please do. For me, I get the most enjoyment from tinkering with a scenario after I've played it. A comprehensive lua/event engine tutorial will add years to the longevity of this title and create more anticipation for DLC's and new titles.
I've been playing Campaign Series since the original Talonsoft release. So pleased to be still playing it even after my retirement!!!!!!!
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
No.carll11 wrote: Sun Mar 20, 2022 5:28 pm Ahhhh, I see....when I am done with this play thru, I'll tinker, thank you!!!!
Oh hold up; in your typing you wrote;
OBJECTIVES[2] = "10,31" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21
shouldnt 10 31 be the new hex # 12 29?
The screenshot above is without any changes, it is the stock file.
But, as I suggested, if you add an objective to the west, the listing would then look like this:
OBJECTIVES[1] = "8,10" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21 -- THIS IS THE NEW OBJECTIVE
OBJECTIVES[2] = "10,31" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21 -- THIS IS THE RENUMBERED OLD OBJECTIVE
OBJECTIVES[3] = "12,29" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21 -- THIS IS THE RENUMBERED OLD OBJECTIVE
OBJECTIVES[4] = "13,28" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21 -- THIS IS THE RENUMBERED OLD OBJECTIVE
OBJECTIVES[5] = "14,25" -- 1-5[3/3] 6-11[4/4] 12-14[5/5] 21 -- THIS IS THE RENUMBERED OLD OBJECTIVE
Keep in mind that any of the old objective numbers will still be referenced in the lua file down below, so you'll have to go through all lua file and replace each OBJECTIVES[#] with the appropriate number.
Hopefully that clears that up?
- Jason Petho
- Posts: 17626
- Joined: Tue Jun 22, 2004 10:31 am
- Location: Terrace, BC, Canada
- Contact:
Re: add ons in scenerios etc.
With the 1.10 UPDATE, I did start filling in the section 8.5 of the manual. That's a good starting point about what the lua file is and how it works.KEYSTONE0795 wrote: Mon Mar 21, 2022 2:46 pm "We will start a forum thread/series explaining the ins & outs of the CSEE/SAI scripting sometime soon."
Please do. For me, I get the most enjoyment from tinkering with a scenario after I've played it. A comprehensive lua/event engine tutorial will add years to the longevity of this title and create more anticipation for DLC's and new titles.
I've been playing Campaign Series since the original Talonsoft release. So pleased to be still playing it even after my retirement!!!!!!!
I'll be making some videos in the future as well to provide some insight.
