Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

 

I need to create the same navmesh in multiple exterior locations. Is it possible to duplicate a navmesh?

 

...

 

No.

 

And scripting can't touch Navmesh, correct.

 

 

Thanks for your reply.

 

It was good to know there wasn't an existing way to do it. So I created a tes5edit script that will.

 

The script below will duplicate and move a finalized navmesh from one interior cell to another (doesn't do exterior cells or change coordinates yet but should be fairly simple in comparison to the rest). Tested with a follower.

 

But DON'T TRY IT unless you know tes5edit well and have a backup of your esp. It's likely quite unstable.

Edited: Removed script, don't want anyone to try it and screw up their mod. :) Have contacted the creators of TES5Edit to see if it's safe to use at all.

Edited by jayne2132
Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Hey fellow modders! was wondering, i have been busting my ass trying to figure out how to activate and fire gamebryo animation in a script, is there any chance you could help me out? I think I've met my wall in this script.

Short story, TypeB is the animation where lights are off and Type A is on, i have also tried using this with a myref.playgamebryoanimation("TypeB") with an ObjectProperty myref without any use.

 

Now it's very obvious that the script does something, the default animation on one of my meshes is "on" and when i apply this script and go into the test cell during day, it's off, but it just never fires and i just don't know why, the script compiles as it should.

Scriptname ImmersiveTestScript extends ObjectReference
{Controls a set of lights with a master enable parent marker with this
script attached to turn on and off at the times of the day specified
by the properties LightsOffTime and LightsOnTime}

float Property LightsOffTime = 6.0 auto
{The time at which lights should be turned off}
float Property LightsOnTime = 20.0 auto
{The time at which lights should be turned on}

float Function GetCurrentHourOfDay() global
{Returns the current time of day in hours since midnight}

    float Time = Utility.GetCurrentGameTime()
    Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit
    Time *= 24 ; Convert from fraction of a day to number of hours
    Return Time

EndFunction

Function RegisterForSingleUpdateGameTimeAt(float GameTime)
{Registers for a single UpdateGameTime event at the next occurrence
of the specified GameTime (in hours since midnight)}

    float CurrentTime = GetCurrentHourOfDay()
    If (GameTime < CurrentTime)
        GameTime += 24
    EndIf

    RegisterForSingleUpdateGameTime(GameTime - CurrentTime)

EndFunction

Event OnInit()

    If (GetCurrentHourOfDay() > LightsOffTime)
        GoToState("LightsOff")
    Else
        GoToState("LightsOn")
    EndIf

EndEvent

State LightsOff

    Event OnBeginState()
        PlayGamebryoAnimation("TypeB", afEaseInTime = 1.0)
        RegisterForSingleUpdateGameTimeAt(LightsOnTime)
    EndEvent

    Event OnUpdateGameTime()
        GoToState("LightsOn")
    EndEvent

EndState

State LightsOn

    Event OnBeginState()
        PlayGamebryoAnimation("TypeA", afEaseInTime = 1.0)
        RegisterForSingleUpdateGameTimeAt(LightsOffTime)
    EndEvent

    Event OnUpdateGameTime()
        GoToState("LightsOff")
    EndEvent

EndState

I used this script in my mod where it had an Disable() variable instead of the play animation part, that worked quite well, but now i want to advance the script a little. If i create animations to play instead of disable/enable objects i suddenly have some more playroom in my mod. I tested this script on the "FXburningemberHeavyToggle" that is already in the vanilla skyrim meshes/effects folder and lited in movablestatics in the creation kit.

 

If you got a good way to solve this or want to help do PM! :)

 

Thanks in advance!

Link to comment
Share on other sites

Hey fellow modders! was wondering, i have been busting my ass trying to figure out how to activate and fire gamebryo animation in a script, is there any chance you could help me out? I think I've met my wall in this script.

Short story, TypeB is the animation where lights are off and Type A is on, i have also tried using this with a myref.playgamebryoanimation("TypeB") with an ObjectProperty myref without any use.

 

Now it's very obvious that the script does something, the default animation on one of my meshes is "on" and when i apply this script and go into the test cell during day, it's off, but it just never fires and i just don't know why, the script compiles as it should.

Scriptname ImmersiveTestScript extends ObjectReference
{Controls a set of lights with a master enable parent marker with this
script attached to turn on and off at the times of the day specified
by the properties LightsOffTime and LightsOnTime}

