Information desired!

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Information desired!

Post by Cholmondely »

hiran wrote: Thu Jul 11, 2024 5:14 pm
Hmm. Under which circumstances would one be able to influence another ship or it's crew that much? I thought about spying, but this thread here is going further.
It's all based on BCC. And that was probably based on ideas in older BB threads (2007-11) - see wiki page for links.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Information desired!

Post by Cholmondely »

So I replaced Murgh's AI.plist with Littlebear's.

Littlebear's AI.plist is giving my AppleMac a major case of indigestion - and I've no idea as to what is up.

The AI.plist currently looks like this:

Code: Select all

{
    GLOBAL =     {
    ENTER = "setState: CLOSE_WITH_PLAYER";
                        };

"CLOSE_WITH_PLAYER" = {
	ENTER = ("scanForNearestShipWithRole: player")
	"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0" checkCourseToDestination); 
	"COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"ATTACKED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
	"ATTACKER_MISSED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
	"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
	"DESIRED_RANGE_ACHIEVED" = (setState: MOVE_AWAY_FROM_PLAYER);
	"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
	UPDATE = (performFlyToRangeFromDestination);
    };

"MOVE_AWAY_FROM_PLAYER" = {
	ENTER = ("scanForNearestShipWithRole: player")
	"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0", checkCourseToDestination);
	"COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"ATTACKED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
	"ATTACKER_MISSED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
	"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
	"DESIRED_RANGE_ACHIEVED" = (setState: CLOSE_WITH_PLAYER);
	"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
	UPDATE = (performFlyToRangeFromDestination);
    };


"ATTACK_SHIP" = {
	ENTER = (setTargetToPrimaryAggressor, performAttack);
	"FRIENDLY_FIRE" = ("setStateTo: BREAK_OFF");
	"ATTACKED" = (setTargetToPrimaryAggressor, performAttack);
	"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, performAttack);
	"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
	"TARGET_DESTROYED" = (performIdle, "setStateTo: DECIDE_ROUTE");
	"TARGET_LOST" = (performIdle, "setStateTo: DECIDE_ROUTE");
	"NO_TARGET" = (performIdle, "setStateTo: DECIDE_ROUTE");
	"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
	"FRUSTRATED" = (performAttack);
    };
}
"Atom" flags up the following as problematic

"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0" checkCourseToDestination);

- and my AppleMac parser says "Old-style plist parser: missing semicolon in dictionary"

"DESIRED_RANGE_ACHIEVED" = (setState: MOVE_AWAY_FROM_PLAYER);

"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0", checkCourseToDestination);

"DESIRED_RANGE_ACHIEVED" = (setState: CLOSE_WITH_PLAYER);


I have no idea as to where a semi-colon should go... nor have I any idea about the other issue
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Information desired!

Post by Wildeblood »

Cholmondely wrote: Mon Jul 22, 2024 4:22 pm
So I replaced Murgh's AI.plist with Littlebear's.

Littlebear's AI.plist is giving my AppleMac a major case of indigestion - and I've no idea as to what is up.

"Atom" flags up the following as problematic

"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0" checkCourseToDestination);

- and my AppleMac parser says "Old-style plist parser: missing semicolon in dictionary"

I have no idea as to where a semi-colon should go... nor have I any idea about the other issue
You're not looking for a missing semi-colon; you're looking for a missing comma. The semi-colon is an end-of-line marker; when parsing fails, the error message assumes you finished one line and began another line, forgetting the semi-colon. But that's just the error message, based on it being a common error back in the olden days.

You're missing a comma, between the third and fourth instructions.

"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0" RIGHT ABOUT HERE checkCourseToDestination);

No, wait, I see it now: the first line in CLOSE WITH PLAYER is missing its semi-colon (at line end), and the second line is missing a comma. I'd still bet a dollar both errors get the same "semi-colon" message, though.
Last edited by Wildeblood on Mon Jul 22, 2024 6:21 pm, edited 1 time in total.
In your heart, you know it's flat.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Re: Information desired!

Post by LittleBear »

Global should also be:

ENTER = "setStateTo: CLOSE_WITH_PLAYER";

rather than ENTER = "setState: CLOSE_WITH_PLAYER";

To debug, look at the log and search for the name of your OXP. If there is a fault it will log the line number where it could not phase the file.

Same typo of setState rather than setStateTo under desired range achieved.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Information desired!

Post by Cholmondely »

Problems still (why am I not amazed and flabbergasted by this?).



Current AI.plist incarnation with ATOM issues in red:

{
GLOBAL = {
ENTER = "setStateTo: CLOSE_WITH_PLAYER";
};

"CLOSE_WITH_PLAYER" = {
ENTER = ("scanForNearestShipWithRole: player");
"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0", checkCourseToDestination); // Old-style plist parser: missing semicolon in dictionary on line 12.
"COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"ATTACKED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
"ATTACKER_MISSED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"DESIRED_RANGE_ACHIEVED" = (setStateTo: MOVE_AWAY_FROM_PLAYER);
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
UPDATE = (performFlyToRangeFromDestination);
};

