enterPlayerWormhole not working if wormhole in save-file
Moderators: winston, another_commander, Getafix
Re: enterPlayerWormhole not working if wormhole in save-file
Great collaboration fellas.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: enterPlayerWormhole not working if wormhole in save-file
Commander McLane's test allows me to replicate the problem on my system too. Deleting the wormhole part in the savefile makes everything work again.
Re: enterPlayerWormhole not working if wormhole in save-file
Found the bug.
Saved wormholes don't have a Universal ID, neither does the Player's Wormhole, and the code uses the UIDs to ensure a wormhole isn't added multiple times.
My bad.
<edit>Fixed in r4402</edit>
Saved wormholes don't have a Universal ID, neither does the Player's Wormhole, and the code uses the UIDs to ensure a wormhole isn't added multiple times.
My bad.
<edit>Fixed in r4402</edit>
Last edited by Micha on Thu Feb 24, 2011 11:02 pm, edited 1 time in total.
The glass is twice as big as it needs to be.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: enterPlayerWormhole not working if wormhole in save-file
Have I mentioned my dislike of universal IDs recently? :-)
E-mail: [email protected]
- 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:
Re: enterPlayerWormhole not working if wormhole in save-file
Removing the wormhole-key from my save-file allowed me to do some more tests, and I've run into another problem.
Sometimes the NPC simply won't follow. Especially the helpless traders from interstellar_help.oxp, for whom I'm doing the whole thing, won't.
Here's the relevant AI-state:
And here are the last couple of seconds worth of log-entries before my jump:
After that, silence. Even if I wait for minutes.
The target inspector informs me that:
The pending AI message is never received or acted upon.
The obvious difference of this code to my test AI code is that this AI is following the player ship and therefore generally in behaviour BEHAVIOUR_FLY_TO_DESTINATION, while my test AI had a performIdle.
Does the performFlyToRangeFromDestination somehow prevent the pending AI message to become active, while the performIdle doesn't?
If so, is there a better way to make the ship 'escort' the player until he jumps out? Would for instance performIntercept be better than performFlyToRangeFromDestination?
Sometimes the NPC simply won't follow. Especially the helpless traders from interstellar_help.oxp, for whom I'm doing the whole thing, won't.
Here's the relevant AI-state:
Code: Select all
"FOLLOW_PLAYER" = {
"COURSE_OK" = (
"setSpeedFactorTo: 0.7",
performFlyToRangeFromDestination
);
ENTER = (
setDestinationToTarget,
"setDesiredRangeTo: 150",
checkCourseToDestination
);
"PLAYER WITCHSPACE" = (
enterPlayerWormhole
);
UPDATE = (
setDestinationToTarget,
checkCourseToDestination,
"pauseAI: 2"
);
};
Code: Select all
23:36:14.618 [ai.takeAction]: Moray Medical Boat 1494 to take action setDestinationToTarget
23:36:14.618 [ai.takeAction]: Moray Medical Boat 1494 to take action checkCourseToDestination
23:36:14.618 [ai.takeAction]: Moray Medical Boat 1494 to take action pauseAI: 2
23:36:14.618 [ai.message.receive]: AI interstellarHelpAI.plist for Moray Medical Boat 1494 in state 'FOLLOW_PLAYER' receives message 'COURSE_OK'. Context: handling deferred message, stack depth: 0
23:36:14.618 [ai.takeAction]: Moray Medical Boat 1494 to take action setSpeedFactorTo: 0.7
23:36:14.618 [ai.takeAction]: Moray Medical Boat 1494 to take action performFlyToRangeFromDestination
23:36:16.619 [ai.takeAction]: Moray Medical Boat 1494 to take action setDestinationToTarget
23:36:16.619 [ai.takeAction]: Moray Medical Boat 1494 to take action checkCourseToDestination
23:36:16.619 [ai.takeAction]: Moray Medical Boat 1494 to take action pauseAI: 2
23:36:16.619 [ai.message.receive]: AI interstellarHelpAI.plist for Moray Medical Boat 1494 in state 'FOLLOW_PLAYER' receives message 'COURSE_OK'. Context: handling deferred message, stack depth: 0
23:36:16.619 [ai.takeAction]: Moray Medical Boat 1494 to take action setSpeedFactorTo: 0.7
23:36:16.619 [ai.takeAction]: Moray Medical Boat 1494 to take action performFlyToRangeFromDestination
23:36:17.187 [ai.message.receive]: AI interstellarHelpAI.plist for Moray Medical Boat 1494 in state 'FOLLOW_PLAYER' receives message 'PLAYER WITCHSPACE'. Context: global message, stack depth: 0
23:36:17.187 [ai.takeAction]: Moray Medical Boat 1494 to take action enterPlayerWormhole
The target inspector informs me that:
Code: Select all
Ship entity:
Status: STATUS_ENTERING_WITCHSPACE
AI:
Pending: ENTERED_WITCHSPACE
Think in: -(ever-growing number)
Behaviour: BEHAVIOUR_FLY_TO_DESTINATION
Frustration: 0
The obvious difference of this code to my test AI code is that this AI is following the player ship and therefore generally in behaviour BEHAVIOUR_FLY_TO_DESTINATION, while my test AI had a performIdle.
Does the performFlyToRangeFromDestination somehow prevent the pending AI message to become active, while the performIdle doesn't?
If so, is there a better way to make the ship 'escort' the player until he jumps out? Would for instance performIntercept be better than performFlyToRangeFromDestination?
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: enterPlayerWormhole not working if wormhole in save-file
Pending messages (and UPDATE) will never trigger for a ship that isn’t “in the universe” (which mostly means in-system, although there are special cases). The line “Moray Medical Boat 1494 to take action enterPlayerWormhole”, and the fact that it’s still in the inspector, means it’s in the wormhole, but I don’t know offhand how you can find out when it will emerge.Commander McLane wrote:The pending AI message is never received or acted upon.
E-mail: [email protected]
- 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:
Re: enterPlayerWormhole not working if wormhole in save-file
The ordinary traders which I hijacked with my test AI emerged within a few seconds.
This ship has been in the wormhole for minutes. I don't think it's going to emerge. Could it be that its ship script is somehow stalled?
This ship has been in the wormhole for minutes. I don't think it's going to emerge. Could it be that its ship script is somehow stalled?