float Property LightsOffTime = 6.0 auto
{The time at which lights should be turned off}
float Property LightsOnTime = 20.0 auto
{The time at which lights should be turned on}

float Function GetCurrentHourOfDay() global
{Returns the current time of day in hours since midnight}

    float Time = Utility.GetCurrentGameTime()
    Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit
    Time *= 24 ; Convert from fraction of a day to number of hours
    Return Time

EndFunction

Function RegisterForSingleUpdateGameTimeAt(float GameTime)
{Registers for a single UpdateGameTime event at the next occurrence
of the specified GameTime (in hours since midnight)}

    float CurrentTime = GetCurrentHourOfDay()
    If (GameTime < CurrentTime)
        GameTime += 24
    EndIf

    RegisterForSingleUpdateGameTime(GameTime - CurrentTime)

EndFunction

Event OnInit()

    If (GetCurrentHourOfDay() > LightsOffTime)
        GoToState("LightsOff")
    Else
        GoToState("LightsOn")
    EndIf

EndEvent

State LightsOff

    Event OnBeginState()
        PlayGamebryoAnimation("TypeB", afEaseInTime = 1.0)
        RegisterForSingleUpdateGameTimeAt(LightsOnTime)
    EndEvent

    Event OnUpdateGameTime()
        GoToState("LightsOn")
    EndEvent

EndState

State LightsOn

    Event OnBeginState()
        PlayGamebryoAnimation("TypeA", afEaseInTime = 1.0)
        RegisterForSingleUpdateGameTimeAt(LightsOffTime)
    EndEvent

    Event OnUpdateGameTime()
        GoToState("LightsOff")
    EndEvent

EndState
I used this script in my mod where it had an Disable() variable instead of the play animation part, that worked quite well, but now i want to advance the script a little. If i create animations to play instead of disable/enable objects i suddenly have some more playroom in my mod. I tested this script on the "FXburningemberHeavyToggle" that is already in the vanilla skyrim meshes/effects folder and lited in movablestatics in the creation kit.

 

If you got a good way to solve this or want to help do PM! :)

 

Thanks in advance!

No time to PM. ;)

Now, you didn't call the function right. You can't just call it outright - you have to call it ON an ObjectReference property referencing the thing you want to play the Anim.

Link to comment
Share on other sites

Didn't even remember this good thing we have here. (Q&A)

 

 

If I give item effect similar to dawnguard gear (When worn gains bonus passive effects against X when conditions are met), does it work for NPC's as well?
I vaguely remember I saw somewhere someone saying that only perks which are given in spellList will affect NPC's.

Edited by Guest
Link to comment
Share on other sites

 

Hey fellow modders! was wondering, i have been busting my ass trying to figure out how to activate and fire gamebryo animation in a script, is there any chance you could help me out? I think I've met my wall in this script.

Short story, TypeB is the animation where lights are off and Type A is on, i have also tried using this with a myref.playgamebryoanimation("TypeB") with an ObjectProperty myref without any use.

 

Now it's very obvious that the script does something, the default animation on one of my meshes is "on" and when i apply this script and go into the test cell during day, it's off, but it just never fires and i just don't know why, the script compiles as it should.

-Snip-
I used this script in my mod where it had an Disable() variable instead of the play animation part, that worked quite well, but now i want to advance the script a little. If i create animations to play instead of disable/enable objects i suddenly have some more playroom in my mod. I tested this script on the "FXburningemberHeavyToggle" that is already in the vanilla skyrim meshes/effects folder and lited in movablestatics in the creation kit.

 

If you got a good way to solve this or want to help do PM! :smile:

 

Thanks in advance!

No time to PM. :wink:

Now, you didn't call the function right. You can't just call it outright - you have to call it ON an ObjectReference property referencing the thing you want to play the Anim.

 

 

 

 

Hmm you mean like

ObjectReference Property myref auto

   Event OnBeginState()
        myref.PlayGamebryoAnimation("TypeB", afEaseInTime = 1.0)
        RegisterForSingleUpdateGameTimeAt(LightsOnTime)
    EndEvent

I tried that and i couldn't get it to work for some reason and the problem is that i need to figure out how to call it to several objects as this will be linked to many lights in my mod, using this script on every light will probably create one hell of a Performance monster me thinks. Not sure which property to choose then.

Link to comment
Share on other sites

