Recent Posts

Pages: < Prev 1 2 [3] 4 5 6 7 8 9 10 Next >
21
:welcome:

Great to see this.  Starman hasn't been active in quite some time, but magic was active last year.  And let me see if there are any others familiar with MechCommander who might be able to help.
22
Hello potentially dead forum,

I am having an issue with a mission I am working on. I have a mission brain set up to change the warrior brain of a bunch of mechs and vehicles to a patrol brain to move toward a base when you either (a) capture the base HQ or (b) approach the starting point of the relevant vehicles (will probably also add (c) when the base defenders are all destroyed). The movement part is working for both conditions currently implemented, however, when you attack this force en route to the base it does not respond to fire and does not return fire.

Unless I figure out a more elegant solution, I will probably just set them to have an escort brain targeting a Mobile HQ or similar, non-combat vehicle, have a wide scan range to ensure they are ahead of it if the player mechs approach, and just set the movement brain to the Mobile HQ (or whatever).

I have tried the original approach with both a basic patrol brain derived from the original MC2 warrior brains, and one using the universal warrior brain and both have the same problem. Not really a strong coder so if anyone knows of a more elegant solution in .abl I am all ears, otherwise just gonna move ahead with this.

FWIW here is the patrol brain from my most recent attempt:
Code: [Select]
//****************************************************************************************//
//
// Universal Warrior Brain for Mech Commander Omnitech
//****************************************************************************************//

//[EDIT]
fsm rs_1_7_Reinforcements; //EACH BRAIN MUST HAVE AN UNIQUE FSM ID..
//[EDIT END]


var

static WorldPosition startPosition;
static PatrolState PState;
static PatrolPath PPath;
static boolean willRequestHelp;
static real lastHelpRequestTime;
static real helpRequestFrequency;
static integer AttackStateHandle;
static boolean poweredDown;
static boolean powerUp;
//static boolean been_hit;  //use this if powered down and you want to power up when hit.
//static boolean All_power; //use this if powered down and you want to power up all mates on this unit power-up.
static integer scanRange;
static WorldPosition MovePoint;
static integer escortSquadID;
static integer[20] moverList;
static real escortRange;
static boolean IsEscortUnitDead;
static worldPosition guardSpot;

static integer Orders1; //declare here for control in this file or declare in main mission.abl as eternal boolean for control from there.
//****************************************************************************************

function init;

    code


//[EDIT]
//********************************************************************
// Scan Ranges for Unit
scanRange = 500;

//********************************************************************
// Patrol brain part
// Patrol STATE
PState[0] = 0;    // This is the Type of Patrol. 0 = Linear. 1 = Looping
//(Linear = Unit will move from 1 to 2 to 3, then 3 to 2 to 1) Assuming there are only 3 points to the Patrol
//(Looping = Unit will move from 1 to 2 to 3, then 1 to 2 to 3) Assuming there are only 3 points to the Patrol
PState[1] = 9;    //This is the Amount of Move Points there are listed below. Make sure you Count Patrol Point '0'
PState[2] = 1;    //This is How many Times the unit will perform the Patrol.. (-1 = Forever).

// Patrol Points below

//Enter the Coordinates of where you want the Unit to Patrol. It will do them in Order Start from 0 and ending at the Last Point
//Make sure you change the Index number (numbers in Brackets [0, 0] to match the correct Patrol Point.
//Also, the number of Mover Points MUST match the number you have entered in the Patrol State.

PPath[0, 0] = 2624; //X coordinate found in the editor
PPath[0, 1] = -4160; //Y coordinate found in the editor
PPath[1, 0] = 448;
PPath[1, 1] = -4160;
PPath[2, 0] = 192;
PPath[2, 1] = -832;
PPath[3, 0] = -2624;
PPath[3, 1] = 2752;
PPath[4, 0] = -3136;
PPath[4, 1] = 2752;
PPath[5, 0] = -3136;
PPath[5, 1] = 3392;
PPath[6, 0] = -3392;
PPath[6, 1] = 3392;
PPath[7, 0] = -3392;
PPath[7, 1] = -1088;
PPath[8, 0] = -2624;
PPath[8, 1] = -2624;