"MOVE_AWAY_FROM_PLAYER" = {
ENTER = ("scanForNearestShipWithRole: player");
"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0", checkCourseToDestination);
"COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"ATTACKED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
"ATTACKER_MISSED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"DESIRED_RANGE_ACHIEVED" = (setStateTo: CLOSE_WITH_PLAYER);
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
UPDATE = (performFlyToRangeFromDestination);
};


"ATTACK_SHIP" = {
ENTER = (setTargetToPrimaryAggressor, performAttack);
"FRIENDLY_FIRE" = ("setStateTo: BREAK_OFF");
"ATTACKED" = (setTargetToPrimaryAggressor, performAttack);
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, performAttack);
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"TARGET_DESTROYED" = (performIdle, "setStateTo: DECIDE_ROUTE");
"TARGET_LOST" = (performIdle, "setStateTo: DECIDE_ROUTE");
"NO_TARGET" = (performIdle, "setStateTo: DECIDE_ROUTE");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"FRUSTRATED" = (performAttack);
};
}

AppleMac Parser gives the usual helpful Unexpected character { at line 1

Latest.log gives:
21:39:50.735 [plist.parse.failed] OOPropertyListFromData (OOPListParsing.m:72): Failed to parse ~/Oolite/AddOns/oolite.oxp.Murgh.prohip_xpat_b2WIP.oxp/AIs/xpatAI.plist as a property list.
21:39:50.735 [ai.load.failed.unknownAI] -[AI(OOPrivate) loadStateMachine:jsName:] (AI.m:841): Can't switch AI for <ShipEntity 0x18010ee00>{"Xpat Adder"} to "xpatAI.plist" - could not load file.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Information desired!

Post by Wildeblood »

They're strings with whitespace; they crave chicken scratches.

"DESIRED_RANGE_ACHIEVED" = (setStateTo: CLOSE_WITH_PLAYER);

Should be:

"DESIRED_RANGE_ACHIEVED" = ( "setStateTo: CLOSE_WITH_PLAYER" );
In your heart, you know it's flat.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Information desired!

Post by Cholmondely »

Thanking thee!

According to my AppleMac parser, that fixes it!

Now to see if it does what it is supposed to!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Information desired!

Post by Cholmondely »

And it doesn't!

Bumped into a clutch of Refugee Adders (what is the collective noun for them?) at Bemaera - and they were just tumbling and not going anywhere. Even when I flew into the middle of them and had a "BCC" natter with a couple of them. They did not follow me when I left, and just carried on tumbling.


Current AI.plist:

*According to the AppleMac parser, there are no syntax issues with the following.

Code: Select all

{
    GLOBAL = {
    ENTER = "setStateTo: CLOSE_WITH_PLAYER";
};

"CLOSE_WITH_PLAYER" = {
	ENTER = ("scanForNearestShipWithRole: player");
	"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0", checkCourseToDestination); // Old-style plist parser: missing semicolon in dictionary on line 12.
	"COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"ATTACKED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
	"ATTACKER_MISSED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
	"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
	"DESIRED_RANGE_ACHIEVED" = ("setStateTo: MOVE_AWAY_FROM_PLAYER");
	"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
	UPDATE = (performFlyToRangeFromDestination);
};

"MOVE_AWAY_FROM_PLAYER" = {
	ENTER = ("scanForNearestShipWithRole: player");
	"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0", checkCourseToDestination);
	"COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"ATTACKED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
	"ATTACKER_MISSED" = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
	"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
	"DESIRED_RANGE_ACHIEVED" = ("setStateTo: CLOSE_WITH_PLAYER");
	"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
	UPDATE = (performFlyToRangeFromDestination);
};


"ATTACK_SHIP" = {
	ENTER = (setTargetToPrimaryAggressor, performAttack);
	"FRIENDLY_FIRE" = ("setStateTo: BREAK_OFF");
	"ATTACKED" = (setTargetToPrimaryAggressor, performAttack);
	"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, performAttack);
	"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
	"TARGET_DESTROYED" = (performIdle, "setStateTo: DECIDE_ROUTE");
	"TARGET_LOST" = (performIdle, "setStateTo: DECIDE_ROUTE");
	"NO_TARGET" = (performIdle, "setStateTo: DECIDE_ROUTE");
	"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
	"FRUSTRATED" = (performAttack);
};
}

Latest log shows the following for the Refugee Adder/XPat Adder

Code: Select all