Having trouble filling a quest alias after it has been cleared using the following script. When I try to test this, the alias gets cleared (if it wasn't left empty) but the alias never gets refilled. Does anyone know what could cause this or have any experience with something like this?

Scriptname Mod1QPart1LetterScript extends ObjectReference

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
	if (akNewContainer == Game.GetPlayer())
		Secret_Invitation.clear();
		debug.notification("Secret_Invitation Alias cleared")
		Secret_Invitation.ForceRefTo(self);
		debug.notification("Secret_Invitation Alias refilled")
	endif
EndEvent

Event OnRead()
	MOD1QPart1.SetStage(stagetoset)
EndEvent

Quest Property MOD1QPart1  Auto  
Int Property stagetoset  = 70 Auto 
ReferenceAlias Property Secret_Invitation Auto 

Some Additional Background On What I'm Trying To Do

 

 

I have 7 different versions of a single item to give to the player -- which version they recieve is dependent on the player's race. This item (or rather whichever version of it the player recieves) is supposed to be a quest item and therefore I have created a quest reference alias to hold the object reference of the item the player recieves.

To handle this situation I initially fill the alias some arbitrary object reference or with nothing at all (have tried doing both); then when the player recieves the correct version of the item (an invitation BOOK item) a script -- which is on the base invitation BOOK objects -- is supposed to set the created quest alias empty and force fill it with the reference of the object that the player acquired.

 

 

Edited by DesertEaglePWN
Link to comment
Share on other sites

Maybe I should have asked this on here instead of making a post:

 

 

There are 2 follower mods that I really like but 1 Looks really good but has boring vanilla dialog the other one really has in depth dialog and levels nicely but not a fan of her looks. But anyways I would like to swap the hair a face to the other one for my own game play only. Somone else did this but i could not contact them : \ .

The followers I want the put the face and hair of this one >>>>> Ulrica http://www.nexusmods...im/mods/59114/? To this one >>>>>> Vilja http://www.nexusmods.com/skyrim/mods/26393/?

Please guys help me with this one :D . I have tried to figure it out my self but no luck :sad:

Link to comment
Share on other sites

Having trouble filling a quest alias after it has been cleared using the following script. When I try to test this, the alias gets cleared (if it wasn't left empty) but the alias never gets refilled. Does anyone know what could cause this or have any experience with something like this?

Scriptname Mod1QPart1LetterScript extends ObjectReference

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
	if (akNewContainer == Game.GetPlayer())
		Secret_Invitation.clear();
		debug.notification("Secret_Invitation Alias cleared")
		Secret_Invitation.ForceRefTo(self);
		debug.notification("Secret_Invitation Alias refilled")
	endif
EndEvent

Event OnRead()
	MOD1QPart1.SetStage(stagetoset)
EndEvent

Quest Property MOD1QPart1  Auto  
Int Property stagetoset  = 70 Auto 
ReferenceAlias Property Secret_Invitation Auto 
Some Additional Background On What I'm Trying To Do

 

 

I have 7 different versions of a single item to give to the player -- which version they recieve is dependent on the player's race. This item (or rather whichever version of it the player recieves) is supposed to be a quest item and therefore I have created a quest reference alias to hold the object reference of the item the player recieves.

 

To handle this situation I initially fill the alias some arbitrary object reference or with nothing at all (have tried doing both); then when the player recieves the correct version of the item (an invitation BOOK item) a script -- which is on the base invitation BOOK objects -- is supposed to set the created quest alias empty and force fill it with the reference of the object that the player acquired.

 

Can I see a picture of the way the alias is set up? If you th this with a test alias set to an actor, not object, does it work or not?

Link to comment
Share on other sites

Having trouble filling a quest alias after it has been cleared using the following script. When I try to test this, the alias gets cleared (if it wasn't left empty) but the alias never gets refilled. Does anyone know what could cause this or have any experience with something like this?

Scriptname Mod1QPart1LetterScript extends ObjectReference

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
	if (akNewContainer == Game.GetPlayer())
		Secret_Invitation.clear();
		debug.notification("Secret_Invitation Alias cleared")
		Secret_Invitation.ForceRefTo(self);
		debug.notification("Secret_Invitation Alias refilled")
	endif
EndEvent

Event OnRead()
	MOD1QPart1.SetStage(stagetoset)
EndEvent

Quest Property MOD1QPart1  Auto  
Int Property stagetoset  = 70 Auto 
ReferenceAlias Property Secret_Invitation Auto 

 

Items in an inventory do not exist as object references, so they cannot fill aliases. You'll have to create the item as an object and put it in the alias before it is added to the player's inventory. The best way to do that depends on how the player initially receives the book.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...