Jump to content

Opposite Of 'PlaceAtMe' Command


AGLNM01

Recommended Posts

Hello all,

 

All my characters have a companion with his/her own horse. Unfortunately, although my companion and I ride everywhere together, at times their horse disappears. To avoid this, I am working on a spell which will be able to place near the player the horse my character has purchased for his/her companion. At present, I am using a spell which uses the PlaceAtMe command, followed by the appropriate code for the purchased horse, etc. However, on the occasions I have to use this spell, it produces more than one purchased horse. Does anyone know of a Console Command which does the opposite of PlaceAtMe?

 

Thanks.

Link to comment
Share on other sites

Fallout 3/NV is more my area and Oblivion might be different but it sounds like moveto would be what you're looking for. Prid horse reference then Moveto companion reference.

Link to comment
Share on other sites

To further elaborate, MoveTo would be an alternative to PlaceAtMe for use inside the script. PlaceAtMe "creates" a new horse and puts it at the instructed location, MoveTo just "moves" an existing horse, so there's never a need to "delete" it again.

 

There may be OBSE commands to actually "delete" references, but I can't recall any command suitable for use from inside the console. You can use Disable to make it disappear, but only when the cell gets cleaned up by the garbage collection will the horse actually be removed. In the mean time it'll still be where it was just deactivated, not doing a thing, not physically present, not visible, but at any point in time, as long as you keep its reference/id, it can be brought back into existence, so Disable is not exactly a "deletion" tool.

 

Clean scripting solutions would rather use MoveTo to only "move" the one and only existing horse around, to the player, into a remote inaccessible holding cell, back to the player, etc., and there'll never be more than 1. Whereas solutions using PlaceAtMe for as simple a task as moving a horse around would be considered heavy savegame bloat potential, as it, needlessly, each time creates a new copy of the horse.

Link to comment
Share on other sites

Hello again all,

 

Thanks for your advice, DrakeTheDragon, I appreciate it. The MoveTo command is just what I am looking for. Unfortunately, I've hit a new snag. The command only works in-game. When I try to use the command in my Script, eg, Player.MoveTo FF006563(which is the correct <RefID> for my Bay Horse), on trying to save the script, the code isn't recognized. Is there a way around this problem that you know of? Also, is there a script command which will check whether I have bought the selected horse? If it detects I have, then I'm teleported near it. If not, I stay where I am and a message comes up informing me I haven't bought that horse yet?

 

Thanks.

Link to comment
Share on other sites

That's simple. Don't use RefIDs inside your scripts. You've got EditorIDs, the ones you can actually read and remember, for that. When your script gets compiled, it automatically turns all EditorIDs into Form/RefIDs anyways. But if you absolutely "must" use a hexadecimal RefID, I think you'll have to put it into quotes here instead:

Player.MoveTo "FF006563"

Just be prepared not all Form/RefIDs will "stay" their value, as some are also affected by the plugin's position in your load order in the end. In your case, "FF" being the prefix for dynamically created, not plugin-based ones, it may work (not sure if it even does), but if you go for forms/refs introduced by a plugin (another plugin even maybe), their prefix will be their place in load order and definitely not persist.

 

Hmm, where do you buy the horse, what happens when it's bought? Is there any quest/dialog behind which is setting some flags you could check now? The only other method coming to mind right now would be to check the horse's ownership, like if it's the player's already or not, provided it isn't always the player's right from the start.

Link to comment
Share on other sites

Thanks again, DrakeTheDragon, for your advice. I appreciate it. I tried using the command MoveTo "FF006563"​ in my script, in the hope I would be teleported near my Bay Horse​, but unfortunately even though the code seems static when I just buy one horse, when I try to save my script, I receive an error informing me that the code was not recognized, even though it always works in the in-game console. Any further advice you can offer, please?

 

Thanks.

Link to comment
Share on other sites

Coming to think of it... why is your horse RefID FF006563 to begin with? FF-ids are only "spawned" objects, created first during gameplay. They do not even exist inside a plugin, yet. Where did you get this ID from, if I may ask? Did you obtain it from inside the game?

 

Can you attempt to find your Bay Horse at the place it is at from inside the CS? Does it have a "persistent reference ID" by chance? When you buy the horse, isn't there a script doing something with it? If so, then it must have a persistent ID. Use this one instead of your FF-id.

Link to comment
Share on other sites

In reply to your question, DrakeTheDragon , when I tried to spawn my purchased Bay Horse in front of me in-game, the construction set code assigned to it, 0004de8e, does not work with the Player.MoveTo command in the console. The only command that does work with the command is Player.MoveTo ff006563 and I'm always instantly teleported near my Bay Horse.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...