11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 1122 from Xpat Adder 17465 spawned at 60 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 28853 from Xpat Adder 17465 spawned at 59 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 6772 from Xpat Adder 8616 spawned at 60 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 7605 from Xpat Adder 8616 spawned at 60 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 17465 spawned at 60 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 992 from Xpat Adder 17465 spawned at 60 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 8616 spawned at 60 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 9881 spawned at 60 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 4369 from Xpat Adder 9881 spawned at 61 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 17910 from Xpat Adder 9881 spawned at 60 km
11:32:35.103 [LogEvents] GlobalLog (OOJSGlobal.m:266): Xpat Adder 5674 from Xpat Adder 9881 spawned at 60 km
...
11:34:41.566 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 1122 who has 80 energy
11:34:46.575 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 28853 who has 80 energy
...
11:34:58.801 [LogEvents] GlobalLog (OOJSGlobal.m:266): primed EQ_BROADCASTCOMMSMFD
11:35:09.440 [LogEvents] GlobalLog (OOJSGlobal.m:266): got message from Cobra Mark III 27313 : Hi there.
11:35:11.465 [LogEvents] GlobalLog (OOJSGlobal.m:266): got message from Xpat Adder 28853 : Greetings, noble spacefarer.
11:35:17.331 [LogEvents] GlobalLog (OOJSGlobal.m:266): got message from Cobra Mark III 27313 : Rickety Xpat, what is your status?
11:35:22.355 [LogEvents] GlobalLog (OOJSGlobal.m:266): got message from Xpat Adder 28853 : Kind Commander, we ware indeed in a sorry state and in need of help.
11:35:29.585 [LogEvents] GlobalLog (OOJSGlobal.m:266): got message from Cobra Mark III 27313 : Chin up, emigrants. You'll get there.
11:35:37.608 [LogEvents] GlobalLog (OOJSGlobal.m:266): got message from Xpat Adder 28853 : Thanks. That lifted our morale.
...
11:36:35.637 [LogEvents] GlobalLog (OOJSGlobal.m:266): got message from Xpat Adder 5674 : Nothing to worry about yet…
...
11:36:40.930 [FPS_MONITOR] GlobalLog (OOJSGlobal.m:266): *** FPS report ***: over the last minute, truncated harmonic mean fps was 39, high: 52, low: 32
11:36:40.930 [FPS_MONITOR] GlobalLog (OOJSGlobal.m:266): *** FPS report ***: over the last 2 minutes, truncated harmonic mean fps was 38, high: 52, low: 27
11:36:43.033 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 992 who has 80 energy
11:36:43.034 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 5674 who has 80 energy
11:36:43.035 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 6772 who has 80 energy
11:36:43.037 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 17910 who has 80 energy
11:36:43.039 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 8616 who has 80 energy
11:36:43.040 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 9881 who has 80 energy
11:36:43.041 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 7605 who has 80 energy
11:36:43.042 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 4369 who has 80 energy
11:37:04.549 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 1122 who has 80 energy
11:37:06.557 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 7605 who has 80 energy
11:37:20.301 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 4369 who has 80 energy
11:37:20.557 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Telescope marker 24896 who has -1 energy
11:37:22.068 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Xpat Adder 4369 who has 80 energy
11:37:22.908 [LogEvents] GlobalLog (OOJSGlobal.m:266): targeted Telescope marker 24767 who has -1 energy
11:37:22.909 [LogEvents] GlobalLog (OOJSGlobal.m:266): lost lock on Xpat Adder 4369

I'm sorry about doing this. But I don't understand what I'm doing, what the code does, how it works, etc.

I did sneak a peek at the AI.plist wiki page, but the way it starts (The AI system consists of a stack of state machines (only the top one of which is active), which respond to game events sent to them as messages. They respond by calling a series of methods which affect the behaviour of the Entity and possibly trigger changes to the AI by changing the state or (more drastically) the state machine.) is just so much gobbledegook to this dumb pilot.

"stack of state machines" (the links on the page do help, but I don't really understand - I've no context for any of this - so, what other "machines" are there other than "state machines"? Can they be arranged in a form other than a stack?)

What are these "messages"? Where do they come from? Where do they go to?

What is the behaviour of the Entity supposed to be?

What is the difference between changing the state and changing the state machine?

And I'm not sure that understanding what it really means would help fix my problem anyway...
Last edited by Cholmondely on Tue Jul 23, 2024 11:44 am, edited 1 time in total.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Information desired!

Post by Wildeblood »

Cholmondely wrote: Tue Jul 23, 2024 11:29 am
Bumped into a clutch of Refugee Adders (what is the collective noun for them?) at Bemaera - and they were just tumbling and not going anywhere. Even when I flew into the middle of them and had a "BCC" natter with a couple of them. They did not follow me when I left, and just carried on tumbling.

Current AI.plist:

*According to the AppleMac parser, there are no syntax issues with the following.
Yeah, that is the follow player AI, right? But what AI do the refugee ships have? If the refugee ships have this new AI, how did/does that come to be? Tell us all the details you're omitting.
In your heart, you know it's flat.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Information desired!

Post by Cholmondely »

Wildeblood wrote: Tue Jul 23, 2024 11:41 am
Yeah, that is the follow player AI, right? But what AI do the refugee ships have? If the refugee ships have this new AI, how did/does that come to be? Tell us all the details you're omitting.
Sorry - I was busily adding more oomph into my whine above.