PState[3] = PATROL_DIRECTION_FORWARD;   
PState[4] = -1;    //reset cur point
PState[5] = -1;    //reset cur cycle
PState[6] = CONTACT_CRITERIA_ENEMY + CONTACT_CRITERIA_VISUAL_OR_SENSOR + CONTACT_CRITERIA_NOT_DISABLED;
//********************************************************************
// Escort brain part
// Unit ID to escort
escortSquadID = 2; //This is the Squad ID (Found in editor) for the unit you want to escort
escortRange = 250.0; //How far the escorting unit will drift


// Guard Location if escortee is dead
guardSpot[0] = -704; //The X Coordinate (Found in the editor) is the area this Unit will Guard if the Unit it is suppose to Escort is destroyed
guardSpot[1] = 4842; //The Y Coordinate (Found in the editor) is the area this Unit will Guard if the Unit it is suppose to Escort is destroyed
guardSpot[2] = 0;

IsEscortUnitDead = False;
getUnitMates(escortSquadID, moverList);
//********************************************************************

// Grab his start position...
getObjectPosition(-1, startPosition);
setTargetPriority(0, TARGET_PRIORITY_CURTARGET, -1, 150, CONTACT_CRITERIA_ENEMY + CONTACT_CRITERIA_VISUAL_OR_SENSOR + CONTACT_CRITERIA_NOT_DISABLED);
setTargetPriority(1, TARGET_PRIORITY_MOVER, 0, scanRange, CONTACT_CRITERIA_ENEMY + CONTACT_CRITERIA_VISUAL_OR_SENSOR + CONTACT_CRITERIA_NOT_DISABLED);
setTargetPriority(2, TARGET_PRIORITY_NONE, 0, 0, 0);
AttackStateHandle = getStateHandle("attack");
willRequestHelp = true; //?true or false
helpRequestFrequency = 20.0; //?in secs
lastHelpRequestTime = -100.0;

setWillHelp(True);
//********************************************************************
//use this if unit is powered down

poweredDown = False;
powerUp = True;
//been_hit = True;
//All_power = True;
//********************************************************************
//Use this if unit powered down and out of map

MovePoint[0] = -448;
MovePoint[1] = -7146;
MovePoint[2] = 0;
//********************************************************************
//Control variable use to set brain type

Orders1 = 2; //0 - guard
//1 - attack object - guard
//2 - moveto position - guard
//3 - patrol
//4 - dredattack
//5 - sentry
//6 - escort

endfunction;

//----------------------------------------------------------------------------------------

function update : integer;

var

boolean processingPilotEvents;
// boolean thinking;
integer pilotEventID;
integer pilotState;
integer[20] pilotEventParams;
integer curTarget;
real curTime;
real[3] myPos;
real[3] attackerPos;
// real distanceToAttacker;
integer curStateHandle;
static integer numFunctionalWeapons;
static integer[20] weaponList;

code

curTime = getTime;
curStateHandle = getCurrentStateHandle;


//--------------------------------------------------
// Process the pilot events since the last update...
numFunctionalWeapons = getWeapons(weaponList, 1);
if (numFunctionalWeapons == 0) then
trans noWeapons;
endif;

//--------------------------------------------------
// Check to see escorting Unit is dead
if (((objectStatus(moverList[0]) == 1) or (objectStatus(moverList[0]) == 2)) and (Not IsEscortUnitDead)) then
IsEscortUnitDead = True;
//trans guardLocation;
endif;

