Jump to content

[Scripts] How to move the Player to a marker?


Nymra

Recommended Posts

Posted

I am unable to make the player move to the target location. 

 

Important: I m not a scripter, assume I know almost no basics. I am just learning by copying stuff already in existence. 
I am using Notepad++ and Tes5edit. CK is still not a tool for me. 


neither "playerref.moveto" not "game.getplayer().moveto" seem to work.
I can only guess that I have to define a property different or an additional one or something? 

 

the mod is "Simple Slavery" (I attached my modified source) 
I was unable to move the Player to other locations too, so something seems completly off here and I have no idea what. 
 

(I wanted to just move the PC outside of the Auction House door but that was also not working: "SSLV_AuctionDoorOutside") 

 

Ideally I want to move the PC to a place where he is surrounded by alot of PC, so "RiftenPlazaBrandishStallMarker" or "RiftenPlazalMarker"
So maybe I am just using the wrong markers? (some markers are just "XMarker" and some are "XMarkerHeading"? 

Faction Property RiftCrimeFaction Auto
ObjectReference property RiftenPlazaBrandishStallMarker auto

function NoMod_Slavery() ;NYMRA EXPERIMENT
	Auction()

	Debug.SendAnimationEvent(Game.Getplayer(), "IdleForceDefaultState")
	
	playerref.MoveTo(RiftenPlazaBrandishStallMarker)
	;Game.Getplayer().MoveTo(RiftenPlazaBrandishStallMarker)
	
	debug.notification("What is going on?")
	utility.wait(1)
	SendModEvent("xpoSubArrestPC", "RiftCrimeFaction", 2000)
	
	utility.wait(1)

	AuctionCleanup()
endfunction	

 

Posted

You're going to have to compile your script to make it run. The only way I know it can be done is via CK. The commented line is correct, as long as you link RiftenPlazaBrandishStallMarker to the appropriate location via CK. For the uncommented line to work, you'll have to similarly define and link playerref.

 

Setting up CK and get it to compile stuff is a whole different story though.

 

Edit: I'm assuming that's not the whole script. Otherwise there should be a header at the top.

Posted
41 minutes ago, Nymra said:

I am using Notepad++ and Tes5edit. CK is still not a tool for me. 

That will be hard ?

You would have to fill the properties (usually you do that in the CK)

and you have to compile the script. Compiling can be done by other compilers.

 

:classic_unsure: I can only suggest you swallow the ugly frog and get yourself a new friend: the shitty mighty CK.

And to start there, I can really recommend the DF127 youtube guides :classic_smile:

 

Learning to love  the bomb the CK: ?

Spoiler

 

 

Posted
26 minutes ago, dnoah said:

You're going to have to compile your script to make it run.

I already can compile. there are no errors too. It just does not work. 

 

Quote

The only way I know it can be done is via CK. The commented line is correct, as long as you link RiftenPlazaBrandishStallMarker to the appropriate location via CK. For the uncommented line to work, you'll have to similarly define and link playerref.

this where i just have no idea what it means. and I also cannot find any tutorial that seems to be connected :(

I mean where is that "linking" happening? In the script? in the ESP? it has to be saved and beeing able to be read somewhere? 

Quote

 

Setting up CK and get it to compile stuff is a whole different story though.

from what I see I can compile just 100% finde in notepad++ just dont know what values I have to put where?! 

 

Quote

Edit: I'm assuming that's not the whole script. Otherwise there should be a header at the top.

ops, forgot to put it in:
 

SSLV_MainScr.psc

Posted
6 minutes ago, worik said:

That will be hard ?

You would have to fill the properties (usually you do that in the CK)

what properties? everybody says that but I have zero idea what properties and where to find them. I mean its the same script text in notepad++ or the CK no?!
and I can see the properties in the TES5edit to my knowlegde? 

 

6 minutes ago, worik said:

and you have to compile the script. Compiling can be done by other compilers.

I am compiling via notepad++ and it is working fine basically, hmm. It was even strongly recommended to do so instead of using CK. 

6 minutes ago, worik said:

 

:classic_unsure: I can only suggest you swallow the ugly frog and get yourself a new friend: the shitty mighty CK.

And to start there, I can really recommend the DF127 youtube guides :classic_smile:

I am going to do that, but right now I feel like I just have to know the right values to put in that script to work. 

I mean it defies all logic know to me that it works basically the SAME as the original script, with the difference that my markers do not work and the original one does o_O
And I just dont see anything in the script that might be missing. 

Or I am just missing something in the great picture here. 

Posted

How are you filling properties without the CK?

 

I notice there's a PlayerRef property but there's also a commented out ;Game.GetPlayer() 

Which would suggest the original scripts didn't use PlayerRef.

Posted
20 minutes ago, Nymra said:

Or I am just missing something in the great picture here. 

Most likely ? But it's hard to tell from the scripts alone.

 

:classic_shy: Especially since I'm used to the CK.

But yes, it SHOULD be possible to do your stuff with an editor, a compiler and T5E alone ?

Posted
2 minutes ago, Monoman1 said:

How are you filling properties without the CK?

I have no idea. That is what I am asking! I am only copy pasting stuff. I dont even know really what a property is or what I have to "fill" in it. 

 

I assumed this is a property:

ObjectReference property SSLV_AuctionDoorOutside auto

what else to fill in there or add there for it to work?
 

2 minutes ago, Monoman1 said:

 

I notice there's a PlayerRef property but there's also a commented out ;Game.GetPlayer() 

Which would suggest the original scripts didn't use PlayerRef.

 

both

 

playerref.MoveTo(SSLV_XCross)

or 

Game.Getplayer().MoveTo(SSLV_XCross)

 

did not work.

 

 

original code: (full in the attachment) - it moves the PC to the location succesflly 

event on_new_slave(string eventName, string arg_s, float argNum, form sender)
	debug.trace("received new slave Mod Event")
	SendModEvent("dhlp-Suspend")
	playerref.moveto(SSLV_CageMark2)
	StripPlayer()
endevent

 

SSLV_MainScr.psc

Posted
12 minutes ago, Monoman1 said:

How are you filling properties without the CK?

You can do that in T5E as well. But it's bound to attract making mistakes :classic_unsure:

Posted
14 minutes ago, Nymra said:

I mean where is that "linking" happening? In the script? in the ESP? it has to be saved and beeing able to be read somewhere? 

 

Pretty much, yeah. You need the esp to contain info which game objects it puts into script variables. In CK, if your script is already assigned to a quest, you need to find that quest in Object Window, double-click it, go to Scripts tab, select your script, go to Properties, and fill the property in question. Something like this:

Spoiler


image.png.bf1d86e71045b71c0f9a9e0e11906045.png

 

There might be other ways to do it, been out of the loop for the last few years, but that's the only way I know it can be done.

Posted

There are probably errors. Did you do a search of 'SSLV_' in your papyrus log?

 

Oh and I'd forget about the idea of doing anything other than light modifications or batch operation or conflict resolution in TesEdit. 

Serious modding needs the CK IMO.

Posted
11 minutes ago, Monoman1 said:

There are probably errors. Did you do a search of 'SSLV_' in your papyrus log?

 

Oh and I'd forget about the idea of doing anything other than light modifications or batch operation or conflict resolution in TesEdit. 

Serious modding needs the CK IMO.

hmm, yes there are errors but they seem unrelated. I will read them more carefully next test tho. first time I actually use the log in that way :D

Papyrus.2.log Papyrus.1.log

Posted

Regarding ChoosingSlavery()

 

If I you want to test just your slavery outcome I'd comment out everything from 'if(Probability != 0)' at the top down to it's 'endif'

and move NoMod_Slavery() out of the commented out code.

 

Comment out blocks of code by starting with ;/

and ending with /;

Posted

Papyrus is a simple object oriented language, but every object needs a reference.

 

If you tell it, playerref.MoveTo(RiftenPlazaBrandishStallMarker), it has no idea what that is by default.

 

So you have the object reference property: 

ObjectReference property RiftenPlazaBrandishStallMarker auto

It still has no idea what it is until you link that property to the actual game object, which you can do in CK by filling out the property reference.

 

1:) Create the property in the script.

2:) Point that property at the object or reference that you want it to control.

