Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Campaign Series: Vietnam is a new turn-based, tactical/operational war game that focuses on the Indochina War, Vietnam Civil War and the first years of US involvement in Vietnam with over 100 historical scenarios.

Moderator: Jason Petho

User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

SwampYankee68 came up with this neat idea of adding Search And Rescue missions to scenarios. MEDEVAC played a crucial role in Vietnam, and, sounds like a ton of fun, so let us see what we can achieve with the current Vietnam 1.31.02 functionality out there.

This will take me a few days to complete as I am quite busy at the moment, but, that said,

Let Us Build - Bootcamp 3 - The Search And Rescue Edition!

Edit: FIRST VERSION AVAILABLE HERE.

Specs:
  • Helos get shot down, crews are vital, let us try to recreate this with aid of CS Event Engine functionality
  • This is a quick prototype, so reusing one of the smaller scenarios for this. Bootcamp 3 sounds like a perfect option
  • Scale: CS Vietnam is platoon scale, for this prototype I will micromanage each Helicopter to have its own crew, potentially able to survice both a Reduction or Kill die result with Combat Results Table.
  • And, to be honest, I am just winging it from here on. Ha.
Wish me luck!

Scenario Selection
  • Here we go then, a screenshot from the coming new front end tool. Note the added task decription there. Should be fun!
  • Note the little "LG12" tag at the end. Adding that, we can select a logo screen that appears in the unit list sidebar. I picked one with a landing helo to fit the scenario here.
sar-scn.jpg
sar-scn.jpg (351.61 KiB) Viewed 537 times

Required Files
  • Duplicating existing files for reuse. Map files is duplicated too, although not visible here.
sar00_files.jpg
sar00_files.jpg (157.83 KiB) Viewed 702 times
Last edited by Crossroads on Sat Aug 10, 2024 3:41 pm, edited 9 times in total.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Adding to scenario organization - Organization Editor
  • First, let us figure out which org the available Snakes are:
  • 173rd and 1st Weapons. Right!
sar01_unithandbook.jpg
sar01_unithandbook.jpg (591.46 KiB) Viewed 701 times
  • Then, let us add a crew to each Snake Strength Point in the game.
  • Obviously, we need a MEDEVAC helo as well. Added that one, too.
sar02_orgeditor.jpg
sar02_orgeditor.jpg (405.81 KiB) Viewed 701 times
Last edited by Crossroads on Mon Aug 05, 2024 5:27 pm, edited 1 time in total.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Adding Crews and Medevac as Reinforcements - Scenario Editor
  • Added these units to map, then specified them as reinforcements.
  • Similar to what Jason had already done with Tunnel Rats, reinforcement turn # is 900+, meaning they won't get introduced unless CSEE code says so.
  • Note how I put each crew to their own hex. That is for ease of adding each of them as individual reinforcement. Typically, you can select at one hex at a time, so each of these crews will be a unique reinforcement item.
  • Once added as Reinforcement, units disappear from map, and are visible in the View Reinforcements dialgog instead.
  • And by reinforcement, I mean they will be placed at the map on the hex where a Snake flight lost a strength point, or got totally destroyed.
sar03_reinforcements.jpg
sar03_reinforcements.jpg (421.02 KiB) Viewed 699 times

And then the fun begins: Adding MEDEVAC Events to Scenario
  • This is all the time I had today. But as a teaser, let us start by tweaking the Reduce and Kill events next.
  • To be continued!
sar04_lua01.jpg
sar04_lua01.jpg (374.23 KiB) Viewed 699 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

^ What a busy week, did not have the time to continue. But now that I did, I realise this quickly gets more complex, as we are quite micromanaging here. Typically, we write battle plans in Lua at Coy level. Here, individual crews for individual Helicopters / Strength points.

So let us recap the required Lua changes for the scenario lua file:

New constants and variables:

Constants do not change during scenario play. We will have some mnemonics instead of those reinforcement id integers from Scenario Editor. Note that I decided to simplify this a bit, no MEDEVAC helos, just the air assets you already have:

Code: Select all

function init_constants ()
...
	-- SAR related constants
    SNAKE_ONEONE_CREW_REINF_ID = 3
    SNAKE_ONETWO_CREW_REINF_ID = 4
    SNAKE_TWOONE_CREW_REINF_ID = 5
    SNAKE_TWOTWO_CREW_REINF_ID = 6
Variables a ton, as we need to micromanage crew related events as they occur:

Code: Select all

function init_variables ()
...
    -- SAR related event flags
    SNAKE_ONEONE_SHOT_DOWN = false
    SNAKE_ONETWO_SHOT_DOWN = false
    SNAKE_TWOONE_SHOT_DOWN = false
    SNAKE_TWOTWO_SHOT_DOWN = false

    SNAKE_ONEONE_ARRIVED = false
    SNAKE_ONETWO_ARRIVED = false
    SNAKE_TWOONE_ARRIVED = false
    SNAKE_TWOTWO_ARRIVED = false

    SNAKE_ONEONE_RESCUED = false
    SNAKE_ONETWO_RESCUED = false
    SNAKE_TWOONE_RESCUED = false
    SNAKE_TWOTWO_RESCUED = false
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Then, to actual on_unit_reduce() and on_unit_kill() event handlers:

There was a ton of redundant code with various messages, so I created a few helper functions to have the code simpler in these functions:

on_unit_reduce() event handler

If here, the 2SP Snake has lost one SP, otherwise it would have been killed.

Code: Select all

function on_unit_reduce (hc, trackid, pid, name, side, nation, oid, orgname, points, strength, HQ, Leader, loss, combat) -- DO NOT REMOVE
...
    -- Event handlers for either of the Snake flights losing a strength point
    if member(trackid, _1_1ST_WEAPONS_139) then 
        handle_snake_loss(trackid, _1_1ST_WEAPONS_139, SNAKE_ONEONE_CREW_REINF_ID, "SNAKE_ONEONE_SHOT_DOWN", "1st Flight", hc, side)
    end
    if member(trackid, _2_1ST_WEAPONS_140) then 
		handle_snake_loss(trackid, _2_1ST_WEAPONS_140, SNAKE_TWOONE_CREW_REINF_ID, "SNAKE_TWOONE_SHOT_DOWN", "2nd Flight", hc, side)
    end
on_unit_kill() event handler

Here, a Snake flight either lost a remaining stength point (helicopter), or both at once. Latter will be punished more severely.

Code: Select all

function on_unit_kill (hc, trackid, pid, name, side, nation, oid, orgname, points, strength, HQ, Leader) -- DO NOT REMOVE
...
   if member(trackid, _1_1ST_WEAPONS_139) then
        handle_snake_down(trackid, _1_1ST_WEAPONS_139, {SNAKE_ONEONE_CREW_REINF_ID, SNAKE_ONETWO_CREW_REINF_ID}, 
            "SNAKE_ONEONE_SHOT_DOWN", "SNAKE_ONETWO_SHOT_DOWN", "1st Flight", hc, {-30, -40, -50, -20, -30})
    end
    
    if member(trackid, _2_1ST_WEAPONS_140) then
        handle_snake_down(trackid, _2_1ST_WEAPONS_140, {SNAKE_TWOONE_CREW_REINF_ID, SNAKE_TWOTWO_CREW_REINF_ID}, 
            "SNAKE_TWOONE_SHOT_DOWN", "SNAKE_TWOTWO_SHOT_DOWN", "2nd Flight", hc, {-30, -40, -50, -20, -30})
    end
Next, let us have a look at those sub functions. To be continued.

First, for a single helicopter loss, upon first time, there is a warning, but no point deduction. Something like this, still quite simple innit.

Code: Select all

-- Snake SP loss but no event point penalty
function handle_snake_loss(trackid, weapons_id, crew_id, snake_shot_down_var, flight_name, hc, side)
    if member(trackid, weapons_id) then
        if die_roll(100) > 30 then
            place_reinforcement(crew_id, hc)
            handle_dialog(flight_name .. " Gunship losses!",
                "One of the " .. flight_name .. " Snake gunships is down, but the crew survived! MEDEVAC response requested. \n\n" ..
                "Initiate SAR operations for the downed crew immediately using all available assets. \n\n" ..
                "\n" ..
                "HINT: Losing the whole flight will cost you Event points. Even though they are offensive weapons, do your best to protect gunships from groundfire.",
                0)  -- No points deduction here, just a notification
        else
            handle_dialog(flight_name .. " Gunship losses!",
                "One of the " .. flight_name .. " Snakes down with no surviving crew members! \n\n" ..
                "\n" ..
                "HINT: Losing the whole flight will cost you Event Points. Even though they are offensive weapons, do your best to protect gunships from groundfire.",
                0)  -- No points deduction here, just a notification
        end

        _G[snake_shot_down_var] = true  -- Mark the event as having taken place
    end
