Jump to content

How to use MoveTo script function to move NPC to marker?


Recommended Posts

Posted

Hi guys, I'm trying to edit a script file that clones an NPC.

 

The original script using Disable() or DisableNoWait() or Delete() on its original while cloning a copy which removes their spawns permanently and I'd rather not do that.

I want to use Kill() on the actor but move them away from player sight in doing so. So far I'm using target.Kill() and then target.SetPosition(0.0, 0.0, -1000.0) but it doesn't move them anywhere.

 

So I am wondering how to use the MoveTo function to send them somewhere else. The E3DemoMarker in AAA test cell looks like a nice place to dump.

 

Something like...
ObjectReference killzone
target.MoveTo(killzone)

Except how do I reference killzone to be E3DemoMarker for example?

Posted

If it's a marker you can add the property and fill it afterwards as E3DemoMarker:

 

ObjectReference Property killzone auto

 

And in the script:

 

[however you reference the target].MoveTo(killzone)

Posted (edited)
Thanks, how do I fill it afterwords as E3DemoMarker?
Right now it says "no viable alternative at input 'Property'" when trying to compile.

 

  On 10/16/2021 at 5:00 AM, 37G said:

If it's a marker you can add the property and fill it afterwards as E3DemoMarker:

 

ObjectReference Property killzone auto

 

And in the script:

 

[however you reference the target].MoveTo(killzone)

Edited by Jackal2233
Posted

Erm... so I added the lines above, then went to the quest, added filled it up with anything on the aaamarkers cell as corpses are just teleporting there anywhere, but script wont compile, same error as before. Sorry this must be such a noob post and a simple tweak

Posted

Nevermind... got the script to compile, and it worked - in theory.

 

Only problem is, it seems by moving the damn actor and killing it, it still won't respawn (assuming because the actor is now in another zone?)

 

So this has been a total fail :(

Posted (edited)

Are you editing a vanilla script? Cause they can break real easily with tweaks like this-

 

I'm not sure about your error out of context but if you add that ObjectReference Property line in the top property section, and use the same name for your property up there as you do in the script, it will compile - and if NPCs are moving it sounds like the rest of the script is working

 

Let me check something on respawning

Edited by 37G
Posted

Nah, mod script. It seems to work as scripted now but it seems moving the actor (placed by CK, not spawned by encounter) away from the cell means it won't respawn.

 

I tested the kill() function with the setposition and I come back after 30 days and they respawn.

But not with moveto function when it moves them to a different cell.

 

All I want to do is to remove the bodies of the pre-clones without messing up the actor respawning in the future. The setposition command would have been perfect (and works) if I can only place them like -30000 units away from the player.

Posted

No problem I get lost on this stuff all the time :thumbsup:

 

How about MoveTo but you just place the marker -30000 units away?

  • Recently Browsing   0 members

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