Dev Diary #09: CS Event Engine

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: 17498
Joined: Sun Jul 05, 2009 8:57 am

RE: Dev Diary #09: CS Event Engine

Post by Crossroads »

And here's the final detail for the original event wish list I posted at the Opening Post: loss of their Battalion HQ will have a negative effect on British morale. I mean why not, can't be much fun to duke it out at Sirte with all contact to Malta base gone, and everyone on their own!

This calls for a random() function too: not only will be the British morale hit, but it will be randomly reduced by a value between one and three. Hard!

Here's the sample:

[*] A new function: inc_morale_shift() is used to increment / decrement the morale level depending the value given. We're decrementing, hence multiplying by -1 in the code.
[*] Another new function: debug() can be used to pop up a message but only if the lua file specifies it is used in debug mode, like here.

See the Brits with their morale down by 1 in the snippet there. Lucky guys, could have been worse.

Looking at this, maybe the Libyans should receive a little boost for their morale, for their achievement, too. That would spiff up the battle just nicely!

Image
Attachments
sirte_lua10.jpg
sirte_lua10.jpg (522.42 KiB) Viewed 143 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < Available now
CS: Middle East 1948-1985 2.0 < 3.0 In the works
User avatar
Crossroads
Posts: 17498
Joined: Sun Jul 05, 2009 8:57 am

RE: Dev Diary #09: CS Event Engine

Post by Crossroads »

ORIGINAL: berto

The Campaign Series Lua Event Engine is now up to 164 functions, and continues to grow in expressiveness and capability.


Always busy busy busy, our Berto! I updated the Post #3 with the current function inventary. Trigger functions first, on alphabetical order, other functions then.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < Available now
CS: Middle East 1948-1985 2.0 < 3.0 In the works
User avatar
Warhorse
Posts: 5369
Joined: Fri May 12, 2000 8:00 am
Location: Birdsboro, PA, USA
Contact:

RE: Dev Diary #09: CS Event Engine

Post by Warhorse »

This is gonna be awesome!![&o]
Mike Amos

Meine Ehre heißt Treue
www.cslegion.com
User avatar
Jafele
Posts: 776
Joined: Wed Apr 20, 2011 7:27 am
Location: Seville (Spain)
Contact:

RE: Dev Diary #09: CS Event Engine

Post by Jafele »

Interesting, quite interesting.
Las batallas contra las mujeres son las únicas que se ganan huyendo.

NAPOLEÓN BONAPARTE


Cuando el necio oye la verdad se carcajea, porque si no lo hiciera la verdad no sería la verdad.

LAO TSE
mheard
Posts: 25
Joined: Thu Sep 03, 2009 11:37 pm

RE: Dev Diary #09: CS Event Engine

Post by mheard »

Is the Event Engine contained within Middle East Version 2.00? If not, will it arrive as V2.01 or?

Many thanks...
Oberst_Klink
Posts: 4839
Joined: Sun Feb 10, 2008 7:37 pm
Location: Germany
Contact:

RE: Dev Diary #09: CS Event Engine

Post by Oberst_Klink »

ORIGINAL: mheard

Is the Event Engine contained within Middle East Version 2.00? If not, will it arrive as V2.01 or?

Many thanks...
Martin

check your \Campaign Series Middle East\manual folder and there should be the CSEEHowTo.PDF

That explain how to modify/create the .LUA files for those events.

Klink, Oberst
My Blog & on Twitter.
Visit CS Legion on Twitter & Facebook for updates.
User avatar
Crossroads
Posts: 17498
Joined: Sun Jul 05, 2009 8:57 am

RE: Dev Diary #09: CS Event Engine

Post by Crossroads »

Also, look for scenarios with [CS Event Engine Enabled] on their Scenario descriptions, then look at their *.lua files for samples if you wish.

Those scenarios would be, off my head:

[*] all five Bootcamp scenarios
[*] all five Teaching set scenarios
[*] all Crisis in Sirte scenarios
[*] Long Road Home
[*] Jerusalem48_csee as per CSEE How-To document Berto wrote, detailing what goes there.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < Available now
CS: Middle East 1948-1985 2.0 < 3.0 In the works
User avatar
athineos
Posts: 165
Joined: Thu Jan 05, 2017 10:29 pm
Location: Kansas City, USA

RE: Dev Diary #09: CS Event Engine

Post by athineos »

Thanks for the info. I would like dedicate a little time in the future to learn more about .LUA files as the only programming language I was ever exposed to was COBOL back in college. I have played very little of ME so far. Most of my gaming time goes to JTCS.
User avatar
Crossroads
Posts: 17498
Joined: Sun Jul 05, 2009 8:57 am

RE: Dev Diary #09: CS Event Engine

Post by Crossroads »

ORIGINAL: athineos

Thanks for the info. I would like dedicate a little time in the future to learn more about .LUA files as the only programming language I was ever exposed to was COBOL back in college. I have played very little of ME so far. Most of my gaming time goes to JTCS.

Go ahead, give it a try, start simple, perhaps copy one snippet from a scenario file that already has Events in place, and try it out. I know COBOL too, a special favourite of mine (with emphasis on word special, it is a very unique language). Anyone familiar with Basic, for instance, or Java, or what not in fact, should be able to get into these.

Berto did a great job in abstracting most of the stuff, so typically you'd just need to understand which Event Function you want to be called, and what parameter it takes. Good luck!
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < Available now
CS: Middle East 1948-1985 2.0 < 3.0 In the works
User avatar
athineos
Posts: 165
Joined: Thu Jan 05, 2017 10:29 pm
Location: Kansas City, USA

RE: Dev Diary #09: CS Event Engine

Post by athineos »

ORIGINAL: Crossroads

ORIGINAL: athineos

Thanks for the info. I would like dedicate a little time in the future to learn more about .LUA files as the only programming language I was ever exposed to was COBOL back in college. I have played very little of ME so far. Most of my gaming time goes to JTCS.

Go ahead, give it a try, start simple, perhaps copy one snippet from a scenario file that already has Events in place, and try it out. I know COBOL too, a special favourite of mine (with emphasis on word special, it is a very unique language). Anyone familiar with Basic, for instance, or Java, or what not in fact, should be able to get into these.

Berto did a great job in abstracting most of the stuff, so typically you'd just need to understand which Event Function you want to be called, and what parameter it takes. Good luck!


You have recommended notepad++ as a text editor. Where is the best place to get that? Thanks
User avatar
Crossroads
Posts: 17498
Joined: Sun Jul 05, 2009 8:57 am

RE: Dev Diary #09: CS Event Engine

Post by Crossroads »

Here's their homepage: Notepad-plus-plus
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < Available now
CS: Middle East 1948-1985 2.0 < 3.0 In the works
User avatar
athineos
Posts: 165
Joined: Thu Jan 05, 2017 10:29 pm
Location: Kansas City, USA

RE: Dev Diary #09: CS Event Engine

Post by athineos »

Thanks Crossroads!
User avatar
Crossroads
Posts: 17498
Joined: Sun Jul 05, 2009 8:57 am

RE: Dev Diary #09: CS Event Engine

Post by Crossroads »

[:)]
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < Available now
CS: Middle East 1948-1985 2.0 < 3.0 In the works
Post Reply

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