I overwrote the original refugee ship AI (it is printed above and again, below) since I know of no way to transition from the one AI to the other AI and wished to test the fruits of Littlebear's labours.

Murgh's original xpatAI.plist reads as follows:

Code: Select all

{
    GLOBAL =     {
        ENTER =         (
            "setStateTo: HEAD_FOR_PLANET"
        );
    };
    "GO_TO_RANDOM_STATION" =     {
        ATTACKED =         (
            setTargetToPrimaryAggressor,
            "commsMessage: [xpat-appeal]",
            fightOrFleeHostiles
        );
        "ATTACKER_MISSED" =         (
            "commsMessage: [xpat-appeal]",
            performFlee,
            "setStateTo: ATTACKED"
        );
        "CASCADE_WEAPON_DETECTED" =         (
            "setAITo: fleeQMineAI.plist"
        );
        "COURSE_OK" =         (
            "setSpeedFactorTo: 0.5",
            performFlyToRangeFromDestination
        );
        "DESIRED_RANGE_ACHIEVED" =         (
            dockEscorts,
            setTargetToNearestStation,
            "setAITo: dockingAI.plist"
        );
        "DOCKING_REFUSED" =         (
            "setStateTo: CHECK_STATUS"
        );
        ENTER =         (
            "dropMessages: WAYPOINT_SET",
            "setDesiredRangeTo: 15000.0",
            setDestinationToTarget,
            checkCourseToDestination
        );
        "INCOMING_MISSILE" =         (
            setTargetToPrimaryAggressor,
            "sendTargetCommsMessage: [xpat-plea]",
            "setStateTo: INCOMING_MISSILE",
            "randomPauseAI: 0.25 1.5"
        );
        "NO_STATION_FOUND" =         (
            "switchAITo: exitingTraderAI.plist"
        );
        "TARGET_FOUND" =         (
            setTargetToFoundTarget,
            "sendTargetCommsMessage: [xpat-plea]",
            fightOrFleeHostiles
        );
        UPDATE =         (
            setTargetToLastStation,
            "setDesiredRangeTo: 15000.0",
            setDestinationToTarget,
            checkCourseToDestination,
            scanForHostiles,
            "pauseAI: 10.0"
        );
        "WAYPOINT_SET" =         (
            "setAITo: gotoWaypointAI.plist"
        );
    };
    "GO_TO_STATION" =     {
        "AEGIS_IN_DOCKING_RANGE" =         (
            dockEscorts,
            setTargetToSystemStation,
            "setAITo: dockingAI.plist"
        );
        ATTACKED =         (
            "setAITo: traderInterceptAI.plist",
            performFlee,
            "commsMessage: [xpat-plea]",
            "setStateTo: HEAD_FOR_PLANET"
        );
        "ATTACKER_MISSED" =         (
            "commsMessage: [xpat-appeal]",
            performFlee,
            "setStateTo: ATTACKED"
        );
        "CASCADE_WEAPON_DETECTED" =         (
            "setAITo: fleeQMineAI.plist"
        );
        "COURSE_OK" =         (
            "setSpeedFactorTo: 0.5",
            performFlyToRangeFromDestination
        );
        "DESIRED_RANGE_ACHIEVED" =         (
            dockEscorts,
            setTargetToSystemStation,
            "setAITo: dockingAI.plist"
        );
        "DOCKING_REFUSED" =         (
            "pauseAI: 40.0",
            "commsMessage: [xpat-broadcast]",
            "switchAITo: route2sunskimAI.plist"
        );
        ENTER =         (
            "dropMessages: WAYPOINT_SET",
            setTargetToSystemStation,
            "setDesiredRangeTo: 5000.0",
            setDestinationToTarget,
            checkCourseToDestination
        );
        "INCOMING_MISSILE" =         (
            "setAITo: traderInterceptAI.plist",
            "setStateTo: INCOMING_MISSILE",
            "randomPauseAI: 0.25 1.5"
        );
        "NO_STATION_FOUND" =         (
            "switchAITo: exitingTraderAI.plist"
        );
        "ROLL_1" =         (
            "commsMessage: [xpat-broadcast]",
            "pauseAI: 40.0",
            "setStateTo: GO_TO_STATION"
        );
        "ROLL_2" =         (
            "pauseAI: 40.0",
            "setStateTo: GO_TO_STATION"
        );
        "TARGET_FOUND" =         (
            setTargetToFoundTarget,
            "pauseAI: 40.0",
            "rollD: 2"
        );
        UPDATE =         (
            setTargetToSystemStation,
            "setDesiredRangeTo: 5000.0",
            setDestinationToTarget,
            checkCourseToDestination,
            "scanForNearestShipWithRole: player",
            "pauseAI: 10.0"
        );
        "WAYPOINT_SET" =         (
            "setAITo: gotoWaypointAI.plist"
        );
    };
    "HEAD_FOR_PLANET" =     {
        "AEGIS_CLOSE_TO_MAIN_PLANET" =         (
            "setStateTo: GO_TO_STATION"
        );
        "AEGIS_IN_DOCKING_RANGE" =         (
            dockEscorts,
            "setStateTo: GO_TO_STATION"
        );
        ATTACKED =         (
            "setAITo: traderInterceptAI.plist",
            performFlee,
            "commsMessage: [xpat-plea]",
            "setStateTo: HEAD_FOR_PLANET"
        );
        "ATTACKER_MISSED" =         (
            "commsMessage: [xpat-appeal]",
            performFlee,
            "setStateTo: ATTACKED"
        );
        "CASCADE_WEAPON_DETECTED" =         (
            "setAITo: fleeQMineAI.plist"
        );
        "COURSE_OK" =         (
            "setSpeedFactorTo: 0.65",
            performFlyToRangeFromDestination
        );
        "DESIRED_RANGE_ACHIEVED" =         (
            "setStateTo: GO_TO_STATION"
        );
        ENTER =         (
            setCourseToPlanet,
            "setDesiredRangeTo: 30000.0",
            "setSpeedFactorTo: 0.35",
            checkCourseToDestination
        );
        "INCOMING_MISSILE" =         (
            "commsMessage: [xpat-appeal]",
            performFlee,
            "setStateTo: ATTACKED"
        );
        RESTARTED =         (
            checkAegis
        );
        "ROLL_1" =         (
            "commsMessage: [xpat-broadcast]",
            "pauseAI: 40.0",
            "setStateTo: HEAD_FOR_PLANET"
        );
        "ROLL_2" =         (
            "pauseAI: 40.0",
            "setStateTo: HEAD_FOR_PLANET"
        );
        "TARGET_FOUND" =         (
            setTargetToFoundTarget,
            "pauseAI: 40.0",
            "rollD: 2"
        );
        UPDATE =         (
            setCourseToPlanet,
            "setDesiredRangeTo: 30000.0",
            checkCourseToDestination,
            "scanForNearestShipWithRole: player",
            "pauseAI: 10.0"
        );
        "WAYPOINT_SET" =         (
            "setAITo: gotoWaypointAI.plist"
        );
    };
}
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Information desired!

