Moving the Player To A Reference Marker

Post » Mon Jun 18, 2012 6:11 pm

Ok I understand the new scripting language quite well now I believe, but for some reason it seems like the same script I would use in the construction set is not working here no matter how many versions of it I try and I am just getting angry. It used to be a tiny script in oblivion now it isn't working.

IN OBLIVION:

scn movemesomewherebegin Onactivateplayer.moveto JOSHMARKERend

IN skyrim this is the translated code I am using

Scriptname AAAmovescript extends ObjectReferenceObjectReference Property JOSHMARKER autoEvent OnActivate(ObjectReference akactivator)if (akActivator == Game.GetPlayer())   Game.GetPlayer().MoveTo(JOSHMARKER)endifEndEvent

My marker is located in a new worldspace :smile:

And here is what frustrates me even more after I could not get this thing to work I just decided to copy a script that does what I want in the game already here is there script.


Scriptname MS10MoveAdelaisaOnTrigger extends ObjectReferenceReferenceAlias Property Adelaisa auto ; on MS10ObjectReference Property TargetSpot autoEvent OnTriggerEnter(ObjectReference akActivator)if (akActivator == Game.GetPlayer())  if (Adelaisa.GetOwningQuest().GetStage() == 70)   Adelaisa.GetReference().MoveTo(TargetSpot)  endifendifEndEvent

So do I need a referencealias property for get player or something? Because it looks like the way bethesda moves an actor is by .getreference but how do I set it up to where I can reference a player property and move him to the marker? Or is there an easier way to do this all together. The script compiles by the way it's just when I load the game with the mod I click on my bear trap which has the script attatched to it and nothing happens.

Here is the bear trap
(I can't post links)http:/ /screencast. com/t /2mvYGSeSkDB
Here is the marker:
(I can't postlinks)http:/ /screencast .com/ t/ sbeyeIO5fMZ


Please help !
User avatar
Josh Trembly
 
Posts: 3381
Joined: Fri Nov 02, 2007 9:25 am

Post » Mon Jun 18, 2012 1:33 pm

Game.GetPlayer() returns an Actor I believe soo maybe try casting it as an ObjectReference?
e.g. (Game.GetPlayer() as ObjectReference).MoveTo(JOSHMARKER)

Might need to put Game.GetPlayer() into a variable first though... Give it a try, not sure what else to try.
User avatar
Stu Clarke
 
Posts: 3326
Joined: Fri Jun 22, 2007 1:45 pm

Post » Mon Jun 18, 2012 3:23 am

did you double check that the value of your JOSHMARKER property was properly set to the marker you placed?

and the Adelaisa.getreference() is the same as game.getplayer(), it just references an NPC instead
User avatar
Kieren Thomson
 
Posts: 3454
Joined: Sat Jul 21, 2007 3:28 am

Post » Mon Jun 18, 2012 11:45 am

Actually GetReference() returns an ObjectReference while GetPlayer() returns an Actor. MoveTo() requires an ObjectReference according to the wiki, so I'd say try typecasting if that fails then give using GetReference() a go.i.e. Game.GetPlayer().GetReference()
User avatar
Stephanie Valentine
 
Posts: 3281
Joined: Wed Jun 28, 2006 2:09 pm

Post » Mon Jun 18, 2012 3:05 am

Game.GetPlayer() returns an Actor I believe soo maybe try casting it as an ObjectReference?
e.g. (Game.GetPlayer() as ObjectReference).MoveTo(JOSHMARKER)

Might need to put Game.GetPlayer() into a variable first though... Give it a try, not sure what else to try.
Actor is a reference object. It extends ObjectReference.
ActorBase is the form object.
User avatar
Alexx Peace
 
Posts: 3432
Joined: Thu Jul 20, 2006 5:55 pm

Post » Mon Jun 18, 2012 11:31 am

Im trying this stuff still not getting it work ill keep playing with it any other information people have would be useful to me and if someone has successfully done this before please share the script you used to move the player to a marker.
User avatar
Gracie Dugdale
 
Posts: 3397
Joined: Wed Jun 14, 2006 11:02 pm

Post » Mon Jun 18, 2012 7:18 am

What you're doing should work. You will need JOSHMARKER set as a property. Click the script name > Properties > Add Property > Type: ObjectReference, Name: JOSHMARKER.

Here's a script that works with "target" instead of JOSHMARKER. Maybe Auto needs to be capital A.

Scriptname StardogMoveToOnActivate extends ObjectReference  ObjectReference Property target  Auto  Event OnActivate(ObjectReference akactivator)	if (akActivator == Game.GetPlayer())		Game.GetPlayer().MoveTo(target)	endifEndEvent
I think this would also a generic script that you could use anytime you wanted to move the player somewhere OnActivate, just by changing the "target" in the script properties.
User avatar
quinnnn
 
Posts: 3503
Joined: Sat Mar 03, 2007 1:11 pm

Post » Mon Jun 18, 2012 3:32 pm

So somehow it still doesn't work thanks for the reply stardog I appreciate it btw.

Anyway I checked script properties it's linked to the right marker, the marker is in the new world space. I made sure I spelled the marker's name right in the script I dont see what else I can do to be honest. At this probably only a bethesda guy can help me I dont know what else to try maybe its just not possible in skyrim. Does the activator mesh need to have something special about it? Like is there a checkbox? And does the marker need some special? I am using an Xmarker heading with default settings.
User avatar
MarilĂș
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Mon Jun 18, 2012 6:20 pm

Scriptname GetLocationScript extends ObjectReferenceObjectReference Property locationMarker AutoEvent OnActivate(ObjectReference akActivator)if akActivator == Game.GetPlayer()	akActivator.MoveTo(locationMarker)EndIfEndEvent

Just tested, and works just fine. You sure you're setting your properties correctly?
User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Mon Jun 18, 2012 6:17 am

Here is a script i wrote a few hours ago just for this doing something like this

Scriptname Teleportdoor extends ObjectReference
import game
import utility
ObjectReference Property Teleportone Auto
ObjectReference player

Event OnActivate(ObjectReference akActionRef)

player = game.getPlayer()
player.MoveTo(Teleportone)
endevent


I linked it too a door, it was the only way to get out of my stupid house, all my book shelves bugged the exit/enterance.
User avatar
Klaire
 
Posts: 3405
Joined: Wed Sep 27, 2006 7:56 am


Return to V - Skyrim