end
If crew survived, placed as Reinforcements in both cases (unit reduce or kill)

Code: Select all

-- Function to handle reinforcement placement
function place_reinforcement(crew_reinf_id, hc)
    set_reinforcement_hex(crew_reinf_id, hc)
    set_reinforcement_turn(crew_reinf_id, (current_turn() + 1))
end
However, if both Snakes for a flight were lost as one event, there is an extra penalty for that, while loss for a single remaining flight unit is a tad more hardgiving. Per case, check if either or both crews survived. Here this gets quite complicated.

Code: Select all

-- Function to handle crew survival scenarios
function handle_crew_survival(hardlanding, hc, crew_ids, flight_name, deduction_1, deduction_2, deduction_3)
    if hardlanding > 70 then
        for _, crew_id in ipairs(crew_ids) do
            place_reinforcement(crew_id, hc)
        end
        handle_dialog(flight_name .. " Destroyed",
            flight_name .. " gunships are down, but both crews survived! Urgent MEDEVAC response requested. \n\n" ..
            "Initiate SAR operations immediately using all available assets. \n\n" ..
            "You are deducted " .. deduction_1 .. " Event Points for losing a full flight of Snakes, Commander.\n\n" ..
            "\n" ..
            "HINT: Even though they are offensive weapons, do your best to protect gunships from groundfire.",
            -deduction_1)
    elseif hardlanding > 50 then
        place_reinforcement(crew_ids[1], hc)
        handle_dialog(flight_name .. " Destroyed",
            flight_name .. " gunships are down, but one of the crews survived! MEDEVAC response requested. \n\n" ..
            "Initiate SAR operations immediately using all available assets. \n\n" ..
            "You are deducted " .. deduction_2 .. " Event Points for losing a full flight of Snakes while taking casualties.\n\n" ..
            "\n" ..
            "HINT: Even though they are offensive weapons, do your best to protect gunships from groundfire.",
            -deduction_2)
    else
        handle_dialog(flight_name .. " Destroyed",
            "FUBAR! You lost the full " .. flight_name .. " Snakes with no surviving crew members! \n\n" ..
            "You are deducted " .. deduction_3 .. " Event Points for this SNAFU, Commander.\n\n" ..
            "\n" ..
            "HINT: Even though they are offensive weapons, do your best to protect gunships from groundfire.",
            -deduction_3)
    end
end

-- Function to handle remaining snake down scenarios
function handle_remaining_snake_down(hardlanding, hc, crew_id, flight_name, deduction_1, deduction_2)
    if hardlanding > 30 then
        place_reinforcement(crew_id, hc)
        handle_dialog(flight_name .. " Destroyed",
            "The remaining " .. flight_name .. " gunship is now down as well, but one of the crews survived! MEDEVAC response requested. \n\n" ..
            "Initiate SAR operations immediately using all available assets. \n\n" ..
            "You are deducted " .. deduction_1 .. " Event Points for losing a full flight of Snakes.\n\n" ..
            "\n" ..
            "HINT: Even though they are offensive weapons, do your best to protect gunships from groundfire.",
            -deduction_1)
    else
        handle_dialog(flight_name .. " Destroyed",
            "You lost the remaining " .. flight_name .. " with no surviving crew members! \n\n" ..
            "You are deducted " .. deduction_2 .. " Event Points for this FUBAR, Commander.\n\n" ..
            "\n" ..
            "HINT: Even though they are offensive weapons, do your best to protect gunships from groundfire.",
            -deduction_2)
    end
end


-- Main logic for both track IDs
function handle_snake_down(trackid, weapons_id, crew_ids, snake_one_shot_down, snake_two_shot_down, flight_name, hc, deductions)
    if member(trackid, weapons_id) then
        hardlanding = die_roll(100)

        if not _G[snake_one_shot_down] then
            _G[snake_one_shot_down] = true
            _G[snake_two_shot_down] = true
            handle_crew_survival(hardlanding, hc, crew_ids, flight_name, deductions[1], deductions[2], deductions[3])
        else
            _G[snake_two_shot_down] = true
            handle_remaining_snake_down(hardlanding, hc, crew_ids[2], flight_name, deductions[4], deductions[5])
        end
    end
end
Last edited by Crossroads on Sat Aug 10, 2024 9:56 am, edited 3 times in total.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

