RE: Sneak Peeks, Coming Attractions, Works-In-Progress
Posted: Sat Nov 18, 2017 2:32 pm
During the lull, I'm tinkering with the Iranians for a future Iran-Iraq War DLC for Middle East.


What's your Strategy?
https://forums.matrixgames.com:443/
ORIGINAL: Crossroads
ORIGINAL: Warhorse
Er, correction, we do in the WW2 games, not the new ones...yet, but I will!! I remembered making one for the Forgotten Battles Mod, for the Priests included in the West Front/East Front games. Just need to add it to the growing counter sheet!
What! We're missing a NATO symbol [X(] I thought the 450+ that's already there covers the world, and back [:'(]
ORIGINAL: Crossroads
Band, we definitively need a band! [:D]
ORIGINAL: harry_vdk
We had packman within our company
ORIGINAL: berto
CSEE How-To screenshot:
![]()
ORIGINAL: berto
CSEE How-To screenshot:
![]()
ORIGINAL: berto
CSEE How-To screenshot:
![]()
ORIGINAL: berto
From the work-in-progess CSEE How-To:
Akin to the on_unit_kill() function is on_unit_reduce(), for example:
------------------------------------------------------------------------------------------------------------------------
function on_unit_reduce (x, y, trackid, pid, name, side, nation, oid, orgname, points, strength, HQ, Leader, loss) -- DO NOT REMOVE
if string.find(orgname, "Engineer") ~= nil and
side == ISRAELI_SIDE then
note(true, "Comment", "Be careful with, be sure to protect your engineer units. You need them to breach the Old City walls.")
end
end
------------------------------------------------------------------------------------------------------------------------
In this example, if an Israeli engineer unit suffers point reduction, we want to display a pop-up reminding the Israeli player to be careful with such units.
A conundrum: How do you determine if a unit is engineers or not?
There is a standard CSEE function, counter_type(), like so:
-------------------------------------------------------------------------------
FUNCTION
counter_type (trackid)
DESCRIPTION
For the given trackid (counter), returns its type value.
INPUTS
trackid -- integer; 0 or greater
RETURN VALUE
Returns a value (not a quoted string!), any of:
ARMOR
ARTILLERY
INFANTRY
HEADQUARTERS
LEADERS
OFFMAP_AIRCRAFT
RECON_VEHICLES
HELICOPTERS
NAVAL
TRANSPORTS
ANTI_AIRCRAFT
RAIL
MISC
ANTI_TANK
SPARE
EXAMPLES
if counter_type () ~= ARMOR then
...
end
SEE ALSO
-------------------------------------------------------------------------------
But where do you see ENGINEER in that type list? You don't! Unfortunately, there doesn't seem to be any unit ID number range that universally signifies the engineer type. What to do then?
With a bit of advanced Lua, we can determine if a given unit is an engineer. You will observe where one of the on_unit_reduce() inputs is the unit's orgname. We can use one of the standard, built-in Lua string library functions, find(), to see if "Engineer" appears anywhere in the unit's orgname. If it does appear, then string.find() returns a non-nil value, and '~= nil' (doesn't equal nil) evaluates to true. So the if condition is satisfied, we have an engineer!
Hmm. In future, we might want to determine if other units, in other scenarios, are engineers. How about we define an isengineer() function, in user.lua:
-------------------------------------------------------------------------------
function isengineer (trackid)
local name = counter_name (trackid)
local orgname = counter_orgname (trackid)
return string.find(name, "Engineer") ~= nil or
string.find(orgname, "Engineer") ~= nil
--[[
if string.find(name, "Engineer") ~= nil or
string.find(orgname, "Engineer") ~= nil then
return true
else
return false
end
]]
end
-------------------------------------------------------------------------------
Note the use of the --[[ ]] multi-line comment, to demarcate an alternative way to return true or false.
This function is superior to our earlier check, is more general, because it checks both the counter name and its orgname to see if either contains the word "Engineer". (We could, if we really wish to, make this case insensitive, so that unit names or orgnames with "engineer" (lower case) would match also. Too, we might look for matches on abbreviations, such as "engr". We must be very careful, however, because we might extend the match set so broadly as to invite false positives.)
With the isengineer() function defined, the above code could be redone as
------------------------------------------------------------------------------------------------------------------------
function on_unit_reduce (x, y, trackid, pid, name, side, nation, oid, orgname, points, strength, HQ, Leader, loss) -- DO NOT REMOVE
if isengineer (trackid) and
side == ISRAELI_SIDE then
note(true, "Comment", "Be careful with, be sure to protect your engineer units. You need them to breach the Old City walls.")
end
end
------------------------------------------------------------------------------------------------------------------------
In fact, this technique is so powerful that we could define (in user.lua) all manner of custom is*() functions, such as:
isjeep ()
isrclr ()
ismortar ()
ishowitzer ()
ismachinegun ()
ishorse ()
iscamel ()
and on and on.
Nifty, huh? [:)]
ORIGINAL: berto
The Reconnoiter (instant recon) feature in action:
The selected (yellow highlight) American Reconnaissance 66 has just exercised the instant recon option, which suddenly revealed the previously hidden NVA sniper unit (orange circle) lurking in the jungle beyond. Now, rather than blundering forward into an opfire ambush, I can plan ahead what I will do about the sniper(s).
Yay for the Reconnoiter (instant recon) feature!
We are still sorting out issues like these.ORIGINAL: Three63
I like the graphical style on that CS: Vietnam picture above a lot. I'm glad you guys are keeping the CS series alive and with a cool future! Are Snipers going to be easier for a platoon to kill? Can they aim at leaders in the stack?
We are in the process of tweaking this, reducing the ability/likelihood of recon units to spot and unconceal sniper units at such long range. Also to make detecting sniper units much harder in general.ORIGINAL: berto
Another recent (private) Dev Forum post:
ORIGINAL: berto
The Reconnoiter (instant recon) feature in action:
The selected (yellow highlight) American Reconnaissance 66 has just exercised the instant recon option, which suddenly revealed the previously hidden NVA sniper unit (orange circle) lurking in the jungle beyond. Now, rather than blundering forward into an opfire ambush, I can plan ahead what I will do about the sniper(s).
Yay for the Reconnoiter (instant recon) feature!