Post by Wildeblood »

Cholmondely wrote: Tue Jul 23, 2024 11:50 am
I overwrote the original refugee ship AI (it is also printed above) since I know of no way to transition from the one AI to the other AI and wished to test the fruits of Littlebear's labours.
So, you just have zombie ships floating there, with no active AI?

Now, we discussed this last week.

1. You put LittleBear's AI into a file called FollowPlayerAI.plist
2. You find the native Oolite function to change AI by researching on the wiki.
3. You target a ship, go to the debug console, and type PS.target.whateverThatFunctionWasCalled("FollowPlayerAI.plist")
4. Then you come back here and whinge at LittleBear.

And don't forget the chicken scratches. " " " " " " " "
In your heart, you know it's flat.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Re: Information desired!

Post by LittleBear »

I think the AI is working, even though they are just hanging there. The trouble is they were only told to scan for the player once under ENTER. So they did this as soon as they spawned (when you weren't there) and then never scanned again (when you were!). So whilst they have gone zombie, it's not (as it usually is) a sign of a broken AI. The AI isn't telling them to do anything after scanning once under enter, so they never get a TARGET_FOUND as they ain't looking (as we didn't tell em to).

Need to change the UPDATE in the look for player state to:

UPDATE = ("scanForNearestShipWithRole: player", performFlyToRangeFromDestination);

Then they'll keep looking for you until they find you.

It might be simpler to just have one AI. IE take Murgh's orginal (save it as a differently named .plist) and set that as the ship's AI in shipdata. You can then just add a "scanForNearestShipWithRole: player", to Update in every one of the original states and a TARGET FOUND to either switch AI's (or you can just switch states and C&P the find player AI into the new version of Murgh's.

The example below, from the rebooted assassins, tells the ship to hang around near its mother station until the player arrives and the switch AIs on a dice roll when it finds them. You can switch AIs as shown in the example under FOUND_PLAYER.

Code: Select all

{

GLOBAL ={
ENTER = ("setSpeedFactorTo: 0.25", performIdle);
"EXITED WITCHSPACE" = ("switchAITo: assassins_rebooted_mafia_spacelane_drugshipAI.plist");
UPDATE = ("pauseAI: 1.0", "setStateTo: WAIT_BY_STATION1");
};

"FOUND_PLAYER" =
{
ENTER = ("rollD: 3");
"ROLL_1" = ("switchAITo: assassins_rebooted_mafia_planet_drugshipAI.plist");
"ROLL_2" = ("switchAITo: assassins_rebooted_mafia_outbound_drugshipAI.plist");
"ROLL_3" = ("switchAITo: assassins_rebooted_mafia_exiting_drugshipAI.plist");
};

"BREAK_OFF" ={
ENTER = ("setSpeedFactorTo: 0.30", performIdle);
UPDATE = ("pauseAI: 1.5", "setStateTo: WAIT_BY_STATION1");
};

"ATTACK_SHIP" = {
ENTER = (setTargetToPrimaryAggressor, "sendTargetCommsMessage: [assassins-mafia-threat]", groupAttackTarget, performAttack); 
"ATTACKED" = (setTargetToPrimaryAggressor, performAttack);
"FRIENDLY_FIRE" = ("setStateTo: BREAK_OFF");  
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, performAttack);
"TARGET_DESTROYED" = (performIdle, "setStateTo:  WAIT_BY_STATION1"); 
"TARGET_LOST" = (performIdle, "setStateTo:  WAIT_BY_STATION1");
"NO_TARGET" = (performIdle, "setStateTo:  WAIT_BY_STATION1");
"FRUSTRATED" = (performAttack);
};

"WAIT_BY_STATION1" = { 
ENTER = ("scanForNearestShipWithRole: player", "rollD: 3");
"ROLL_1" = (
"setCoordinates: pwm 250000 175000 66500", setDestinationFromCoordinates, 
"setDesiredRangeTo: 9500.0", checkCourseToDestination);
"ROLL_2" = (
"setCoordinates: pwm 250000 175000 66500", setDestinationFromCoordinates, 
"setDesiredRangeTo: 10500.0", checkCourseToDestination);
"ROLL_3" = (
"setCoordinates: pwm 250000 175000 66500", setDestinationFromCoordinates, 
"setDesiredRangeTo: 11700.0", checkCourseToDestination);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: FOUND_PLAYER");
"FRIENDLY_FIRE" = ("setStateTo: BREAK_OFF"); 
"APPROACHING_SURFACE" = ("setSpeedFactorTo: 0.01", performLandOnPlanet);
COURSE_OK = ("setSpeedFactorTo: 0.35", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"FRUSTRATED" = ("setStateTo: WAIT_BY_STATION2");
DESIRED_RANGE_ACHIEVED = ("setStateTo: WAIT_BY_STATION2"); 
RESTARTED = ("setStateTo: WAIT_BY_STATION1");
"ATTACKED" = (setTargetToPrimaryAggressor, groupAttackTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, setTargetToPrimaryAggressor, groupAttackTarget, "setStateTo: ATTACK_SHIP");
UPDATE = ("scanForNearestShipWithRole: player");
};

"WAIT_BY_STATION2" = { 
ENTER = ("scanForNearestShipWithRole: player", "rollD: 3");
"ROLL_1" = (
"setCoordinates: pwm 250000 175000 66500", setDestinationFromCoordinates, 
"setDesiredRangeTo: 2500.0", checkCourseToDestination);
"ROLL_2" = (
"setCoordinates: pwm 250000 175000 66500", setDestinationFromCoordinates, 
"setDesiredRangeTo: 3500.0", checkCourseToDestination);
"ROLL_3" = (
"setCoordinates: pwm 250000 175000 66500", setDestinationFromCoordinates, 
"setDesiredRangeTo: 5750.0", checkCourseToDestination);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: FOUND_PLAYER");
"FRIENDLY_FIRE" = ("setStateTo: BREAK_OFF"); 
"APPROACHING_SURFACE" = ("setSpeedFactorTo: 0.01", performLandOnPlanet);
COURSE_OK = ("setSpeedFactorTo: 0.55", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"FRUSTRATED" = ("setStateTo: WAIT_BY_STATION1");
DESIRED_RANGE_ACHIEVED = ("setStateTo: WAIT_BY_STATION1"); 
RESTARTED = ("setStateTo: WAIT_BY_STATION2");
"ATTACKED" = (setTargetToPrimaryAggressor, groupAttackTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToFoundTarget, setTargetToPrimaryAggressor, groupAttackTarget, "setStateTo: ATTACK_SHIP");
UPDATE = ("scanForNearestShipWithRole: player");
};
}

Messages are sent by the ships script, so the AI can react to particular events. In the example the "FRIENDLY_FIRE" is a custom script message. If the ship is accidently hit by a ship on its own side, rather than attacking it it's AI recieves the message "FRIENDLY_FIRE" instead of ATTACKED.

This allows you to (if you need to) use IF X then do Y in the AI. You make the condition check in the script and if the condition is true then it sends an AI message to the ship, which the ship's AI reacts to. The script on the mafia-ship script tests the role of attackers and disregards accidental hits by it's own side. Script is below as an EG of how you can send script messages to the AI. In this example, the accidental attacker also gets a TARGET_LOST message if it hits one of its own side, so it will stop firing as soon as the first laser bolt hits the wrong ship. This stops carriers with big turret batteries accidently blowing their own fighters to bits whilst aiming at an enemy. As soon as the first plasma bolt hits a friendly ship, the carrier will stop firing and look for a new target. The ship hit by the plasma bolts also gets a AVOID_LAWFUL_GUNNER message. The mafia ship doesn't use this (as none of the mafia ship fleet have turrets). But for ships which have turret gunners on their side, they get switch to a state which tells them to move 3kms from the position they were in when they got hit, so they don't get hit again when the turret gunners start fireing again.

Code: Select all

this.name           = "assassins_rebooted_lawful_ship.js";
this.author         = "LittleBear";
this.copyright      = "CC-by-nc-sa-3.0";
this.version        = "1.0";
this.description    = "Used to make attacking certain ships a crime and prevent friendly fire.";

// Ships and Stations added by the OXZ have the roles lawful or chaotic in addition to their normal roles.
// Lawful ships will never target each other, so will only hit each other by accident when shooting at another target
// All the lawful ships have zero bountys so also won't be targeted by police ships either.
// If hit by a police ship or a member of it's own faction then the scipt messages the AI not to attack the other ship and instead wait for 2 seconds before returing to what
// it was doing before it was hit. If the player is the attacker then attacking a lawful ship will make the player a fugertive. The ship which hit the ship will also get a friendly fire
// warning and its AI will stop firing to for a few seconds. 
this.shipBeingAttacked = function (whom)
{
if (!whom) return;
this.ship.bounty = 0    
if (whom.isPlayer) 
{
this.ship.reactToAIMessage("ATTACKED"); 
player.bounty |= 51;
}
// Cause a police ship attacking a lawful ship to break off. If the lawful ship or attacking ship gained a bounty, both are reset to zero.
if (whom.roles.indexOf("police") > -1 )  
{
whom.target = null;
whom.bounty = 0;
whom.reactToAIMessage("TARGET_LOST");
this.ship.target = null;
this.ship.bounty = 0;
this.ship.reactToAIMessage("FRIENDLY_FIRE"); 
return;		
}
// If the attacker is another lawful ship, then it will only have hit by accident and the ship will not have been the attacker's current target.
// No need to break the attacker's target, but the ship will not respond to the accidental hit except by Idleing for 1.5 seconds before returning to its normal AI.
if (whom.roles.indexOf("assassins_rebooted_lawful_character") > -1 )  
{
whom.bounty = 0;
this.ship.target = null;
this.ship.bounty = 0;
this.ship.reactToAIMessage("FRIENDLY_FIRE"); 
return;		
}
// If the attacker is another lawful station with turrets and it is accidently pelting one of it's own defenders with plasma, the defender will perform a short flee to get out of the way.
if (whom.roles.indexOf("assassins_rebooted_lawful_gunner") > -1 )  
{
whom.bounty = 0;
this.ship.bounty = 0;
this.ship.reactToAIMessage("AVOID_LAWFUL_GUNNER"); 
return;		
}

// End of this.shipBeingAttacked		
}

this.shipBeingAttackedUnsuccessfully = function(whom)
{
if (!whom) return;
this.ship.bounty = 0    
if (whom.isPlayer) 
{
this.ship.reactToAIMessage("ATTACKED"); 
player.bounty |= 51;
}
// Cause a police ship attacking a lawful ship to break off. If the lawful ship or attacking ship gained a bounty, both are reset to zero.
if (whom.roles.indexOf("police") > -1 )  
{
whom.target = null;
whom.bounty = 0;
whom.reactToAIMessage("TARGET_LOST");
this.ship.target = null;
this.ship.bounty = 0;
this.ship.reactToAIMessage("FRIENDLY_FIRE"); 
return;		
}
// If the attacker is another lawful ship, then it will only have hit by accident and the ship will not have been the attacker's current target.
// No need to break the attacker's target, but the ship will not respond to the accidental hit except by Idleing for 1.5 seconds before returning to its normal AI.
if (whom.roles.indexOf("assassins_rebooted_lawful_character") > -1 )  
{
whom.bounty = 0;
this.ship.target = null;
this.ship.bounty = 0;
this.ship.reactToAIMessage("FRIENDLY_FIRE"); 
return;		
}
// If the attacker is another lawful station with turrets and it is accidently pelting one of it's own defenders with plasma, the defender will perform a short flee to get out of the way.
if (whom.roles.indexOf("assassins_rebooted_lawful_gunner") > -1 )  
{
whom.bounty = 0;
this.ship.bounty = 0;
this.ship.reactToAIMessage("AVOID_LAWFUL_GUNNER"); 
return;		
}

// End of shipBeingAttackedUnsuccessfully	
}

this.shipAttackedWithMissile = function(missile, whom)
{
if (!whom) return;
this.ship.bounty = 0    
if (whom.isPlayer) 
{
this.ship.reactToAIMessage("ATTACKED"); 
player.bounty |= 51;
}
// Cause a police ship attacking a lawful ship to break off. If the lawful ship or attacking ship gained a bounty, both are reset to zero.
if (whom.roles.indexOf("police") > -1 )  
{
whom.target = null;
whom.bounty = 0;
whom.reactToAIMessage("TARGET_LOST");
this.ship.target = null;
this.ship.bounty = 0;
this.ship.reactToAIMessage("FRIENDLY_FIRE"); 
return;		
}
// If the attacker is another lawful ship, then it will only have hit by accident and the ship will not have been the attacker's current target.
// No need to break the attacker's target, but the ship will not respond to the accidental hit except by Idleing for 1.5 seconds before returning to its normal AI.
if (whom.roles.indexOf("assassins_rebooted_lawful_character") > -1 )  
{
whom.bounty = 0;
this.ship.target = null;
this.ship.bounty = 0;
this.ship.reactToAIMessage("FRIENDLY_FIRE"); 
return;		
}
// If the attacker is another lawful station with turrets and it is accidently pelting one of it's own defenders with plasma, the defender will perform a short flee to get out of the way.
if (whom.roles.indexOf("assassins_rebooted_lawful_gunner") > -1 )  
{
whom.bounty = 0;
this.ship.bounty = 0;
this.ship.reactToAIMessage("AVOID_LAWFUL_GUNNER"); 
return;		
}

// End of this.shipAttackedWithMissile
}

this.shipDied = function (whom)
{
if (whom && whom.isPlayer)
{
player.bounty |= 51;
}
// End of this.shipDied
}
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Information desired!

Post by Cholmondely »

I've modified the AI to see if it works and will give it a try. Parser has given me the thumbs up.

Thanking you, gentlemen.




But what I want to achieve is to have the switch in AI made as a response to the BCC. Which presumably requires different coding.

Either have the Refugee Adder randomly ask the player: "Can you escort us to the station?" or else have the player offer and the Refugee Adder randomly accept.

And then I suppose that it would be an idea for the player to offer to open a witch-hole to somewhere safer as a system, too. Presumably once the Refugee Adder has accepted the player as an escort, it will follow the player into the witch-hole anyway.




If I can manage something workable for all this then I can see the following loose ends looming in the distance.

1) Some sort of future tie-in involving refugees wishing to thank the player. (Relevant code in Illegal Goods Tweak OXP)
2) Possible issues in eg. Corporate States, involving the player being sued for aiding and abetting illegal immigration (Relevant code in Illegal Goods Tweak OXP)
3) What about enabling various strategies if the party is attacked by pirates/Thargoids etc? Ranging from "Flee! I'll hold them off!" to "Stay here while I get him!" to "I'll be dropping a cascade mine shortly - you flee and I'll loiter with intent!" to "Meet you at the main orbital station" to "Are you any good with that gun of yours?"
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Information desired!

