Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

So, I am trying to fill and reset aliases realtime, because I am lazy and do not want to add 100 different properties for 100 different places and handplace them in the editor and make a lot of new scenes for these npcs. So I try to do this:;

ObjectReference Property ReferenceTarget auto
ReferenceAlias Property TravelMarkerAlias auto
Static Property ConstructorTravelMarker auto

Function PlaceTravelMarker()
	ObjectReference TravelMarkerRef
	TravelMarkerRef	= ReferenceTarget.PlaceAtMe(ConstructorTravelMarker, 1, true, false, true)
	; Places an Xmarker at ReferenceTarget, this will be the travelpoint
	TravelMarkerAlias.ForceRefTo(TravelMarkerRef)
	;Forcing the ObjectReference of the Xmarker into quest alias temporarly.
EndFunction

 

 

The package for the NPC uses the TravelMarkerAlias as it's target location, so I kinda need it to fill.

The Alias is not filling and for some reason, placeatme() complains in the log that I am trying to place it at a "NONE" even though the property is filled.

Also have a function that clears the alias and deletes the marker after it's done. and every line of code that I have besides this one works without error.

But I must say that filling aliases realtime seems to be a pain in the backside.

You need to use an event to run your function. You cannot simply define a function and expect it to run without calling it to run from inside an event.

 

I have no idea what object your script is attached to nor how often it needs to be called so I cannot give a good suggestion on what event to use.

 

An example of what I'm talking about is as follows:

 

 

ObjectReference Property ReferenceTarget auto
ReferenceAlias Property TravelMarkerAlias auto
Static Property ConstructorTravelMarker auto

Function PlaceTravelMarker()
	ObjectReference TravelMarkerRef
	TravelMarkerRef	= ReferenceTarget.PlaceAtMe(ConstructorTravelMarker, 1, true, false, true)
	; Places an Xmarker at ReferenceTarget, this will be the travelpoint
	TravelMarkerAlias.ForceRefTo(TravelMarkerRef)
	;Forcing the ObjectReference of the Xmarker into quest alias temporarly.
EndFunction

Event OnInit()
  PlaceTravelMarker()
EndEvent 

 

 

Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

 

So, I am trying to fill and reset aliases realtime, because I am lazy and do not want to add 100 different properties for 100 different places and handplace them in the editor and make a lot of new scenes for these npcs. So I try to do this:;

ObjectReference Property ReferenceTarget auto
ReferenceAlias Property TravelMarkerAlias auto
Static Property ConstructorTravelMarker auto

Function PlaceTravelMarker()
	ObjectReference TravelMarkerRef
	TravelMarkerRef	= ReferenceTarget.PlaceAtMe(ConstructorTravelMarker, 1, true, false, true)
	; Places an Xmarker at ReferenceTarget, this will be the travelpoint
	TravelMarkerAlias.ForceRefTo(TravelMarkerRef)
	;Forcing the ObjectReference of the Xmarker into quest alias temporarly.
EndFunction

 

 

The package for the NPC uses the TravelMarkerAlias as it's target location, so I kinda need it to fill.

The Alias is not filling and for some reason, placeatme() complains in the log that I am trying to place it at a "NONE" even though the property is filled.

Also have a function that clears the alias and deletes the marker after it's done. and every line of code that I have besides this one works without error.

But I must say that filling aliases realtime seems to be a pain in the backside.

You need to use an event to run your function. You cannot simply define a function and expect it to run without calling it to run from inside an event.

 

I have no idea what object your script is attached to nor how often it needs to be called so I cannot give a good suggestion on what event to use.

 

An example of what I'm talking about is as follows:

 

 

ObjectReference Property ReferenceTarget auto
ReferenceAlias Property TravelMarkerAlias auto
Static Property ConstructorTravelMarker auto

Function PlaceTravelMarker()
	ObjectReference TravelMarkerRef
	TravelMarkerRef	= ReferenceTarget.PlaceAtMe(ConstructorTravelMarker, 1, true, false, true)
	; Places an Xmarker at ReferenceTarget, this will be the travelpoint
	TravelMarkerAlias.ForceRefTo(TravelMarkerRef)
	;Forcing the ObjectReference of the Xmarker into quest alias temporarly.
EndFunction

Event OnInit()
  PlaceTravelMarker()
EndEvent 

 

 

 

Sorry for not specifying that, but I do use this in events, actually I have several other functions in the same script that runs well, it is just this one that does not work.

I also asked at the bethesda forums, it seems that I got some answers there, the reason why I can't fill an alias is because it needs to initialize, which according to the guy who replied has to happen on quest start up or in a new stage.

Not sure why this is not listed as important info at the wiki at all when you go through quest tutorials.( or i might be blind). I would think that when a papyrus function called "ForceRefTo()" is used to force a reference into an alias, there should be some info about "initializing it" on the page. That would have saved me a ton of headache.

Link to comment
Share on other sites

The scripts attached to aliases are present and running from the moment the quest starts and you can call anything explicitly from another script at any time. It has nothing to do with whether the reference is filled. Of course, if the reference isn't filled it can't inherit any events, so all that fires by default is the OnInit event. And if you are filling an alias with ForceRefTo() there's no reason you can't force it to reinitialize by explicitly calling OnInit().

Link to comment
Share on other sites

The quest is running, that is not the problem. I need this function place the marker and force it into an alias when i close a menu, the menu the player and make him travel to a target. SO i am not entirely sure how to use OnInit here, because the target his going to travel to depends on the book he read and I want to avoid using over 20 different packages just because the travel destination is "random" So placing a marker, fill alias, travel, clear alias, delete marker would probably what i want, sorry for not beeing more specific.

Link to comment
Share on other sites

You might just need to explicitly call EvaluatePackage() on the actor reference that has the travel package after the alias is filled and marker is positioned. Better yet skip the alias entirely. Place a specific Xmarker in the world as a persistent reference. Then just move it to the desired position instead of creating a new marker and sticking it in an alias. Your package can reference the specific marker and if you call EvaluatePackage after moving it the NPC will move towards its new location. If the marker is originally placed in a holding cell that would never be a real destination you can condition your package to ignore it until it's moved out of that cell.

ObjectReference Property ReferenceTarget auto
ObjectReference Property TravelMarkerRef auto

Function PlaceTravelMarker()
	TravelMarkerRef.MoveTo(ReferenceTarget)
EndFunction
Link to comment
Share on other sites

 

You might just need to explicitly call EvaluatePackage() on the actor reference that has the travel package after the alias is filled and marker is positioned. Better yet skip the alias entirely. Place a specific Xmarker in the world as a persistent reference. Then just move it to the desired position instead of creating a new marker and sticking it in an alias. Your package can reference the specific marker and if you call EvaluatePackage after moving it the NPC will move towards its new location. If the marker is originally placed in a holding cell that would never be a real destination you can condition your package to ignore it until it's moved out of that cell.

ObjectReference Property ReferenceTarget auto
ObjectReference Property TravelMarkerRef auto

Function PlaceTravelMarker()
	TravelMarkerRef.MoveTo(ReferenceTarget)
EndFunction

It's funny, i just woke up and got my coffee, but i did not think of skipping alias, smart move, definitvely worth trying!

Link to comment
Share on other sites

  • 1 month later...

Hi all! :)

 

I have a few questions:

 

I installed Vurts Flora Overhaul. On the description page under requirements, there is a change I have to put into my Skyrim.ini file.

1) Why can I find my Skyrim.ini under: "Documents> My Games> Skyrim"

and not under:

"Documents > Meine Spiele (folder created by me when I installed Steam) > Steam > SteamApps > Common> Skyrim"?

 

It's not inside the Data-Folder or under this path either: Documents > Meine Spiele (folder created by me when I installed Steam) > Steam > SteamApps > Common> Skyrim > Skyrim (yes, I know the folder Skyrim appears twice- not a typo, I copy-pasted the path).

 

Is that normal?

Or should I copy-paste the Skyrim.ini file to: "Documents > Meine Spiele > Steam > SteamApps > Common> Skyrim"?

 

2) What about the Skyrim_default.ini? (Located: Documents > Meine Spiele > Steam > SteamApps > Common> Skyrim). Should I delete that or leave it alone?

 

 

3) Also for the Flora Overhaul, I have to change something in the SkyrimPrefs.ini. However, I have two SkyrimPrefs.ini files. Can I safely delete one of the two?

 

One is located here: Documents > Meine Spiele > Steam > SteamApps > Common> Skyrim > Skyrim (last changed 2014-19-09; not manually)

 

The other is located under: Documents > My Games > Skyrim. That .ini file was last changed 2016-15-09 (by me, but I deleted all the changes, it was a line I had to add for another Graphics Mod I uninstalled)

 

The changes I am supposed to make to the SkyrimPrefs.ini-file are as follows: change fTreesMidLODSwitchDist=100000.0000 to fTreesMidLODSwitchDist=10000000.0000

However, in both .ini files I have, the line "fTreesMidLODSwitchDist=100000.0000" is different.

The last changed file has: "fTreesMidLODSwitchDist=1e+007", while in the other, the line goes: "fTreesMidLODSwitchDist=3600.0000". I DID NOT CHANGE ANY OF THESE LINES MANUALLY, BUT I ASSUME A MOD DID.

Still, do I have to copy-paste the change over the line?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...