With all that micromanagement behind us, and mostly because I went that path for quite the distance, time to make things simple again.

So then, upon "next turn", what ever turn it might be, let us check if a crew has been added to map as a reinforcement.

There's some repetitive code, but I am not going to be bothered about it for now.

Code: Select all

function on_next_phase (turn, side) -- DO NOT REMOVE
...
   -- Check if Snake crew arrived as reinforcement
   if (arrived(SNAKE_ONEONE_CREW_REINF_ID) && not SNAKE_ONEONE_ARRIVED)  then
        dialog_once("Snake OneOne Arrived",
                    "Commander, Snake crew in distress! Launch a SAR mission ASAP.\n\n" ..
                    "You'll rack up Event Points if you can bring them back to one of the Base LZ in one piece!",
                    "a", "a")
		SNAKE_ONEONE_ARRIVED = true
   end
   
   if (arrived(SNAKE_ONETWO_CREW_REINF_ID) && not SNAKE_ONETWO_ARRIVED)  then
		dialog_once("Snake OneTwo Arrived",
					"Commander, Snake crew in distress! Launch a SAR mission ASAP.\n\n" ..
					"You'll rack up Event Points if you can bring them back to one of the Base LZ in one piece!",
					"a", "a")
                    SNAKE_ONETWO_ARRIVED = true
    end
    
    if (arrived(SNAKE_TWOONE_CREW_REINF_ID) && not SNAKE_TWOONE_ARRIVED)  then
    dialog_once("Snake TwoOne Arrived",
					"Commander, Snake crew in distress! Launch a SAR mission ASAP.\n\n" ..
					"You'll rack up Event Points if you can bring them back to one of the Base LZ in one piece!",
					"a", "a")
					SNAKE_TWOONE_ARRIVED = true
	end
    
    if (arrived(SNAKE_TWOTWO_CREW_REINF_ID) && not SNAKE_TWOTWO_ARRIVED)  then
	dialog_once("Snake TwoTwo Arrived",
					"Commander, Snake crew in distress! Launch a SAR mission ASAP.\n\n" ..
					"You'll rack up Event Points if you can bring them back to one of the Base LZ in one piece!",
					"a", "a")
					SNAKE_TWOTWO_ARRIVED = true
    end
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Finally, let us find the precise moment a rescued flight crew arrives to one of the LZ at home base, and when it does, let us throw some shrimp on the barbie!

Overcomplicating this in order to get my Lua array skills in shape. It has been a while since previous CSEE scripting session, for the Sirte scenarios for CS Middle East 2.30 update a year ago.

More simple code would have repated something like if counter_hex(_SNAKE_CREW_ONEONE) == "36,23" ... for all four LZ hexes per trackid. What this array does insted is it cycles an array of trackids, with their flag name and unit name (to be displayed on message) per the four legit LZ hexcoors.

Code: Select all

    -- SAR succesfully executed? Check if any Snake crew is located in one of the landing zones and set the corresponding flag
    local snake_crew_ids = {
        {id = _SNAKE_CREW_ONEONE, flag = "SNAKE_ONEONE_RESCUED", name = "SNAKE_ONEONE"},
        {id = _SNAKE_CREW_ONETWO, flag = "SNAKE_ONETWO_RESCUED", name = "SNAKE_ONETWO"},
        {id = _SNAKE_CREW_TWOONE, flag = "SNAKE_TWOONE_RESCUED", name = "SNAKE_TWOONE"},
        {id = _SNAKE_CREW_TWOTWO, flag = "SNAKE_TWOTWO_RESCUED", name = "SNAKE_TWOTWO"}
    }
    local landing_zones = {"36,23", "37,24", "38,24", "35,23"}

    for _, crew in ipairs(snake_crew_ids) do
        if not _G[crew.flag] then
            local crew_hex = counter_hex(crew.id)
            for _, landing_zone in ipairs(landing_zones) do
                if crew_hex == landing_zone then
                    _G[crew.flag] = true
                    -- Execute one-time logic for the rescued crew
                    dialog("Mission Accomplished", crew.name .. " successfully extracted! You’ve earned 50 Event Points! Now, let’s throw another shrimp on the barbie!", "a", "a")
                    inc_event_points(US_SIDE, 50)
                    break
                end
            end
        end
    end
Last edited by Crossroads on Sat Aug 10, 2024 11:45 am, edited 1 time in total.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