processingPilotEvents = TRUE;
while (processingPilotEvents) do
pilotEventID = getNextPilotEvent(pilotEventParams);
if (pilotEventID == PILOT_EVENT_NONE) then
processingPilotEvents = FALSE;
else
switch (pilotEventID)
case PILOT_EVENT_TARGETED:
curTarget = getTarget(-1);
if (lastHelpRequestTime < (curTime - helpRequestFrequency)) then
lastHelpRequestTime = curTime;
if (willRequestHelp) then
//distanceToAttacker = distanceToObject(-1, pilotEventParams[0]);
getObjectPosition(pilotEventParams[0], attackerPos);
getObjectPosition(-1, myPos);
requestHelp(pilotEventParams[0], myPos, 300.0, attackerPos, 300.0, 1);
endif;
endif;
numFunctionalWeapons = getWeapons(weaponList, 0);
if (curStateHandle <> AttackStateHandle) then
if ((numFunctionalWeapons > 0) and (curTarget == 0)) then
corerun = True;
magicAttack(pilotEventParams[0]);
setState(AttackStateHandle);
endif;
endif;
endcase;
case PILOT_EVENT_ATTACK_ORDER:
curTarget = getTarget(-1);
if (curStateHandle <> AttackStateHandle) then
if ((numFunctionalWeapons > 0) and (curTarget == 0)) then
corerun = True;
magicAttack(pilotEventParams[0]);
setState(AttackStateHandle);
endif;
endif;
endcase;
case PILOT_EVENT_FIRED_WEAPON:
endcase;
case PILOT_EVENT_HIT:
if ((poweredDown) AND (powerUp)) then
corePower(True);
powerUp = False;
endif;
endcase;
endswitch;
endif;
endwhile;

return(0);

endfunction;

//----------------------------------------------------------------------------------------

state noWeapons;

code

if (objectClass(-1) == 2) then
coreEject;
else
corePower(false);
endif;

endstate;

//----------------------------------------------------------------------------------------

state attack;

code

update;
corerun = True;
magicAttack(0);
resetOrders(1);
transBack;

endstate;

//----------------------------------------------------------------------------------------

state start;

var

worldposition escortPos;

code

//Activate this if unit is powered down
// if (not poweredDown) then
// corePower(false);
// poweredDown = true;
// endif;

// if ((been_hit) AND (beenhit)) then //beenhit is a system variable that is set to True when hit by weapon fire
// corePower(True);
// been_hit = False; //close this loop forewer unit is active
// All_powerup = True; //global variable defined in main mission.ABL used for global power-up other from beenhit - here used to send power-up signal for all mates
// All_power = False; //close the following loop forewer unit is active
// endif;

// if ((All_power) AND (All_powerup)) then //this loop is used if you recive power-up signal from mates or global power-up (All_powerup=True)
// corePower(True);
// All_power = False; //close this loop forewer unit is active
// been_hit = False; //close the previous loop forewer unit is active
// endif;


switch (Orders1)
case 0:
corerun = True;
magicGuard(startposition, -1);
endcase;
case 1:
if ((getenemycount(-1) == 0)) then
if isalive(73402) then
magicAttack(73402);
endif;
else
corerun = True;
getObjectPosition(-1, startPosition);
magicGuard(startposition, -1);
endif;
endcase;
case 2:
if (distancetoposition(-1, MovePoint) > 150) then
corerun = True;
coreMoveTo(MovePoint, TACORDER_PARAM_RUN);
else
corerun = True;
getObjectPosition(-1, startPosition);
magicGuard(startposition, -1);
endif;
endcase;
case 3:
corerun = True;
magicPatrol(PState, PPath);
endcase;
case 4:
corerun = True;
getObjectPosition(-1, startPosition);
magicGuard(startposition, -1);
endcase;
case 5:
coreRun = True;
coreSentry(startposition, 300, -1);
endcase;
case 6:
if not IsEscortUnitDead then
getObjectPosition(moverList[0], escortPos);
corerun = True;
setMoveArea(escortPos, escortRange);
magicEscort(moverList[0]);
else
coreRun = True;
magicGuard(guardSpot, -1);
endif;
endcase;
endswitch;

update;
resetOrders(1);
endstate;

//----------------------------------------------------------------------------------------

endfsm.

//****************************************************************************************

and here is the solution from the original attempt:
Code: [Select]
//****************************************************************************************//
//
// This Brain will patrol a defined patrol path
//****************************************************************************************//

//[EDIT]
fsm rs_1_7_Reinforcements; //EACH BRAIN MUST HAVE AN UNIQUE FSM ID..
//assigned via mission brain
//[EDIT END]


var

static WorldPosition startPosition;
static PatrolState PState;
static PatrolPath PPath;
static boolean willRequestHelp;
static real lastHelpRequestTime;
static real helpRequestFrequency;
static integer AttackStateHandle;
// static boolean poweredDown;
static integer scanRange;

