Unna Oertdottir on 12/8/2019 at 20:32
Note that AICurrentPatrol links set on AIs on sim start are broken in NewDark 1.27. After testing some missions it's likely that only teleported objects are affected, but I'm not sure.
This will break some existing FMs, we are trying to fix it.
Solution for new FMs: Set AICurrentPatrol (if you need it) after the game starts, for instance in a conversation, in any case after teleportation.
Yandros on 13/8/2019 at 15:16
Oh wow, that will likely break some of my missions. Thanks for catching it and for all of the fixing of FMs that you and fortuni do!
SilverJackal on 13/8/2019 at 15:20
Thanks for sharing. If I have any problems setting up anything in my missions as I design. I'll keep this in mind or see if anything might be conflicting.
Unna Oertdottir on 13/8/2019 at 15:25
We have a squirrel fix for this issue. Jax will post it soon. It will be implemented in the next T2fix version.
Jax64 on 13/8/2019 at 18:39
To elaborate, this issue is caused by T2's TrapTeleporter script rather than lying implicitly with NewDark 1.27. Thief 1 and Thief Gold are not affected. Upon being triggered, this script will remove all AICurrentPatrol links from objects along its ControlDevice links. This is rather odd considering this is an official script and has not changed since the game's release. It is most likely that NewDark 1.27 fixed an underlying issue that allowed a dormant line of code in this script to function whereas it had not before.
With this in mind, I have put together a squirrel script that is identical in functionality to the original TrapTeleporter but does not implement the removal of AICurrentPatrol links on activate. It can be used as a complete replacement for the original script, provided it is given the appropriate loading priority.
Code:
class TrapTeleporter extends SqRootScript
{
function Activate(on, sender)
{
if (on)
{
if (Link.AnyExist("ControlDevice", self))
{
local victim = LinkDest(Link.GetOne("ControlDevice", self));
if (Link.AnyExist("PlayerFactory", victim))
{
victim = Object.Named("Player");
}
Container.Remove(victim);
Object.Teleport(victim, vector(0,0,0), vector(0,0,0), self);
// NewDark 1.27 allows the code below to execute while it had not in prior versions
// Disable it because it now causes issues
//Link.DestroyMany("AICurrentPatrol", victim, AnyObject);
}
}
}
function HandleMessage(sender)
{
local flags = 0;
local invert = false
local activated = false;
if (Property.Possessed(self, "TrapFlags"))
{
flags = Property.Get(self, "TrapFlags");
}
invert = flags & TRAPF_INVERT;
if (!Locked.IsLocked(self) && sender != self)
{
if (!(flags & TRAPF_NOON))
{
Activate(!invert, sender);
activated = true;
}
}
if (activated && flags & TRAPF_ONCE)
{
Property.SetSimple(self, "Locked", true);
}
}
function OnMessage()
{
if (MessageIs("TurnOn"))
{
HandleMessage(message().from);
}
}
function OnTimer()
{
if (message().name == "TurnOn")
{
HandleMessage(message().from);
}
}
}
Despite the fact that this script actually
removes functionality, it does return TrapTeleporter to its original, expected behavior. As Unna has said, the plan is to include this with the next version of T2Fix, meaning if either T2Fix is used or this fixed script is installed manually, players will not have to worry about broken missions as a result of this and mission authors need not concern themselves with changed behavior.
Yandros on 13/8/2019 at 19:58
Thanks everyone for your work on this. I would still advise authors moving forward to be wary of this, since plenty of players will not be using T2Fix and thus will not have this fox in place to work around the issue. I for one will begin dynamically adding the links via a conversation on sim start or something similar.
Renault on 13/8/2019 at 20:28
Isn't this likely something that will just get fixed in the next version of ND?
Unna Oertdottir on 13/8/2019 at 20:34
We don't know. The issue was caused by ND 1.27, all previous versions including OldDark 1.18 didn't remove the links.
Jax64 on 13/8/2019 at 20:56
While it is possible, especially if this gets attention, I do not consider it particularly likely since NewDark has not previously made it a focus to fix scripts. The code in TrapTeleporter to remove these links has existed since the game was released, but it only seems to be properly executed with NewDark 1.27.
ffox on 14/8/2019 at 13:44
So how do I get this to work? So far I've tried two things with no luck:
1. I've copied the code from the Under Templehill thread into a new file T2Fix127\FMs\Templehill\miss20.mis.dml.
2. I've taken Jax's code from the thread here and copied that into T2Fix127\T2FMDML\TrapTeleporter.dml.
If there are instructions how to install dmls they are well hidden!