In 1.71.1 entities with scan_class CLASS_ROCK (and also with CLASS_CARGO) can't send commsMessage: through their AI. The method doesn't do anything. It doesn't even produce anything in the log.
I know positively that the AI-method commsMessage: did work for entities with CLASS_ROCK in previous versions, because I used it a lot for in-game AI-debugging.
I don't know whether it was deliberately disabled or it is a bug.
N.B.: It does work in 1.71.1 for rocks that are stations, like Salvage Gangs, and for entities with CLASS_CARGO, if they have a pilot defined in characters.plist and the key unpiloted is set to FALSE. It doesn't work in other cases.
CLASS_ROCK and commsMessage: in 1.71.1
Moderators: winston, another_commander, Getafix
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Unpiloted entities cannot send commsMessages. This is deliberate and related to a bug fix that was assigning crews to things like boulders and alloys.
When fixing the bug, I kind of anticipated a possible need for unpiloted ships to send commsMessages (like in the imaginary scenario of an abandoned ship carrying a recorded message). In the game's code there is a dormant commsMessageByUnpiloted method, which has not been included, because no one has officially approved its inclusion yet.
From PlayerEntityLegacyScriptEngine.m:
If it is OK, to include this, I could check and verify that it still works and maybe have it in for 1.72.
When fixing the bug, I kind of anticipated a possible need for unpiloted ships to send commsMessages (like in the imaginary scenario of an abandoned ship carrying a recorded message). In the game's code there is a dormant commsMessageByUnpiloted method, which has not been included, because no one has officially approved its inclusion yet.
From PlayerEntityLegacyScriptEngine.m:
Code: Select all
#if 0 // Disabled until approved for inclusion.
// This method does the same as -commsMessage, (which in fact calls), the difference being that scripts can use this
// method to have unpiloted ship entities sending comms messages.
- (void) commsMessageByUnpiloted:(NSString *)valueString
{
[self commsMessage:valueString];
}
#endif
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
It makes sense that boulders and alloys don't have pilots in them. But also buoys shouldn't have pilots. So when it is changed, also remove the pilot from the buoy and let them also used the "commsMessageByUnpiloted:" to broadcast a warning when attacked.another_commander wrote:Unpiloted entities cannot send commsMessages. This is deliberate and related to a bug fix that was assigning crews to things like boulders and alloys.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
I would vote for that.
First, because I am scripting something like this right now: A defunct ship (hence scan_class CLASS_CARGO), which nevertheless has to send a message to the player. Although I've worked around it by giving it a pilot.
But second, because it was very handy for debugging AIs, to let any entity send a message that indicates not only the state it is in, but also the AI message it has just got. It's a convenient (perhaps the only?) way to find out whether the AI actually has found the object it is scanning for, and received the TARGET_FOUND message.
First, because I am scripting something like this right now: A defunct ship (hence scan_class CLASS_CARGO), which nevertheless has to send a message to the player. Although I've worked around it by giving it a pilot.
But second, because it was very handy for debugging AIs, to let any entity send a message that indicates not only the state it is in, but also the AI message it has just got. It's a convenient (perhaps the only?) way to find out whether the AI actually has found the object it is scanning for, and received the TARGET_FOUND message.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Oh yeah. This method is hereby rubber-stamped… but I think the implementation is broken. Surely you need a method in ShipEntityAI that bypasses the check? This will only work in scripts.another_commander wrote:When fixing the bug, I kind of anticipated a possible need for unpiloted ships to send commsMessages (like in the imaginary scenario of an abandoned ship carrying a recorded message). In the game's code there is a dormant commsMessageByUnpiloted method, which has not been included, because no one has officially approved its inclusion yet.
E-mail: [email protected]
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am