Quick Questions, Quick Answers Thread #8

Post » Mon Nov 19, 2012 8:36 pm

How do I stop an activator displaying the open/close animation?

I'm using an activator with the http://skyrim.nexusmods.com/mods/18340. The activator points to this model (Furniture\OrcFurniture\OrcDresser01.nif), which I guess contains animations in it. The script I'm using to control the activator has some "playanimation" and "playgamebryoanimation" lines in it, but I've commented them all out.

But the opening animation still plays when I activate it, which is annoying because sometimes it ends it leaving the drawers open permanently until I activate them again.
I'm not sure if this will work but you could try BlockActivation(). If you put that command in an OnLoad() event it should reliably prevent any activation. If you put another BlockActivation() in an OnActivate() event you should be able to fire off the rest of your code without those pesky animations.
User avatar
.X chantelle .x Smith
 
Posts: 3399
Joined: Thu Jun 15, 2006 6:25 pm

Post » Mon Nov 19, 2012 10:02 am

thnk it's possible to make "homing spells"?
for example, take Alduin's storm call shout: would it be possible to have the meteors "home in" to the player, but still with a chance of missing?
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Mon Nov 19, 2012 7:17 pm

Has anyone had any success using AddForm on leveled actors? My script tried to use it and it didn't work at all (I was trying to add ActorBases to an empty leveled character list, and none appeared.)

A quick Notepad++ search in the source folder shows me Bethesda never really used it, a quick Forum search showed me nothing but people trying only using the LeveledItem version.
User avatar
FITTAS
 
Posts: 3381
Joined: Sat Jan 13, 2007 4:53 pm

Post » Mon Nov 19, 2012 7:22 pm

Can you alter potion duration through a Perk? The closest thing I've found seems to be Modify Positive Chem Duration, but that doesn't quite fit what I need. I would alter the effect duration but that doesn't seem to be an option either in the perks.
User avatar
Miss Hayley
 
Posts: 3414
Joined: Tue Jun 27, 2006 2:31 am

Post » Mon Nov 19, 2012 12:40 pm

Would this return true or false?
bool function ArrayTest()  float[] p0 = new float[3]  if ( !p0 )	return false  else	return true  endifendfunction
User avatar
Kirsty Collins
 
Posts: 3441
Joined: Tue Sep 19, 2006 11:54 pm

Post » Mon Nov 19, 2012 8:01 pm

How badly does adding scripted objects to the game cause slowdowns \ FPS hit? Does it depend on the length and complexity of the script, or is it just the fact that an item is scripted?

I'm working on a mod that adds harvestable apple trees to the game, with physics-enabled apples that you can pick or shoot down, etc. The problem is that the apples can sometimes be accidentally jostled off the tree by NPCs, creatures, or the wind, apparently. Someone suggested using the beehive script to fix that. It's a very simple 10 line script that enables Havok on an object when said object is hit. I tested it out and it works beautifully for my purposes, but I'm not scripter and I'm worried that adding a script to all the apples is a bad idea for resource reasons.

If I add that script to a dozen individual apples per tree, and I've got maybe two dozen cells scattered across Skyrim containing two trees per cell, is that going to create an FPS hit? How bad of one?

I'm not sure if I want to do this if it's going to cause slowdowns, even small ones, because so far there's only one person reporting that his apples are falling from the trees. It works fine for everyone else and I can't replicate the problem in my game, so this is about the only way I know of to fix it. I'm thinking I may offer two versions of the mod, one regular and one with "stay on the damn tree" scripts for use if anyone has an issue, but I still need to know whether it's going to cause slowdowns.

You can find the script in the Data --> Scripts --> Source folder, it's called BeeHiveHavokOnHit.psc. I wasn't sure if quoting it here would be a no-no since it's a vanilla Beth script.

Thanks for anyone's help.
User avatar
Milad Hajipour
 
Posts: 3482
Joined: Tue May 29, 2007 3:01 am

Post » Mon Nov 19, 2012 5:58 pm

Any way to quickly close the inventory menu on a container, when an item is removed? I have an item with script attached that when taken also removes all the other items in the container. However the inventory menu still shows after taking the item.

Thanks guys :)
User avatar
gary lee
 
Posts: 3436
Joined: Tue Jul 03, 2007 7:49 pm

Post » Mon Nov 19, 2012 8:29 am

Any way to quickly close the inventory menu on a container, when an item is removed? I have an item with script attached that when taken also removes all the other items in the container. However the inventory menu still shows after taking the item.

Thanks guys :smile:

I can't guarantee that it'll work, but perhaps SKSE's http://www.creationkit.com/GetMappedKey_-_Input and http://www.creationkit.com/TapKey_-_Input functions could help you out?
User avatar
Verity Hurding
 
Posts: 3455
Joined: Sat Jul 22, 2006 1:29 pm

Post » Mon Nov 19, 2012 6:47 am

Any way to quickly close the inventory menu on a container, when an item is removed? I have an item with script attached that when taken also removes all the other items in the container. However the inventory menu still shows after taking the item.

Thanks guys :smile:

What happens if you call disable?
User avatar
i grind hard
 
Posts: 3463
Joined: Sat Aug 18, 2007 2:58 am

Post » Mon Nov 19, 2012 8:01 am

How badly does adding scripted objects to the game cause slowdowns \ FPS hit? Does it depend on the length and complexity of the script, or is it just the fact that an item is scripted?

I'm working on a mod that adds harvestable apple trees to the game, with physics-enabled apples that you can pick or shoot down, etc. The problem is that the apples can sometimes be accidentally jostled off the tree by NPCs, creatures, or the wind, apparently. Someone suggested using the beehive script to fix that. It's a very simple 10 line script that enables Havok on an object when said object is hit. I tested it out and it works beautifully for my purposes, but I'm not scripter and I'm worried that adding a script to all the apples is a bad idea for resource reasons.

If I add that script to a dozen individual apples per tree, and I've got maybe two dozen cells scattered across Skyrim containing two trees per cell, is that going to create an FPS hit? How bad of one?

I'm not sure if I want to do this if it's going to cause slowdowns, even small ones, because so far there's only one person reporting that his apples are falling from the trees. It works fine for everyone else and I can't replicate the problem in my game, so this is about the only way I know of to fix it. I'm thinking I may offer two versions of the mod, one regular and one with "stay on the damn tree" scripts for use if anyone has an issue, but I still need to know whether it's going to cause slowdowns.

First, if they aren't persistant, only the scripts of the objects in the currently loaded cells are going to run. So it's not like all scripts you add are all running at the same time.

And the performance slowdown is not much. Yes it depends on the length and complexity of the script. If you have 1000 things happening every second in 100 different scripts, it might cause slowdowns. Most scripts are not that complex though, and a 10-line script is going to have no chance of causing any slowdowns unless you have thousands of copies running and they iterate. The script you want to use just runs one thing when the object loads and one thing when you hit it... so there will probably be no performance difference at all, even if you have it attached to hundreds of objects.
User avatar
Chelsea Head
 
Posts: 3433
Joined: Thu Mar 08, 2007 6:38 am

Post » Mon Nov 19, 2012 8:20 am

edit: got it. ignore this post >.<
User avatar
Danial Zachery
 
Posts: 3451
Joined: Fri Aug 24, 2007 5:41 am

Post » Mon Nov 19, 2012 5:59 am

First, if they aren't persistant, only the scripts of the objects in the currently loaded cells are going to run. So it's not like all scripts you add are all running at the same time.

And the performance slowdown is not much. Yes it depends on the length and complexity of the script. If you have 1000 things happening every second in 100 different scripts, it might cause slowdowns. Most scripts are not that complex though, and a 10-line script is going to have no chance of causing any slowdowns unless you have thousands of copies running and they iterate. The script you want to use just runs one thing when the object loads and one thing when you hit it... so there will probably be no performance difference at all, even if you have it attached to hundreds of objects.

Excellent, thank you. Scripted apples for everyone!
User avatar
marina
 
Posts: 3401
Joined: Tue Mar 13, 2007 10:02 pm

Post » Mon Nov 19, 2012 1:21 pm

Hello everyone,

I have this Actor who has, after some packages and a scene, followed me up to my custom house. Now once the quest is done I would like him to live in the castle. I was wondering if it would be as simple as putting some packages (eating, sleeping, sand-boxing) at the top of his package list and giving them conditions so that they are only valid after the quest is done. If it is that simple does anyone have some suggestions for the most effective/efficient conditions to use?

Thanks for any information.
User avatar
Nitol Ahmed
 
Posts: 3321
Joined: Thu May 03, 2007 7:35 am

Post » Mon Nov 19, 2012 2:39 pm

Excellent, thank you. Scripted apples for everyone!

But no cheese? :(
User avatar
jodie
 
Posts: 3494
Joined: Wed Jun 14, 2006 8:42 pm

Post » Mon Nov 19, 2012 6:53 pm

Hello everyone,

I have this Actor who has, after some packages and a scene, followed me up to my custom house. Now once the quest is done I would like him to live in the castle. I was wondering if it would be as simple as putting some packages (eating, sleeping, sand-boxing) at the top of his package list and giving them conditions so that they are only valid after the quest is done. If it is that simple does anyone have some suggestions for the most effective/efficient conditions to use?

Thanks for any information.

GetQuestCompleted is the condition you are looking for.
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Mon Nov 19, 2012 1:09 pm

But no cheese? :(

Awww. Yes, there is cheese, too! Sharp cheddar, marbled jack cheese, expensive imported cheese from Bruma, Elven white cheese, brandy-laced cheese, and... Brie, which is not particularly lore-friendly and likely won't be in the release, but I like it, so it's in my personal mod. :)

The extra food & recipes mod is a separate release from the apple trees, though. I'm not done adding everything I want to add, primarily because most of what's left to add requires ingredients that don't exist yet. I'm done wrestling with the fiddlehead ferns to make them harvestable, now I'm on to kelp. Also, there aren't nearly enough mushrooms found naturally in the game. The whole point of this began as a way to make living off the land more feasible for hermits and rangers who are sick of an all-venison, all-the-time diet. And because my inner chef felt that the names of existing foods needed, uh, spicing up.

But this isn't a topic for this thread anymore. I got my quick answer!
User avatar
Dan Scott
 
Posts: 3373
Joined: Sun Nov 11, 2007 3:45 am

Post » Mon Nov 19, 2012 8:30 am

I was looking through the player dialog tabs and under Misc i noticed there is a type for "Follow Me" as there would be for Attack, Hello, etc.

If I do a custom line for this will it be used when I tell my companion to follow me when she is controlled by the standard follower quest?
User avatar
Genevieve
 
Posts: 3424
Joined: Sun Aug 13, 2006 4:22 pm

Post » Mon Nov 19, 2012 10:48 am

I need a program to create a BSA for upload to Steam, as Steam will not include facegen texture files on it's own. I can't use BSA Opt as I use Windows XP. Any ideas?
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am

Post » Mon Nov 19, 2012 7:33 am

text
i have to make sure i get this mod when you release it... sounds like the kind of thing i always wanted to do in an MMO tbh.

----

ok, so here i am again and i'm having trouble with OnStoryKillActor. Basically i read every single topic related to "OnStoryKillActor" in search and nothing really helped. so I took screenshots. The weird thing is i followed these same steps for the Level-up event and it works fine but I don't get anything fired for OnStoryKillActor... can someone tell me if/where I screwed up? Even with no conditions on the branch, it doesn't fire.


http://imageshack.us/a/img528/8562/questj.jpg
User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Mon Nov 19, 2012 4:21 pm

I'm running into another issue with my apple trees. Yeah, again.

I am using the vanilla beehive script to keep the apples on the tree. It's a simple script that enables Havok when the object is hit.

The problem is, when I first start a new clean game and go check out my trees, it works beautifully. But when I make an update to add new trees, and go to test it, the script doesn't work and my new apples all start out Havok-enabled and fall right off the trees. The only way I can get it to work is to start a new game, and obviously that's useless.

Edit: Okay. I've figured out that it isn't working because the cell's not loading -- it's already loaded.

Apparently, the script runs once when you first enter a cell and disables Havok on everything with the script attached, but then it doesn't run again when you load a savegame. It treats the cell as being already loaded, so even if you've placed totally new objects in there with that script on them, the script won't function because it wants the cell to load first.

Basically, anytime I place an apple with the script in a cell the player's already visited, that script will not work. Doesn't matter if it's a brand new object, doesn't matter if it's a clean save without ever having had that mod running. No cell load = no script worky.

How do I make the script do what it needs to do, when the cell may already be loaded? I guess OnLoad and OnCellAttach both assume the cell will be loading, but if it's already loaded... no go. There must be a way to make this work? And how is a cell possibly already loaded when you're just starting up the game now? If I start up a savegame, evidently that does not count as loading the cell, because the script's not working. Somehow the savegame remembers which cells were already loaded.

This mod is making me cry. :( Every single time I go through hell and finally "fix" the apples to stay on the trees, next time I work on it I find that HAHAHAHAHA that didn't fix it after all, serves you right for thinking you could mod with the big boys! What an idiot.
User avatar
Laura Shipley
 
Posts: 3564
Joined: Thu Oct 26, 2006 4:47 am

Post » Mon Nov 19, 2012 1:12 pm

How do I make the script do what it needs to do, when the cell may already be loaded? I guess OnLoad and OnCellAttach both assume the cell will be loading, but if it's already loaded... no go. There must be a way to make this work? And how is a cell possibly already loaded when you're just starting up the game now? If I start up a savegame, evidently that does not count as loading the cell, because the script's not working. Somehow the savegame remembers which cells were already loaded.

Oh, you already tried OnCellAttach? It should work but if you already tested it then maybe not. I have something else for you to try, but one that requires more work, can you PM me so I don't forget to write about it?
User avatar
Matthew Barrows
 
Posts: 3388
Joined: Thu Jun 28, 2007 11:24 pm

Post » Mon Nov 19, 2012 5:30 am

I'm experimenting with papyrus, trying to learn how to use it etc.
I don't have a PC copy of skyrim yet, so i'm just messing with code in Notepad++, and i wnat some help for a script
This script is for a small pillar that provides a hint for a puzzle, at a cost (most likely health, magicka and stamina). there are three levels of hint.
the puzzle is using a custom spell (Freezefyre) to melt a special "Red Ice" barrier and light a lantern. i think it's set up correctly, but i don't know how to make the pillar cast a spell (let's call it HintPenalty1 fotr the first and HintPenalty2 for the second). i think i need to use
Function Cast(ObjectReference akSource, ObjectReference akTarget = None) Native
but i don't know how to set up the function to cast the spell at the player. how would i set up the script to do this?
script:
Spoiler

ScriptName EBHintScript01 extends ObjectReference(the first Hint Pillar - Freezefyre lantern)int count ; this variable records the number of times the object has been activatedEvent OnActivate(ObjectReference akActionRef)count = count + 1 ; adds 1 to the count variable upon activation, before displaying the messageIf count == 1 ; the first time it is activated (the count starts at 0 when you first load the plugin, but when you activate the object it adds 1 to count before displaying the message, thus the first MessageBox needs to be set to 1 not 0)Debug.MessageBox("Cursed Ice needs to be melted with a special substance")ElseIf count == 2 ; the second time you activate it.Function Cast(objectRefference akSource, ObjectReference akTarget = None) NativeDebug.MessageBox("Red Ice, Blue Fire")ElseIf count == 3 ; the third timeDebug.MessageBox("Use Freezefyre to melt the Red Ice and light the lantern")Function Cast (ObjectReference akSource, ObjectReference akTarget = None) NativeElse ; the all other times, does not have a penaltyDebug.MessageBox("Use Freezefyre to melt the Red Ice and light the lantern")EndIfendEvent
User avatar
kelly thomson
 
Posts: 3380
Joined: Thu Jun 22, 2006 12:18 pm

Post » Mon Nov 19, 2012 3:42 pm

I need a program to create a BSA for upload to Steam, as Steam will not include facegen texture files on it's own. I can't use BSA Opt as I use Windows XP. Any ideas?
You have Archive.exe in your Skyrim folder. :)
User avatar
Cameron Garrod
 
Posts: 3427
Joined: Sat Jun 30, 2007 7:46 am

Post » Mon Nov 19, 2012 3:56 pm

Just want to reiterate my outstanding questions:

1. The model Dungeons\Imperial\Door\ImpButton01.nif has animations that are viewable in NifSkope. Bethesda scripts attached to these objects fail to animate them properly so how can I?

2.Most of us should know about how scripts getting embedded in save game data can be problematic. What I want to know is what I should do for mods currently in development (still very much alpha). Whenever I wish to play Skyrim instead of just modding it/playtesting, aside from having my esp unchecked I've also been completely removing all psc and pex files pertaining to my mod from skyrim\data\scripts.

Is this necessary?
User avatar
Veronica Flores
 
Posts: 3308
Joined: Mon Sep 11, 2006 5:26 pm

Post » Mon Nov 19, 2012 12:17 pm

I'm experimenting with papyrus, trying to learn how to use it etc.
I don't have a PC copy of skyrim yet, so i'm just messing with code in Notepad++, and i wnat some help for a script
This script is for a small pillar that provides a hint for a puzzle, at a cost (most likely health, magicka and stamina). there are three levels of hint.
the puzzle is using a custom spell (Freezefyre) to melt a special "Red Ice" barrier and light a lantern. i think it's set up correctly, but i don't know how to make the pillar cast a spell (let's call it HintPenalty1 fotr the first and HintPenalty2 for the second). i think i need to use
Function Cast(ObjectReference akSource, ObjectReference akTarget = None) Native
but i don't know how to set up the function to cast the spell at the player. how would i set up the script to do this?
script:
Spoiler
ScriptName EBHintScript01 extends ObjectReference(the first Hint Pillar - Freezefyre lantern)int count ; this variable records the number of times the object has been activatedEvent OnActivate(ObjectReference akActionRef)count = count + 1 ; adds 1 to the count variable upon activation, before displaying the messageIf count == 1 ; the first time it is activated (the count starts at 0 when you first load the plugin, but when you activate the object it adds 1 to count before displaying the message, thus the first MessageBox needs to be set to 1 not 0)Debug.MessageBox("Cursed Ice needs to be melted with a special substance")ElseIf count == 2 ; the second time you activate it.Function Cast(objectRefference akSource, ObjectReference akTarget = None) NativeDebug.MessageBox("Red Ice, Blue Fire")ElseIf count == 3 ; the third timeDebug.MessageBox("Use Freezefyre to melt the Red Ice and light the lantern")Function Cast (ObjectReference akSource, ObjectReference akTarget = None) NativeElse ; the all other times, does not have a penaltyDebug.MessageBox("Use Freezefyre to melt the Red Ice and light the lantern")EndIfendEvent
Spoiler
ScriptName EBHintScript01 Extends ObjectReference ;the first Hint Pillar - Freezefyre lantern}Int iCount ; this variable records the number of times the object has been activatedActor Property PlayerREF AutoSpell Property HintPenalty1 AutoSpell Property HintPenalty2 AutoEvent OnActivate(ObjectReference akActionRef)	If akActionRef == PlayerREF		iCount += 1 ; adds 1 to the count variable upon activation, before displaying the message		If iCount == 1 ; the first time it is activated (the count starts at 0 when you first load the plugin, but when you activate the object it adds 1 to count before displaying the message, thus the first MessageBox needs to be set to 1 not 0)			Debug.MessageBox("Cursed Ice needs to be melted with a special substance")		ElseIf iCount == 2 ; the second time you activate it.			Cast(HintPenalty1, PlayerREF)			Debug.MessageBox("Red Ice, Blue Fire")		ElseIf iCount == 3 ; the third time			Debug.MessageBox("Use Freezefyre to melt the Red Ice and light the lantern")			Cast(HintPenalty1, PlayerREF)		Else ; the all other times, does not have a penalty			Debug.MessageBox("Use Freezefyre to melt the Red Ice and light the lantern")		EndIf	EndIfEndEvent
You don't need to declare inherited functions. Your activator can call Cast implicitly as its script extends ObjectReference. Also note the '+=' and {comment} changes.
User avatar
Reven Lord
 
Posts: 3452
Joined: Mon May 21, 2007 9:56 pm

PreviousNext

Return to V - Skyrim