//****************************************************************************************

function init;

    code


//[EDIT]
//********************************************************************
// Scan Ranges for Unit
scanRange = 500;


//********************************************************************
// Patrol STATE
PState[0] = 1;    // This is the Type of Patrol. 0 = Linear. 1 = Looping
//(Linear = Unit will move from 1 to 2 to 3, then 3 to 2 to 1) Assuming there are only 3 points to the Patrol
//(Looping = Unit will move from 1 to 2 to 3, then 1 to 2 to 3) Assuming there are only 3 points to the Patrol
PState[1] = 9;    //This is the Amount of Move Points there are listed below. Make sure you Count Patrol Point '0'
PState[2] = 1;    //This is How many Times the unit will perform the Patrol.. (-1 = Forever).

//********************************************************************
// Patrol Points below

//Enter the Coordinates of where you want the Unit to Patrol. It will do them in Order Start from 0 and ending at the Last Point
//Make sure you change the Index number (numbers in Brackets [0, 0] to match the correct Patrol Point.
//Also, the number of Mover Points MUST match the number you have entered in the Patrol State.

PPath[0, 0] = 2624; //X coordinate found in the editor
PPath[0, 1] = -4160; //Y coordinate found in the editor
PPath[1, 0] = 448;
PPath[1, 1] = -4160;
PPath[2, 0] = 192;
PPath[2, 1] = -832;
PPath[3, 0] = -2624;
PPath[3, 1] = 2752;
PPath[4, 0] = -3136;
PPath[4, 1] = 2752;
PPath[5, 0] = -3136;
PPath[5, 1] = 3392;
PPath[6, 0] = -3392;
PPath[6, 1] = 3392;
PPath[7, 0] = -3392;
PPath[7, 1] = -1088;
PPath[8, 0] = -2624;
PPath[8, 1] = -2624;

//[EDIT END]





//********************************************************************
// DO NOT EDIT BELOW THESE LINES
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

PState[3] = PATROL_DIRECTION_FORWARD;   
PState[4] = -1;    //reset cur point
PState[5] = -1;    //reset cur cycle
PState[6] = CONTACT_CRITERIA_ENEMY + CONTACT_CRITERIA_VISUAL_OR_SENSOR + CONTACT_CRITERIA_NOT_DISABLED;

//setDebugWindow(-1, -1);
//---------------------------
// Grab his start position...
getObjectPosition(-1, startPosition);
setTargetPriority(0, TARGET_PRIORITY_CURTARGET, -1, 0, CONTACT_CRITERIA_NONE);
setTargetPriority(1, TARGET_PRIORITY_MOVER, 0, 0, CONTACT_CRITERIA_NONE);
setTargetPriority(2, TARGET_PRIORITY_NONE, 0, 0, 0);
AttackStateHandle = getStateHandle("attack");
willRequestHelp = true; //?true or false
helpRequestFrequency = 20.0; //?in secs
lastHelpRequestTime = -100.0;

setWillHelp(True);

endfunction;

//----------------------------------------------------------------------------------------

function update : integer;

var

boolean processingPilotEvents;
// boolean thinking;
integer pilotEventID;
integer pilotState;
integer[20] pilotEventParams;
integer curTarget;
real curTime;
real[3] myPos;
real[3] attackerPos;
// real distanceToAttacker;
integer curStateHandle;
static integer numFunctionalWeapons;
static integer[20] weaponList;

code

curTime = getTime;
curStateHandle = getCurrentStateHandle;


//--------------------------------------------------
// Process the pilot events since the last update...
numFunctionalWeapons = getWeapons(weaponList, 1);
// if (numFunctionalWeapons == 0) then
// trans noWeapons;
// endif;

processingPilotEvents = TRUE;
while (processingPilotEvents) do
pilotEventID = getNextPilotEvent(pilotEventParams);
if (pilotEventID == PILOT_EVENT_NONE) then
processingPilotEvents = FALSE;
else
switch (pilotEventID)
case PILOT_EVENT_TARGETED:
curTarget = getTarget(-1);
if (lastHelpRequestTime < (curTime - helpRequestFrequency)) then
lastHelpRequestTime = curTime;
if (willRequestHelp) then
//distanceToAttacker = distanceToObject(-1, pilotEventParams[0]);
getObjectPosition(pilotEventParams[0], attackerPos);
getObjectPosition(-1, myPos);
requestHelp(pilotEventParams[0], myPos, 300.0, attackerPos, 300.0, 1);
endif;
endif;
endcase;
endswitch;
endif;
endwhile;

return(0);

endfunction;


//----------------------------------------------------------------------------------------

state start;

code

update;
// if (order1) then
magicPatrol(PState, PPath);
// else
// if (order2) then
// coreRun = True;
//                magicPatrol(PState1, PPath1);
// else
// coreRun = True;
//                magicPatrol(PState2, PPath2);
// endif;
// endif;
resetOrders(1);
endstate;

//----------------------------------------------------------------------------------------

endfsm.

//****************************************************************************************
23
Nightly Builds / Nightly: 30 November 2025 - Revision 88c3cea75
« Last post by SirKnightly on November 30, 2025, 12:49:52 am »
Here is the nightly for 30 November 2025 - Revision 88c3cea75



Group: Linux-arm64
nightly_20251130_88c3cea75-builds-Linux-arm64.tar.gz (Mirror)


Group: Linux-x86_64
nightly_20251130_88c3cea75-builds-Linux-x86_64.tar.gz (Mirror)


Group: MacOSX-arm64
nightly_20251130_88c3cea75-builds-Mac-arm64.tar.gz (Mirror)


Group: MacOSX-x86_64
nightly_20251130_88c3cea75-builds-Mac-x86_64.tar.gz (Mirror)


Group: Win32-SSE2
nightly_20251130_88c3cea75-builds-Win32-SSE2.zip (Mirror)


Group: Win64-SSE2
nightly_20251130_88c3cea75-builds-x64-SSE2.zip (Mirror)

Code: [Select]
------------------------------------------------------------------------
commit 88c3cea75
Author: Goober5000
Commit: GitHub

    fix scannable ship types (#7130)
 code/def_files/data/tables/objecttypes.tbl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
24
The Scroll of Atankharzim / Re: RELEASE: The Scroll of Atankharzim, Part I
« Last post by Goober5000 on November 29, 2025, 05:40:41 pm »
Version 1.14.0 has been updated to Knossos with the following changes:
  • Update the subtitle, jump computer, movie player, markbox, and weapon hit scripts with some refinements and some new features for Part 2
  • Additional minor script fixes
  • Always beam-protect the player's wing in The 4th Vial, not just when out of range
  • Guardian the Irkalla's beams in The Tablet of Destinies until its shields are down
  • Fix hotspot coordinates in the Vasudan main hall (a retail bug!)
  • Refine table organization and improve MediaVP compatibility for duplicate ships
  • Fix whiteout effect in Scroll intro on newer builds
25
FS2 Open Coding - The Source Code Project (SCP) / Release: 25.0.0-RC5
« Last post by SirKnightly on November 29, 2025, 05:38:22 am »
Change log: (chronologically ordered)
PLACEHOLDER

Deprecations:
PLACEHOLDER

Deprecations are a mechanism in FSO where a certain feature or aspect of the engine has changed or is no longer supported. Since this would normally break existing mods, we have the mod table feature "$Target Version:" with which a mod can specify what version of FSO it was developed with. Any features listed under Deprecations will be removed or changed when the target version of a mod is at least the version released in this post.

Previous 23.2.1 Release Thread

Launchers, if you don't have one already:
All platforms: For every day use, we recommend Knossos.NET, an integrated solution for downloading and launching mods.

Hidden Text: Alternative Launchers • Show
Cross-platform: wxLauncher 0.12.x Test Build (legacy project for a unified launcher)
Important: For best compatibility with FSO 3.8 and later you should use at least wxLauncher 0.12.

Windows:  Launcher 5.5g (Mirror) (Mirror) Not compatible with Windows 8+, use wxLauncher above
OS X:  Soulstorm's OS X Launcher 3.0
Linux:  YAL or by hand or whatever you can figure out.

Windows (32/64-bit)
Compiled using GitHub Actions on Windows Server 2019 (10.0.17763), Visual Studio Enterprise 2019

64-bit: fs2_open_25_0_0-RC5-builds-x64-SSE2.zip

32-bit: fs2_open_25_0_0-RC5-builds-Win32-SSE2.zip
This one is based on the SSE2 Optimizations from the MSVC Compiler.

Hidden Text: Alternative builds • Show

64-bit AVX: fs2_open_25_0_0-RC5-builds-x64-AVX.zip
This one is based on the AVX Optimizations from the MSVC Compiler (fastest build if your CPU supports AVX instructions).


32-bit AVX: fs2_open_25_0_0-RC5-builds-Win32-AVX.zip
This one is based on the AVX Optimizations from the MSVC Compiler.

What are those SSE, SSE2 and AVX builds I keep seeing everywhere?
Your answer is in this topic.
Don't want to deal with that? Use Knossos.NET and it will download the best build specifically for your PC!

Linux
Compiled with Ubuntu 20.04 LTS, GCC 9
x86_64: fs2_open_25_0_0-RC5-builds-Linux-x86_64.tar.gz
arm64: fs2_open_25_0_0-RC5-builds-Linux-arm64.tar.gz

These builds use a mechanism called AppImage which should allow these builds to run on most Linux distributions. However, we recommend that you compile your own builds which will result in less issues.
Alternatively, if there is a package in your software repository then you should use that. If you are the maintainer of such a package for a distribution then let us know and we will include that here.


macOS
macOS 10.9+
Intel (64-bit): fs2_open_25_0_0-RC5-builds-Mac-x86_64.tar.gz
Apple Silicon: fs2_open_25_0_0-RC5-builds-Mac-arm64.tar.gz

These builds are not signed and so by default will fail to launch. To run them simply right-click on the app, click open, then click open again on the security confirmation dialog. You should only have to do this once for each app.
If running the game through Knossos or Knossos.NET this step should not be necessary.

NOTE: macOS builds currently have limited support and may exhibit issues not present on other platforms.


Hidden Text: TrackIR Users • Show
Important!!
An external DLL is required for FSO to use TrackIR functions.  The following DLL is simply unpacked in to your main FreeSpace2 root dir.
TrackIR is only supported on Windows.
TrackIR SCP DLL (Mirror) (Mirror)

Known issues:
26
FreeSpace Conversion / Re: RELEASE: Official Awakenings for Port 3.0
« Last post by Goober5000 on November 29, 2025, 01:52:01 am »
I see what the problem is.  The Galatea 1's waypoint path takes it straight through the hull of the Orion.  This must not have been a problem with the earlier model designs.  I've uploaded a fix.
27
FreeSpace Discussion / Re: Transferring data to new computer
« Last post by Mongoose on November 28, 2025, 11:59:33 am »
As you said in the other thread, the .csg files in your players folder should save your campaign progress, including medals and kill lists. (The wiki says these files have been deprecated and replaced with .cs2, but I'm not sure how new of an FSO version does that; whatever version I have installed still makes .csg files for a new pilot.) You'll also want to back up your main pilot file with the extension .json. If you've changed any control presets, I think those may live in the presets subfolder, so probably best to back that up too. (I don't know if those are a duplicate of what's in your pilot file or their own thing entirely.)
28
FreeSpace & FreeSpace Open Support / Re: CSG files
« Last post by Mongoose on November 28, 2025, 11:22:34 am »
Going to close this, since you already asked the same question in another thread. I'll respond there. Please try to keep topics in a single thread.
29
Mission & Campaign Releases / Re: RELEASE: The Sixth Seal 2 - The Keys of Ruin
« Last post by shiv on November 28, 2025, 08:07:54 am »
Then probably some other dependency is missing. Probably fonts from SCP UI or something else. Once again: I strongly advice to try installing it with Knossos.
30
Mission & Campaign Releases / Re: RELEASE: The Sixth Seal 2 - The Keys of Ruin
« Last post by CT27 on November 28, 2025, 02:27:25 am »
I was using the recently released 25.0 RC4.
Pages: < Prev 1 2 [3] 4 5 6 7 8 9 10 Next >