And that's it? In theory at least. This got quite complex, as micromanaging to a level beyond what is typically done here. But should be fun, as said before.

Next, testing. There's bound to be bugs, also in my logic, not just in code.

Edit and there sure was. AND operatori in Lua is "and", not "&&". Fixed. Edit2 Also, message boxes when Snake shot down need to have "ab" as side who would see the message, as we are playing against computer, and often times computer opponent manages to score a hit during its phase. So we want to see the dialog, despite it not being our turn. For PBEM, this would not make sense. And Edit3, there are three LZ hexes in Base, not four, the fourth one was one of the supply trucks.

To be continued!
Last edited by Crossroads on Sat Aug 10, 2024 12:10 pm, edited 1 time in total.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Here goes play testing, then! Note the picture in the unitlist, that is the CSLogo12.bmp indicated by that "LG12" tag in scenario description, to perfectly match the scenario itself.

Let us get those Snakes up...
sar07_playetest.jpg
sar07_playetest.jpg (1.71 MiB) Viewed 595 times
... and park them in front of a VM AAMG unit. Always a wise thing to do, right? Note that I am intentionally playing "vs Computer", not against "vs Computer (FOW)"
sar08_playetest.jpg
sar08_playetest.jpg (1.72 MiB) Viewed 595 times
Last edited by Crossroads on Wed Aug 14, 2024 8:59 am, edited 1 time in total.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Crossroads wrote: Sat Aug 10, 2024 12:01 pm ... and park them in front of a VM AAMG unit. Always a wise thing to do, right?
Right! A spectacularly bad idea. I first lose one SP, then the other, so get to see three messages in total, pasted to same screenshot intentionally:
sar09_playetest.jpg
sar09_playetest.jpg (292.38 KiB) Viewed 594 times
Come next turn, I then receive the information, per arrived unit, that there indeed are flight crews at risk.

sar10_playetest.jpg
sar10_playetest.jpg (190.41 KiB) Viewed 594 times
Last edited by Crossroads on Sat Aug 10, 2024 12:06 pm, edited 1 time in total.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Crossroads wrote: Sat Aug 10, 2024 12:03 pm Come next turn, I then receive the information that there indeed are flight crews at risk.
Note that they arrived as reinforcements, so I need to place them to map. "Place all". Here they are. Again, two screenshots merged into one, first the Arrival dialog, then units as they are placed into map. Right where they were shot down, too!
sar11_playetest.jpg
sar11_playetest.jpg (795.95 KiB) Viewed 593 times
A flight of slicks to the rescue, then! And moving that remaining Snake flight out of harms way.
sar12_playetest.jpg
sar12_playetest.jpg (584.4 KiB) Viewed 590 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Here's the 3D Zoom-in view from turn 3, with unit movement range highlighted. Note that the reinforcements arrive with 0 action points, so needed to wait a bit.
sar13_playetest.jpg
sar13_playetest.jpg (884.33 KiB) Viewed 589 times

Then, at Double Time, they actually had action points both to move to LZ and to Load into the slicks there.
sar14_playetest.jpg
sar14_playetest.jpg (835.3 KiB) Viewed 589 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Off we go! First, at NOE, to avoid that VM AAM unit, then to Low for a quicker journey back home. Just a couple of action points missing from landing at this turn as well.

Come to think, I am not checking the airlevels in my CSEE code, is it enough to have them in the hex, while not landed yet?

sar15_playetest.jpg
sar15_playetest.jpg (836.62 KiB) Viewed 588 times

No it wasn't! Turn 4, and we finally unload the Fatigued but no doubt relieved crews to tarmac. Where's that cold beer! Awards should then follow up on beginning of next US turn.

sar16_playetest.jpg
sar16_playetest.jpg (997.08 KiB) Viewed 587 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Crossroads wrote: Sat Aug 10, 2024 12:27 pm No it wasn't! Turn 4, and we finally unload the Fatigued but no doubt relieved crews to tarmac. Where's that cold beer! Awards should then follow up on beginning of next US turn.
And... nothing happens. This is Why We Test. That overcomplicated array thingie missed its mark, it would seem.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Crossroads wrote: Sat Aug 10, 2024 12:32 pm
Crossroads wrote: Sat Aug 10, 2024 12:27 pm No it wasn't! Turn 4, and we finally unload the Fatigued but no doubt relieved crews to tarmac. Where's that cold beer! Awards should then follow up on beginning of next US turn.
And... nothing happens. This is Why We Test. That overcomplicated array thingie missed its mark, it would seem.
This is more like it! It was enough to have the returning slicks at a correct LZ airspace in the beginning of turn. And why not, beer for everyone while MEDEVAC helos in sight, yes?

sar17_playetest.jpg
sar17_playetest.jpg (345.66 KiB) Viewed 578 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Yup, it works now, I needed to remove the break statement, as there might be more units in that hex at same time.

Here's the fixed code. I added the check that a crew rescue triggers only upon landing.

Code: Select all

if side == US_SIDE then
    -- SAR successfully executed? Check if any Snake crew is located in one of the landing zones and set the corresponding flag
    local snake_crew_ids = {
        {id = _SNAKE_CREW_ONEONE, flag = "SNAKE_ONEONE_RESCUED", name = "SNAKE_ONEONE"},
        {id = _SNAKE_CREW_ONETWO, flag = "SNAKE_ONETWO_RESCUED", name = "SNAKE_ONETWO"},
        {id = _SNAKE_CREW_TWOONE, flag = "SNAKE_TWOONE_RESCUED", name = "SNAKE_TWOONE"},
        {id = _SNAKE_CREW_TWOTWO, flag = "SNAKE_TWOTWO_RESCUED", name = "SNAKE_TWOTWO"}
    }
    local landing_zones = {"36,23", "37,24", "35,23"}

    for _, crew in ipairs(snake_crew_ids) do
        if not _G[crew.flag] then
            local id = crew.id
            local crew_hex = counter_hex(id)
            if counter_is_ground(id) then
                for _, landing_zone in ipairs(landing_zones) do
                    if crew_hex == landing_zone then
                        _G[crew.flag] = true
                        -- Execute one-time logic for the rescued crew
                        dialog("Mission Accomplished", crew.name .. " successfully extracted! You’ve earned 50 Event Points! Now, let’s throw another shrimp on the barbie!", "a", "a")
                        inc_event_points(US_SIDE, 50)
                        -- No break here, continue to check other crews
                    end
                end
            end
        end
    end
end

And here's the screenshot. All's well that ends well!

sar18_playetest.jpg
sar18_playetest.jpg (1.03 MiB) Viewed 573 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

See what you think? Note: this little excercize no way went through a proper design let alone testing phase. Any bugs, report here, I am happy to fix them.

I changed the scenario title so that it is easier to find it once you put it on your Scenarios folder:
sar-scn.jpg
sar-scn.jpg (358.99 KiB) Viewed 571 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Crossroads
Posts: 18215
Joined: Sun Jul 05, 2009 8:57 am

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Crossroads »

Crossroads wrote: Sat Aug 10, 2024 1:54 pm See what you think? Note: this little excercize no way went through a proper design let alone testing phase. Any bugs, report here, I am happy to fix them.
Here are the scenario files, the four of them. Download, unzip, place on your Scenarios folder. Should play like Bootcamp 3, the added VM AAMG stuff is deadly, so be careful out there!

And please note, this was not properly tested, I am certain I missed a thing or three. Do let me know.

EDIT: Map file was missing originally, added now. Duh! Please download again.

Contents:
  • BC_670601_Bootcamp_03_SAR.bmp
  • BC_670601_Bootcamp_03_SAR.lua
  • BC_670601_Bootcamp_03_SAR.map
  • BC_670601_Bootcamp_03_SAR.org
  • BC_670601_Bootcamp_03_SAR.scn
Attachments
Bootcamp3bSAR.zip
(39.4 KiB) Downloaded 19 times
Last edited by Crossroads on Sat Aug 10, 2024 3:31 pm, edited 1 time in total.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.03 Remastered Edition (May 20, 2025)
CS: Middle East 1948-1985 < v3.00.03 Remastered Edition (May 20, 2025)
User avatar
Skylar27
Posts: 28
Joined: Fri Dec 23, 2022 3:23 am
Location: Virginia

Re: Let Us Build: Bootcamp 3 - The Search And Rescue Edition!

Post by Skylar27 »

I followed the instructions and I get this error message pop-up

2024-08-10 11:27:47 [ERROR ID 100] ( forces.cpp, line 18754 Forces::ReadHeader()) _map_file
Scenarios\BC_670601_Bootcamp_03_SAR.map not found
Post Reply

Return to “Campaign Series: Vietnam”