Sperry on 24/1/2021 at 11:15
Hello everyone.
I'm currently tinkering with different aspects of the spawn in Thief, and was wondering how the PlayerFactory link worked.
To be more specific, what makes a Marker with a PlayerFactory link with the Garrett archetype create a "Player" object which does not really have an equivalent in the Object Hierarchy as far as I can see (it's kind of the "Garrett", but also kind of not). One can see this by typing "set game_mode_backup 0" in the console, going in game, and then exiting back to dromed. If I wanted to manipulate the "Player" object ingame, What are the operations at play here?
Can anyone help me understand?
R Soul on 24/1/2021 at 11:51
Quote Posted by Sperry
what makes a Marker with a PlayerFactory link with the Garrett archetype create a "Player" object
It's just 'how the engine works'. It's like saying what makes an AI walk from one TrolPt to another just because the 'does patrol' property is set to True.
The engine looks for any object with a PlayerFactory link to the Garrett archetype, transfers all properties and links from the source of the link to the instance of that, and sets a few properties and links of its own (including the object name). If multiple objects have that link, the engine will use the last one it finds. Linking to any other archetype will create odd results that probably can't be of any use. Disclaimer: under OldDark things might be less stable.
For spawning the player the easiest approach is to have the starting point teleported.
Sperry on 24/1/2021 at 12:06
Thanks for the reply.
Aside from spawning stuff, I'm particularly interested in the possibility to add and remove links directly to "Player" ingame (and not merely with "Garrett" or the "StartingPoint"). Is there a way to access "Player" through links, S&Rs, Metaprops, or other means?
R Soul on 24/1/2021 at 14:02
Conversations/AIWatchObj/AlertResponse - the field for the target object should say "Player" (no quotes).
NVScript is a great option. NVMetaTrap, NVLinkBiulder etc. The design note parameters have some sort of target or dest parameter, so the value is just "Player" (this time, quotes are needed).
E.g. for a teleport trap to only work on the player after some event (example object name= MovePlayer), you could use NVLinkBiulder. Paramters: NVLinkBuilderLinkType="ControlDevice"; NVLinkBuilderLinkSource="MovePlayer"; NVLinkBuilderLinkDest="Player".
When the link builder is turned on (e.g. button, quest var trigger, etc) it'll then connect the teleport trap to the player.
For adding or removing S&R I think you'd have to add them to a metaproperty and then add or remove that to/from the player using NVMetaTrap (or as part of a conv etc).
Sperry on 24/1/2021 at 15:03
Wonderful, thanks for the info.
Do you know of a FM which already implements this as an example?