Post by Wildeblood »

Cholmondely wrote: Tue Jul 23, 2024 11:40 pm
But what I want to achieve is to have the switch in AI made as a response to the BCC. Which presumably requires different coding.

Either have the Refugee Adder randomly ask the player: "Can you escort us to the station?" or else have the player offer and the Refugee Adder randomly accept.

And then I suppose that it would be an idea for the player to offer to open a witch-hole to somewhere safer as a system, too. Presumably once the Refugee Adder has accepted the player as an escort, it will follow the player into the witch-hole anyway.

If I can manage something workable for all this then I can see the following loose ends looming in the distance.
Don't do that. I've told you how to proceed: make sure the AI is doing what you want (not something vaguely like want you want) before you start on the javascript. Then get a working script before you start dreaming of feature creep. You want this piece of the puzzle definitively finished, and crossed off the to-do list.

With Nick's clearly written instructions (which I'm sure they are - I haven't read them yet), writing a plug-in for BCC will be a doddle, if you stop day-dreaming. :D
In your heart, you know it's flat.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Information desired!

Post by Cholmondely »

Wildeblood wrote: Wed Jul 24, 2024 3:01 am
Cholmondely wrote: Tue Jul 23, 2024 11:40 pm
But what I want to achieve is to have the switch in AI made as a response to the BCC. Which presumably requires different coding.

Either have the Refugee Adder randomly ask the player: "Can you escort us to the station?" or else have the player offer and the Refugee Adder randomly accept.

And then I suppose that it would be an idea for the player to offer to open a witch-hole to somewhere safer as a system, too. Presumably once the Refugee Adder has accepted the player as an escort, it will follow the player into the witch-hole anyway.

If I can manage something workable for all this then I can see the following loose ends looming in the distance.
Don't do that. I've told you how to proceed: make sure the AI is doing what you want (not something vaguely like want you want) before you start on the javascript. Then get a working script before you start dreaming of feature creep. You want this piece of the puzzle definitively finished, and crossed off the to-do list.
That you don't need to worry about. I am trying to nail the AI down first. But I'm also trying to understand what I'm doing (at least a little). Currently rereading the AI pages and trying to make sense of both them and the AI.plists given above. And am very slowly getting somewhere!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply