AITravel fails badly when provided a cell name

Everything about development and the OpenMW source code.
Post Reply
User avatar
NatalieN
Posts: 43
Joined: 30 Nov 2015, 21:32

AITravel fails badly when provided a cell name

Post by NatalieN »

When a cell name is provided (in addition to coordinates) to AITravel, the script runs, but does nothing. If the below example code were run, none of the messageboxes would be displayed, the NPC would not move, and yet "scriptrunning' would return 1. Commenting out the cell name restores expected functionality.

Code: Select all

Begin Script

messagebox "debug 1"

if ( conditionmet )
 messagebox "debug 2"
 AITravel 118 -295 73 180 "Balmora, Caius Cosades' House"
 messagebox "debug 3"
endif

messagebox "debug 4"

end
OpenMW-CS identifies the issue as an "unexpected name".


Is this the desired behavior? I think a better failure mode in this case would be to throw a warning in OpenMW-CS, and ignore the name. Or, at least try to run the other, non-bugged lines.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: AITravel fails badly when provided a cell name

Post by Zini »

The script is defective. AiTravel does not accept a cell name as parameter. Therefore the correct behaviour is for the script not to run at all.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: AITravel fails badly when provided a cell name

Post by Chris »

NatalieN wrote:I think a better failure mode in this case would be to throw a warning in OpenMW-CS, and ignore the name.
That would be risky. If a future update adds the ability to specify a name (for instance, when NPCs get the ability to independently travel between cells), it could cause some scripts to start behaving differently and "break" mods. When it comes to future-proofing, it's far better to be sctrict about what's allowed or not, so when restrictions are loosened for new behavior it'll minimize the impact on existing content.
Post Reply