No Guts No Galaxy

BattleTech and MechWarrior => MechCommander => MechCommander Modding => Topic started by: Mech on 1 Aug 17

Title: MCG coding
Post by: Mech on 1 Aug 17
i've been attempting to understand and confirm the use of the functions shown by CMunsta....here's a few scraps of code that i've checked so far.

   

Code: [Select]
    //setObjectDamage(Mech_Bay_021024000,var);

    //setObjectDamage(Mech_Bay_021026000,GetObjectDamage(Mech_Bay_021024000));
    
    //CallStrike(508, -1, 1476.0, 478.0, -1.0, TRUE);

    //CallStrikeEx(507,-1,1476.0, 478.0,-1.0,TRUE,5.0);


*************************************************************************

the first example sets the damage amount of a designated building. The value may be incremented over time until the building is destroyed (0 = no damage to 100 = destroyed).

the second example shows that the damage amount of the first building may be applied to another building too.

eg: creation of splash-zone effect.

3rd and 4th examples are 2 variants of the same thing. One includes a time factor between strikes.

Both appear to require positioning of the strike point near to CLAN? movers otherwise the action fails and an error sound is given.


*************************************************************************

Using Cmunsta's "Giving In-Mission Drop Groups" example ex8.


Find Mystique effect.

Unit powers up when you approach and joins your team.


Code: [Select]
      var
            static integer Ally;

function init;

       code
            Ally = GetVehicleID(PLAYER_FORCE,1,0);

endfunction;

       code
            if ((distancetoobject(PLAYER_FORCE,Ally) < 35) and (GetObjectActive(Ally) == 0)) then
                 SetObjectActive(Ally, TRUE);
            endif;




"found" units can "find" other units too, since they all become part of the team.

*************************************************************************

"In-Mission Drop Groups" 

can be Mobile Artillery that fire upon your command when given the .Fit file st ObjectProfile PV21150 instead of PV21100.
Title: Re: MCG coding
Post by: RizZen on 2 Aug 17
Great due to my limited time amount I would like to see more of that. Will make mission creation easier ^^
Title: Re: MCG coding
Post by: Mech on 2 Aug 17
cool

will add what i can and will be doing that mostly with working code examples if possible.

here's another bit.

********************************************************************************************
update for Cmunstas' CBG2(rev0.3)
********************************************************************************************

ObjectStatus(integer ObjectID) : integer;

********************************************************************************************
********************************************************************************************
list of return values found in OConst.abi 

OBJECT_STATUS_NORMAL = 0;
OBJECT_STATUS_DISABLED = 1;
OBJECT_STATUS_DESTROYED = 2;
OBJECT_STATUS_STARTING_UP = 3;
OBJECT_STATUS_SHUTTING_DOWN = 4;
OBJECT_STATUS_SHUTDOWN = 5;
OBJECT_STATUS_WITHDRAWN = 6;
OBJECT_STATUS_INVISIBLE = 7;

********************************************************************************************
********************************************************************************************

example usage
********************************************************************************************


Code: [Select]
    //OBJECT_STATUS_NORMAL = 0
    if (ObjectStatus(Mech_Bay_021024000) ==0) then

          //slowly damage mechbay1
          setObjectDamage(Mech_Bay_021024000,incrementing variable);

          //alter value to show a delayed value on healthbar of mechbay2
          //setObjectDamage(Mech_Bay_021026000,incrementing variable - 20);

    else

          //OBJECT_STATUS_DESTROYED = 2
          // mechbay1 is destroyed after the incrementing value reaches 100
          if  (ObjectStatus(Mech_Bay_021024000) ==2) then

                 //get value from mechbay1 and apply to mechbay2
                 //value is equal to 100 causing "destroyed state"
                 //setObjectDamage(Mech_Bay_021026000,GetObjectDamage(Mech_Bay_021024000));

                 //make a value eg: 2 * 10 = 20 taken from returned value of object state of mechbay1
                 //and apply it to mechbay2 to show percentage on health bar 20/100
                 setObjectDamage(Mech_Bay_021026000,ObjectStatus(Mech_Bay_021024000)*10);

                 //just set the value that equates to destruction
                 //setObjectDamage(Mech_Bay_021026000,100);

          endif;

      endif;


