Sneak Peeks, Coming Attractions, Works-In-Progress

The Campaign Series: Middle East 1948-1985 is a new turn-based, tactical wargame that focuses on conflicts in the Middle East.

Moderator: Jason Petho

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

Re: Sneak Peeks, Coming Attractions, Works-In-Progress

Post by Crossroads »

Zovs wrote: Mon Dec 30, 2024 11:15 am Thanks for the update. Looking forward to the ME patch/upgrade.

From the site I posted a typo in the Volume I guide with regards to linkage to the lua site.

I downloaded the binaires to install lua locally, since lua looks like a neat scripting language to learn.

Do you happen to know what other games might be scripted that use lua?

Interesting concepts.
Fixed the Lua homepage url in Vol II manual, good catch, thanks again!

As for Lua use in games, I found this while writing my previous Scripted AI blog: https://en.wikipedia.org/wiki/Category: ... ideo_games

Of those, I really only knew CMANO had an active Lua community. I finally purchased CMO from the Winter Sales yesterday, but haven't had a chance to install it yet.

Since we're on Middle East forum, I'd suggest start by playing with the existing scenario CSEE Lua files that come with 2.31. There's two scenario sets with accompayning Lua files: the four Sirte scenarios and the five Teaching Set scenarios.

Out of these, Sirte 01 really is the only one with actual Battle plans. Especially Side A, where I tried to find out if it was possible to script a full Air assault in CSEE. It turns out it was. Outside the landing, which takes quite a while under SAI, there's not much after infantry is feet on ground, they basically just attack_strong the selected objectives. That is when playing with Side B against Brits.

When playing as Brits, or Side A, there's things like securing the SAM Radar site allows for earlier reinrorcements and stuff like that.

Most other Lua files are about Scenario Briefings, and reacting on events like losing an HQ that diminishes your supply, etc.

I would perhaps start with one of the Teaching Set scenarios. For instance, try adding an attack against one of the objectives under the proper "Do local units =" blocks (see the Vol II manual).

Here's a quick How-to for that:
  • Copy the original Lua file and put it aside as a backup
  • Open the Teaching set Lua for editing where it resides, with Notepad++ perhaps, or with any programming editor you like
  • Open the same scenario in game engine. If you script Side B Battle plan, save it in first turn under Side A.
  • Try a little edit on Lua file, save.
  • Go to game, it should have noticed a senario file has saved. Click Yes to allow for reading the files again
  • If you made a typo, it will immediately notify you with error message and line number.
  • If all good - and you edited Side B in Lua - click Next Turn and see how it plays under the SAI side.
  • Make another edit in Lua, save.
  • Go back to engine, again in notifies of file change. Do not save (unless you want to), open the scenario again, it opens up on your save point
  • Click Next Turn again so see your changes in action.
  • And so on. Good luck!
Or, you can edit the Lua file for a bit, then fire up the scenario to test your changes. Any syntax errors are reported as the scenario loads.

Note, that other types of Lua errors, like errors in logic, or expecting a data variable where one does not exist, cause a Lua error as well, but these are on the fly, not upon scenario load. They will be more difficult to debug, often.

Note also that once the SAI side has thrown even one Lua error message box, it no longer executes the Lua code. You always need to start the scenario again to activate Lua after an error message.
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
Zovs
Posts: 9181
Joined: Sun Feb 22, 2009 11:02 pm
Location: United States

Re: Sneak Peeks, Coming Attractions, Works-In-Progress

Post by Zovs »

Crossroads wrote: Mon Dec 30, 2024 1:31 pm ...
Thanks for much for the detailed posting on how to do lua scripting.

Created a PDF with your instructions and recommendations and looking forward to messing around a bit.
Image
Beta Tester for: War in the East 1 & 2, WarPlan & WarPlan Pacific, Valor & Victory, Flashpoint Campaigns: Sudden Storm, Computer War In Europe 2
SPWW2 & SPMBT scenario creator
Tester for WDS games
User avatar
Crossroads
Posts: 18156
Joined: Sun Jul 05, 2009 8:57 am

Re: Sneak Peeks, Coming Attractions, Works-In-Progress

Post by Crossroads »

Good luck! Feel free to start a thread at the Scenario design and modding subforum, if you have any questions, I would be happy to help :)
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: 18156
Joined: Sun Jul 05, 2009 8:57 am

Re: Sneak Peeks, Coming Attractions, Works-In-Progress

Post by Crossroads »

Crossroads wrote: Sun Dec 29, 2024 4:55 pm
Crossroads wrote: Sat Nov 30, 2024 5:04 pm It's been a while, so time to scribble a few updates again!

I thought it’d be neat to dive under the hood of our scripted AI feature. Here’s the first part of what I hope will be a three-part blog series:

The link opens the post on our CSLegion site.

Lots of text, not so many pictures. Still, here are some highlights of the latest and greatest updates to our CSEE API library. Next up, we’ll dive into the fun part—dissecting the latest evolution of the anatomy of our Lua scenario file!
I originally planned to take time this weekend to write the second part of the Scripted AI series to depict the new features CSEE offers for the coming update.

But since we also decided to take the opportunity to make the next update a full reimage for Middle East 3.00, I've been working on game documentation, too.

For the past several days I have edited Berto's CSEE How-To documents into game manual format, first for Middle East How-to guideline originally written for Middle East 2.0, or Volume I, as I named it. That was some 50 pages to edit, so nothing there, really, except a neat walk in the memory lane. The guideline still serves as a nice briefing on the Event Engine.

What took much longer was to edit his Vietnam 1.0 Rung Sat scenario CSEE scripting efforts he documentend in the Vietnam forum. At around page 180 I thought that covers it well enough, so that is now another CSEE How-To guideline, marked as Volume II.

Both of them are available for download in my CS Legion post: https://cslegion.com/coder-diary/cs-eve ... -i-and-ii/ (link opens to our CS Legion website post).

Also: both guidelines will be available in both games in their Manuals folder for ease of access.

Another teaser from that post is a quick overall summary of latest and greatest with the next Middle East 3.00 update.

What do you think? I am happy to answer any questions you guys might have.
Part two of my planned Scripted AI trilogy is now available on our CS Legion website: https://cslegion.com/coder-diary/script ... briefings/

This time, I dive into some of the new CSEE features by exploring our Scenario Briefings and highlighting what’s new under each SMEAC letter.

All the samples are from the Vietnam game, but worry not, these goodies will also be part of Middle East 3.0.

The final part of the trilogy, focusing on the new Battle Plans, is hopefully coming out by the end of the month.
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: 18156
Joined: Sun Jul 05, 2009 8:57 am

Re: Sneak Peeks, Coming Attractions, Works-In-Progress

Post by Crossroads »

Time to get started with the Middle East sneak peeks thread again, too. I put a couple of posts in the Vietnam sneak peeks, discussing the work-in-progress idea of having separate, non-modal dialogs first for Scenario Briefings (so you can keep it open all the time while playing), and also for an alternate stream dialog for all those little pop-up messages that come and go: damage results, assault dialog, command reports, AI reports, various other events, too. IntelFeed will use an existing dialog title from the original source when available (last message streamed at the top was from AI Report), and if not available, will display "IntelFeed".

Here is the new Option - Damage Results - IntelFeed, at left, and Scenario Briefing, at right, and the game in the middle, easily centered using the W11 Snap Layouts feature. I have a widescreen, so this is a natural fit for me. For those of you with dual or single displays, well, you can resize and place them around as you wish. IntelFeed will always stay at top, Scenario Brefing will display itself at top anytime there is a new report to display.

There was a suggestion to make them interactive, too, for instance so that you can click at hexcoors there, and the map would move hotspot to said location. It is all done for IntelFeed (each of the hex tags in yellow are hyperlinks), but not yet for Scenario Briefings. It is a neat feature, and I am sure Scenario Briefings and other similar reports will benefit for player able to view any mentioned location (with a tagged hexcoor) by a click of the mouse.

Here it is in full size. Right click at picture and opt to open the image in a new tab.

Edit: oh, I have by now replaced all Arial and Times New Roman fonts in the games with Windows systems font. Unit list, Hex Info titles are drawn into graphics, I am in the process for redesigning the whole Unit List sidebar, so they are what they are for now.

What do you guys think?

me_intelfeed_scenbrief.jpg
me_intelfeed_scenbrief.jpg (1.61 MiB) Viewed 3151 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: 18156
Joined: Sun Jul 05, 2009 8:57 am

Re: Sneak Peeks, Coming Attractions, Works-In-Progress

Post by Crossroads »

Copying this post here, too. Per popular request: support for multiple display with Scrolling > Screen Edge option.

I have now put in place code that defines a larger area with left and right screen edges (70 pixels) while only slightly extending the top and bottom scroll trigger areas (5 pixels). Vertical in this manner, for otherwise it intercepts when accessing game Menu at top, or game icon row(s) at bottom.

What do you think, this should do it, yes?
Crossroads wrote: Sat May 17, 2025 11:42 am From the Vietnam Tech Support subforum: a request to have screen edge scrolling supporting multiple displays. In other words, only scroll when cursor near the edges of the display where the game window resides. Once you leave that display to your other display(s), scrolling should stop. Implemented and available in the late summer Update:
Crossroads wrote: Sat May 17, 2025 11:39 am
Crossroads wrote: Sat May 17, 2025 8:41 am Sat down today to implement this. Available in the next Update. I set an area of 70 px wide around the screen edges that invoke each of the scroll directions. Once you exit the display the game runs on, it stops scrolling.

Edit Available in 2.00.04, that is. The release version (2.00.03) of the current 2.00.02 Public Beta is already handed out to Matrix tech team a couple of weeks ago. 2.00.03 likely becomes available next week.
Redefined this further as we want access to game Menu or Minimize/Maximize buttons, and to game icons at the bottom, without triggering scrolling. I believe this should do it:

Code: Select all

const int SCROLL_MARGIN_HORIZONTAL = 70; // pixels from the left/right edge to start scrolling
const int SCROLL_MARGIN_VERTICAL = 5;    // pixels from the top/bottom edge to start scrolling
I guess most players have their multiple displays next to each other horizontally, not on top of each other. Right?
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)
Post Reply

Return to “Campaign Series: Middle East 1948-1985”