3:) Script whatever you want using that property now that it's filled.

 

Without step two, it's like having a desk fan and a wall outlet but wondering why it won't turn on when you haven't plugged it in.

Posted
1 hour ago, Monoman1 said:

Regarding ChoosingSlavery()

 

If I you want to test just your slavery outcome I'd comment out everything from 'if(Probability != 0)' at the top down to it's 'endif'

and move NoMod_Slavery() out of the commented out code.

 

Comment out blocks of code by starting with ;/

and ending with /;

this was not the problem. 
the script works 100% , just the relocation doesent. 

Posted
1 hour ago, Tyrant99 said:

Papyrus is a simple object oriented language, but every object needs a reference.

 

If you tell it, playerref.MoveTo(RiftenPlazaBrandishStallMarker), it has no idea what that is by default.

 

So you have the object reference property: 


ObjectReference property RiftenPlazaBrandishStallMarker auto

It still has no idea what it is until you link that property to the actual game object, which you can do in CK by filling out the property reference.

 

1:) Create the property in the script.

2:) Point that property at the object or reference that you want it to control.

3:) Script whatever you want using that property now that it's filled.

 

Without step two, it's like having a desk fan and a wall outlet but wondering why it won't turn on when you haven't plugged it in.

thank you. I think I understand now. 


I think I had the impression that this is a task that I can pull of without any deeper connection. I understand now that I am wrong :D
 

@all

For now I found a workaround by starting the imprisonment right in the auction hall, so I can postpone the other stuff when I learned the CK better. 
thank you all so much
:)
 

Posted
8 hours ago, Nymra said:

I can postpone the other stuff when I learned the CK better. 
thank you all so much

Good luck ? :classic_smile:

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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