********************************************************************************************
nb: the mechbay names/numbers "ObjectID Handles" are specified in the STR.ABI file of an example mission.
      incrementing variable is run in a function like the playbetty example.

********************************************************************************************
********************************************************************************************
Title: Re: MCG coding
Post by: Mech on 3 Aug 17
not sure now if all those return values are working

OBJECT_STATUS_NORMAL = 0;
OBJECT_STATUS_DISABLED = 1; ??
OBJECT_STATUS_DESTROYED = 2;
OBJECT_STATUS_STARTING_UP = 3; ??
OBJECT_STATUS_SHUTTING_DOWN = 4; ??
OBJECT_STATUS_SHUTDOWN = 5;
OBJECT_STATUS_WITHDRAWN = 6; ??
OBJECT_STATUS_INVISIBLE = 7; ??

0, 2 and 5 are fine but i get a 3 "starting up" when i check on a unit thats been ordered to withdraw. haven't been able to get a 6 "withdrawn" or 7 "invisible" yet, although that's what also happens to a unit that withdraws.

i shot a mech in the leg until it was lame but it didn't return a "disabled" 1 value.

here's some code that performs an action of powering up or powering down an enemy mech depending on whether you approach or move away.
Code: [Select]
//     Powerup and Powerdown (for mission ABL file)

//------------------------------------------------------------------
//     Variable Declarations
//------------------------------------------------------------------
            static integer Turkina;
//------------------------------------------------------------------
//     Init Function
//------------------------------------------------------------------
            Turkina = GetVehicleID(CLAN_FORCE,0,1);
//------------------------------------------------------------------
//     Main Code
//------------------------------------------------------------------
            //Turkina GetVehicleID == 896
            //Turkina GetTerrainObjectPartID == 54848

            //if (Turkina == 896) then
                  //setObjectDamage(Mech_Bay_015382000,Turkina/10);
            //endif;
 
            if (ObjectStatus(Turkina) == 5) and (distancetoobject(PLAYER_FORCE,Turkina) < 50) then
                  SetObjectActive(Turkina, TRUE);
                  SelectWarrior(GetPilotID(Turkina));
                  OrderPowerUp;
            else
                 if  (ObjectStatus(Turkina) == 0) and (distancetoobject(PLAYER_FORCE,Turkina) > 50) then
                      SelectWarrior(GetPilotID(Turkina));
                      OrderPowerDown;
                 endif;
            endif;
at the start are some values i was able to find the hard way showing the numbers assigned to a turkina for its VehicleID and its GetTerrainPartID.
Title: Re: MCG coding
Post by: RizZen on 3 Aug 17
Did you check if these are in abl library? There is a library containing all available commands - only these should work.
Title: Re: MCG coding
Post by: Mech on 3 Aug 17
which one is that?

i've got the MCG extracted files, do you mean its one of the ABL files in the MISSION.FST folder?

there's several clan brains there that seem to use that list of "object status" i was looking at.

example cbrain01.abl

OBJECT_STATUS_NORMAL = 0;
OBJECT_STATUS_DISABLED = 1;
OBJECT_STATUS_DESTROYED = 2;
OBJECT_STATUS_STARTING_UP = 3;
OBJECT_STATUS_SHUTTING_DOWN = 4;
OBJECT_STATUS_SHUTDOWN = 5;

*********************************************

some code to make an enemy APC become active or non active due to player force proximity.

APC will display a mouseover message of "APC" or "No Crew" if its active or not.
Code: [Select]
//      APC :  Active = Crewed / Inactive = No Crew (for mission ABL file)

//------------------------------------------------------------------
//     Variable Declarations
//------------------------------------------------------------------
            static integer APC;
//------------------------------------------------------------------
//     Init Function
//------------------------------------------------------------------
            APC = GetVehicleID(CLAN_FORCE,0,0);
//------------------------------------------------------------------
//     Main Code
//------------------------------------------------------------------
            if (ObjectStatus(APC) == 0) and (distancetoobject(PLAYER_FORCE,APC) < 50) then
                  SetObjectActive(APC, true);
            else
                 if  (ObjectStatus(APC) == 0) and (distancetoobject(PLAYER_FORCE,APC) > 50) then
                      SetObjectActive(APC, false);
                 endif;
            endif;
Title: Re: MCG coding
Post by: RizZen on 3 Aug 17
Nope, there is another file containing all available abl commands. When I remember right it's a csv file. But I'm not sure...

Have a look here also:
http://www.hard-light.net/forums/index.php?topic=89196.0 (http://www.hard-light.net/forums/index.php?topic=89196.0)
Title: Re: MCG coding
Post by: Mech on 3 Aug 17
 i saw that page recently, wasn't sure how much of it applied to MCG  since it seemed to be in relation to the omnitech upgrade? of MC2. "List of ALL NEW (or fixed) ABL COMMANDS"

btw, i like mc2 as well, but at the moment am focused on MCG since i found Cmunstas' stuff after making another map recently and thinking about trying to extend the capabilities of the editor again.

this is a rough list i've been using, hopefully there'll be some more "commands?, orders?, functions?" to add.
(https://www.dropbox.com/pri/get/MCG/functions.gif?_subject_uid=395226197&raw=1&size=1280x960&size_mode=3&w=AABr0zsmBoneRgrDwgsBwcis22qaI1TohXVLfQuA3796DA)
Title: Re: MCG coding
Post by: Mech on 3 Aug 17
VehicleID();
GetVehicleID();

**********************

VehicleIDs numbered according to SORT ORDER of team, type and weight?


1 Player controlled Inner Sphere Lance/s and player controlled Allies of Inner Sphere first?
2 then Clan?
3 then uncontrolled Allies of Inner Sphere?

***********************************************************************

(Commander0) player control

player team - group 0?

1st unit = 512 - player controlled active lance?
2nd unit = 513 -  "                 "                    "
3rd unit = 514 -  "                 "                    "
4th unit = 515 -  "                 "                    "
5th unit = 516 -  "                 "                    "
6th unit = 517 -  "                 "                    "
7th unit = 518
8th unit = 519
9th unit = 520
10th unit = 521
11th unit = 522
12th unit = 523

player team - group1 - player controlled allies ("in mission drop group") via fit file editing

13th unit = 524 (heaviest mech) Atlas
14th unit = 525 (lightest mech) Firestarter
15th unit = 526 (heaviest vehicle) Alacorn
16th unit = 527 (lightest vehicle) Savannah
17th unit = 528
18th unit = 529
etc

***********************************************************************

(Commander1)

enemy - group 0

1st unit = 896 (heaviest mech) Masakari
2nd unit = 897 (mid mech) hunchback
3rd unit = 898 (lightest mech) Cougar
4th unit = 899 (heaviest vehicle) Shrek
5th unit = 900 (lightest vehicle) Pegasus
6th unit = 901
7th unit = 902
8th unit = 903
9th unit = 904
10th unit = 905
11th unit = 906
12th unit = 907

enemy - group 1

13th unit = 908
14 unit = 909
15
16
etc

***********************************************************************

(Commander2) non player controlled allies

allied - group 0

1st unit = 1280 (heaviest mech) Thor
2nd unit = 1281 (mid mech) Loki
3rd unit = 1282 (lightest mech) Uller
4th unit = 1283 (heaviest vehicle) Rommel
5th unit = 1284 (lightest vehicle) Swiftwind
6th unit = 1285
7th unit = 1286
8th unit = 1287
9th unit = 1288
10th unit =1289
11th unit = 1290
12th unit = 1291

allied - group 1

13th unit = 1292
14th unit = 1293
15
etc

**********************

see misconst.abi for abbreviated listings.

        //------------------
        // GENERIC PARTS
        //------------------
        PLAYER_VEHICLE0_LANCE0       = 512;
        PLAYER_VEHICLE1_LANCE0       = 513;
        PLAYER_VEHICLE2_LANCE0       = 514;
        PLAYER_VEHICLE3_LANCE0       = 515;
        PLAYER_VEHICLE0_LANCE1       = 524;
        PLAYER_VEHICLE1_LANCE1       = 525;
        PLAYER_VEHICLE2_LANCE1       = 526;
        PLAYER_VEHICLE3_LANCE1       = 527;
        etc

*********************************************************************

if the sort order is understood, all movers can be known beforehand by number.
these are constants created according to the set up by the person that makes the mission.

**********************
Title: Re: MCG coding
Post by: Mech on 4 Aug 17
ObjectTypeID();

object type id for allied and enemy units and buildings.

if the unit is part of the allied team then it doesn't matter if its a mech or a vehicle, it will always return -1.

            //(ObjectTypeID(Atlas) ==-1)
            //(ObjectTypeID(Firestarter) ==-1)

            //(ObjectTypeID(Alacorn) ==-1)
            //(ObjectTypeID(Savannah) ==-1)


if its an enemy mech it will return a 2 digit number which may be listed somewhere, or may be generated on the spot?

            //(ObjectTypeID(Masakari) ==58)
            //(ObjectTypeID(Hunchback) ==17)
            //(ObjectTypeID(Cougar) == 53)


if its an enemy vehicle it will return the number seen in the Tedlds.csv file of the editor.

            //(ObjectTypeID(Shrek) == 470)
            //(ObjectTypeID(Pegasus) == 471)


if its a building it will also return the number seen in the Tedlds.csv file of the editor.

            //(ObjectTypeID(Mech_Bay_015384000) ==633)
Title: Re: MCG coding
Post by: Mech on 4 Aug 17
it seems like some MCG specific virus is attacking my installation/s of the game.

i think i got it from when i downloaded and tried to run Exodus/Turncoat and the same thing happened with XenocideBengalLancers.

Both affected the brightness setting and froze at the briefing menu.

changing the monitor screen refresh rate seemed to keep the games from freezing or crashing until i attempted to enter a mission. the general result is lock up with the need to reboot.

the problem at first was only affecting those games but now its spread to my own game copy with the effect first being noticed with the loss of the usability of the editor.

now if i try to make a clean install of the game i find that it locks up when i try to go to the purchasing screen.
or if i try to run a test mission.

in all cases, hitting ctrl-alt-dlt would fail to drop the app to the taskbar. instead i can see flickering low res buttons and tabs along the area of the taskbar which are no help. but show the exact same effect that i first noticed from Exodus/turncoat.

i downloaded and ran those games a week or 2 before i came here.
Title: Re: MCG coding
Post by: RizZen on 4 Aug 17
I dont think it's virus. My installation of all versions are running clean and without any issues. Maybe you made some changes on system that cause issues?

Edit: May you gimme your system infos? Such like i described here (http://www.nogutsnogalaxy.net/forum/index.php?topic=4431.msg25747#msg25747)?
Title: Re: MCG coding
Post by: Mech on 4 Aug 17
i don't believe i made any changes except for running Exodus/turncoat and Xenocide/BengalLancers a few weeks before.

- system ur running (win10 64bit f.e.)

what's f.e?
winxp pro sp3 32bit dual core cpu. e6500 @ 2.93ghz. 3.46gb ram.


- game version ur running (darkest hours full version 2.0d f.e.)

Mechcommander Gold. "Desperate Measures". Cd burnt copy from original copy.


- try to explain exactly the problem

i did a bit.

the problem started when i went to use the editor again (like i had just 5 minutes beforehand) after going through the gui selection process (of map creation or editing) the editor failed to display the workspace to allow mission editing.

this had also happened a week or so ago just before i came here.

back then, i reinstalled MCG and everything seemed okay again except that i noticed the issue with screen brightness had transferred itself from Exodus/turncoat and Xenocide/BengalLancers.

the screen brightness was suddenly too high and i had to set the "preferences" level to 0.

(side note) also, when i look at the pictures on that bug report page they look the same as Exodus/turncoat and Xenocide/BengalLancers. ie: overbright.

now i can't run the MCG gamespace or get a usable product from the editor.

- what game feature u use (original/expansion campaign / solo- / multi-player missions)
attempted to use the editor again. after reinstalling, attempted to use the programme as usual. i find the editor works again after a reinstall but it still crashes the game if i try to run a mission i make.

- what mission / map causes the problem (overview here)
none (all?), it freezes the computer when i try to navigate around the briefing and purchasing menus (same with Exodus/turncoat and Xenocide/BengalLancers).

- awesome help would be screenshots or error reports from game when it crashes
there's no error report. a screenshot probably won't show more than i described, maybe i'll try.

again. i didn't have these problems unitl i downloaded those games and any attempt at installing a new copy of the game (or using any copy anywhere on my hard drive) causes exactly the same effects as seen from those DL games.



(DL'ed Exodus/Turncoat 25/07/17 and XenocideBengalLancers 31/07/17)
Title: Re: MCG coding
Post by: Mech on 4 Aug 17
i found that hitting alt-enter to drop the game to windowed mode prevents the need to reboot (as long as i do that before i do anything that causes it to freeze). i'm then able to use the task manager to "end task" the app when it does freeze up.

here's an error message after the game crashed when i tried to run op1 mission1 (of original campaign).

(https://www.dropbox.com/pri/get/MCG/errormessage.gif?_subject_uid=395226197&raw=1&size=1280x960&size_mode=3&w=AAA_79kuP3nBDRtIe33yt0f4Dgia3qWVXRZtz3O3dkL_9Q)
Title: Re: MCG coding
Post by: RizZen on 5 Aug 17
Sorry this doesn´t make sense. I can´t help you. Screenshot would be enough, what should i do with java script? And please upload somewhere else, not dropbox, hate that.

Im impressed you could start and work with editor on XP... - i only can get it to run on windows 98.

Your ingame resolution / Color problems are caused by your individual graphic settings / configuration.

Try to play it without installing like i describe here (http://www.nogutsnogalaxy.net/forum/index.php?topic=4429.msg25744#msg25744).

When you had hope using editor to edit existing missions - im sorry to disappoint you. Editor never allowed that. Only creation of new maps - and only in it´s limited limits and content. For doing more it always needed abl scripting.
Title: Re: MCG coding
Post by: Mech on 5 Aug 17
"Sorry this doesn´t make sense. I can´t help you. Screenshot would be enough, what should i do with java script? And please upload somewhere else, not dropbox, hate that."

That's the only type of error message that pops up?
and if you can recommend another site that hosts pics (thats better) then okay, i'm just using what i've found?


"Im impressed you could start and work with editor on XP... - i only can get it to run on windows 98."

the only problem i have with MCG on xp is the screen refresh rate. it seems to want 75hz (to display the framing/view of the game correctly) when i ordinarily have the monitor set to 60hz.
if its set to 60hz it plays fine but the image is stretched a bit horizontally cutting the edges of the image off.
this is on a screen set to 1280*720 res. i hadn't noticed any problems with the editor.

"Your ingame resolution / Color problems are caused by your individual graphic settings / configuration."

maybe.

"Try to play it without installing like i describe here."

i have win7 on another drive and was in the process of switching over from xp. so i might try that method you showed on how to run MCG on win7 etc.
i made an iso image of the cd and just have another step or 2 to do and i might get the engine up and running again.

"When you had hope using editor to edit existing missions - im sorry to disappoint you. Editor never allowed that. Only creation of new maps - and only in it´s limited limits and content. For doing more it always needed abl scripting."

no i wasn't saying i was trying to edit existing missions. i said that now when i try to make a mission and then try to run it, it causes the game to crash.

and yes, i was meaning that ABL scripting (coding) was required to extend the editor. that's why i started a page on the subject and am working at getting some results.

i'm not meaning to cause any disharmony here, would prefer just to get back to work.

Title: Re: MCG coding
Post by: Mech on 5 Aug 17
btw

i thought the packaged form of Exodus/Turncoat, Xenocide/BengalLancers etc was great.

replacement of the original campaigns with the new campaigns on a clean version of the game.

so it can be run as a separate app without the problems of installation/uninstallation of files.

excellent method.

was planning to get Darkest hours at some stage too. but its over a gig so...soonish.
Title: Re: MCG coding
Post by: Mech on 5 Aug 17
the brightness problem might be part way to do with personal preferences for "the look of the game".

the mission images from this page look right to me "brightness-wise".

the tones contrasts and colours look deep and rich...and neither too bright nor too dark.

http://www.nogutsnogalaxy.net/forum/index.php?topic=1837.0 (http://www.nogutsnogalaxy.net/forum/index.php?topic=1837.0)
Title: Re: MCG coding
Post by: RizZen on 5 Aug 17
They made brightness changes by editing prefs.cfg... so usually you should have same graphic settings like in repulse by using its preferences.
Darkest hours is that big cause it contains all other versions. So using darkest hours makes turncoat and all other standalone versions obsolete. And it's prepared same way like they where done, everything is pre installed. Just download extract and play with mounted ISO.
Title: Re: MCG coding
Post by: Mech on 5 Aug 17
"Darkest hours is that big cause it contains all other versions."

yes, that way nothing gets lost. i was happy to see you'd done that.

your dedication to MC was the main reason i came to this site.

Title: Re: MCG coding
Post by: RizZen on 5 Aug 17
I use editor just for architecture and getting coordinates. Abl-scripting for everything else.
Title: Re: MCG coding
Post by: Mech on 5 Aug 17
looks like things are okay now.

the copy on win7 works. (asks for the cd even though daemon tools considers the iso permanently mounted...no prob there).

but no editor with that copy of "MCX_Original.7z"?

also i got a good clean copy back on xp by scrubbing all remnants of previous installations bar the saved mission, savegame and terrain folders.

so i now have my set up mostly back to how it was, just need to add those files back in and hopefully be back to where i was.
Title: Re: MCG coding
Post by: RizZen on 6 Aug 17
I dont see the need to get editor running on other than basic game versions. When you have a valid installation with running editor you can do all changes with that version by using extracted mission files. The missions can be saved as dpk files and then converted to fst files with extender. The fst files can be shared between all versions cause they contain all missions files then. Only sol files or mpk files for solomissions or multi-player need to be added separate into savegamefiles folders to make them run in-game. So when you have one working editor you can do changes for all... no need to get it run on other versions then.
Title: Re: MCG coding
Post by: Mech on 6 Aug 17
at the time i was looking at win7 as the new platform to run MCG which comes with the problem of incompatibility with the 32bit installation, which (i thought?) was the reason for downloading and installing (actually just unzipping a pre-installed form of the game from a compressed archive) MCX_Original.7z.

that would be my only copy and so i'd also need the editor.

****************************************************************

****************************************
ObjectClass();

Allied and Enemy Mechs and Vehicles are all Class 2

******************
Basemaker
******************
Auxilliary Power == 27
Gate == 31
Gate Control == 27
Large Gate == 31
Large Gate Control == 27
Main Power == 27
Mech Repair Bay == 27
Perimeter Alarm == 27
Sensor Control == 27
Sensor Tower == 27
Turret Control == 27
******************
Commercial
******************
Chemical Plant == 27
Geodesic Dome == 16
Loading Facility == 27
Loading Platform == 27
Relay Station == 16
******************
Explosive Objects
******************
Fuel Tank == 27
Gas Tank == 27
Natural Gas Tower == 27
Oil Derrick == 27
Pressure Tank == 27
Allied Mines == -1
Enemy Mines == -1
******************
Incidental
******************
Barrels == 21
Billboard == 27
Debris == 22
Flag == 21
Junked Cars == 27
Missile Turret (inert) == 27
Quonset Hut == 21
Railroad Tower == 21
Roadblock == 21
Streetlamp == 21
Supply Container == 27
Tent == 21
Water Fountain == 27
Water Tower == 16
Windmill == 27
******************
Industrial
******************
Factory == 16
HazMat Sphere == 27
Heavy Factory == 16
Heavy Industrial == 16
Iindustrial Complex == 27
Industrial Plant == 27
Liquid Storage A == 16
Liquid Storage B == 16
Processing Plant == 16
******************
Landscape
******************
Large Tree A == 21
Large Tree B == 21
Large Tree C == 21
Rock Cluster A == 22
Rock Cluster B == 22
Rock Cluster C == 22
Small Ttree A == 21
Small Tree B == 21
Small Tree C == 21
Small Tree D == 21
Small Tree E == 21
******************
Military Buildings 1
******************
Command Station == 16
Field Office == 16
Field Storage == 16
Guard House == 27
Support Building == 27
Underground Bunker == 16
******************
Military Buildings 2
******************
Blast Deflector == 27
Crew Barracks == 16
Elemental Barracks == 27
Hangar == 27
Mechwarrior Barracks == 27
Mission Control == 16
Sabutai Omnifighter == 27
******************
Mission Objectives
******************
Air Control Tower == 27
Clan Administration Building == 27
Data Center == 27
Extraction Marker == 27
Headquarters building == 27
Hyperpulse Generator == 27
Mobile Orbital Gun == 27
Orbital Gun == 27
******************
Multiplayer Objectives
******************
Artillery Crate == 27
Indestructible Command Station == 16
Indestructible Headquarters == 27
******************
Office Buildings
******************
Large Office Building == 27
Modern Office Building == 16
Office 1A == 27
Office 1B == 27
Office 2A == 27
Office 2B == 27
Office 3 == 27
Small Business == 16
Small Office Building == 16
******************
Residential
******************
Farmhouse == 16
House w/Animating Pool == 27
House w/Pool == 16
Kurita-Style Home A == 27
Kurita-Style Home B == 27
Kurita-Style Home C == 27
Kurita-Style Home D == 27
Modern Farmhouse == 16
Stylish Farmhouse == 16
Two-Flat Home == 27
******************
Rural
******************
Barn == 16
Grain Silo == 16
Large Barn == 16
Long Barn == 16
Small Barn == 16
Twin Silos == 16
******************
Salvage
******************
Component Warehouse == 27
Container Stack == 27
Resource Bunker (Empty) == 16
Resource Bunker (Full) == 16
Resource Warehouse == 27
******************
Turrets
******************
Cannon Turret ==30
Laser Turret ==30
Missile Turret ==30
Pop UP Cannon Turret Dirt ==30
Pop UP Cannon Turret grass ==30
Pop Up Laser Turret Dirt ==30
Pop Up Laser Turret Grass ==30
Pop UP Missile Turret Dirt ==30
Pop UP Missile Turret grass ==30
Turret Control == 27
******************
Urban
******************
City Hall == 27
Fastfood == 27
Meeting Hall == 27
Parking Garage == 16
Pumping Station == 16
Purification Plant == 16
Residential Train Station == 27
Stripmall == 27
Transformer Station == 16
Urban Train Station == 27
Valve Station == 16
Water Processor == 16
****************************************

anything that gets listed in STR.ABI file will be an ObjectClass 27.

the great majority of objects are either class 16 or 27.
this may be due to the amount of animation effects for the object. 16 maybe equals less animation and 27 more.

objects numbered 21 or 22 appear to be ones that movers can drive over and crush like trees, flags, barrels, tents.

weapons are either class -1 for mines or 30 for turrets of all types.

gates are number 31.

nb: in all instances i have and will be, referring only to the original Mechcommander campaign and its resources...ie: Port Arthur.

****************************************
****************************************
Title: Re: MCG coding
Post by: Mech on 7 Aug 17
GetUnitStatus();
GetRepairState();
GetPilotWounds();

Code: [Select]
*************************************************************************************************
//         MECH AND PILOT COMBO STATUS

            // Health of UNIT (total of pilot and vehicle or pilot and mech)?
            if (GetUnitStatus(Test1)==100) then // Mech and Pilot 100% A-OK

                  //display proof of effect or state, etc (yes or no)
                  setObjectDamage(Mech_Bay_015283000,50);
            endif;

---------------------------------------------------------------------------------------------
//         MECH SPECIFIC STATUS

            // check repair level of Mech
            if GetRepairState(Test1) ==100 then // Mech 100% A-OK
                  //don't need to get repaired - do nothing

                  //display proof of effect or state, etc (yes or no)
                  setObjectDamage(Mech_Bay_015283000,50);
            endif;

            // check state after damaging Mech (from weapons fire)
            if GetRepairState(Test1) <100 then
                  //need to get repaired - might do something about that

                  //display proof of effect or state, etc (yes or no)
                  setObjectDamage(Mech_Bay_015283000,50);
            endif;

---------------------------------------------------------------------------------------------
//         PILOT SPECIFIC STATUS

            //check a couple of Mechs for Pilot Wounding Effect from Battle Injuries.
            if GetPilotWounds(Test1) >0 then // Pilot1 Wounded

                  setObjectDamage(Mech_Bay_015283000,50);
            else
                  if GetPilotWounds(Test2) >0 then // Pilot2 Wounded

                        setObjectDamage(Mech_Bay_015283000,50);
                  endif;
            endif;

*************************************************************************************************