Quick Questions, Quick Answers Thread #9

Post » Tue Nov 20, 2012 10:59 am

http://www.gamesas.com/topic/1348211-the-quick-ck-questions-thread/ | http://www.gamesas.com/topic/1353350-quick-ck-questions-thread-2/ | http://www.gamesas.com/topic/1365336-quick-questions-quick-answers-the-3rd/ | http://www.gamesas.com/topic/1373468-quick-questions-quick-answers-thread-4/ | http://www.gamesas.com/topic/1395667-quick-questions-quick-answers-thread-5/ | http://www.gamesas.com/topic/1406245-quick-questions-quick-answers-thread-6/ | http://www.gamesas.com/topic/1411305-quick-questions-quick-answers-thread-7/ | http://www.gamesas.com/topic/1414436-quick-questions-quick-answers-thread-8/


Have a quick question? Need a quick answer? If you have not had any luck with the http://www.creationkit.com/Main_Page, post away and hopefully someone will have the answer(s) you seek.
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Post » Tue Nov 20, 2012 12:33 am

I'll make a start on this thread :smile:

I have a script attached to an object, that when removed from the container you first find it in, it deletes the old container. But, the inventory window still shows (even though you can see the old container disappears). Is there a function I can slot into my script to close the inventory menu when the object is taken?

Here's my code:

Spoiler

Scriptname HISWHGH1Carcass1 extends ObjectReferenceQuest Property HISWHGH1  Auto  Actor Property Player  Auto  Bool bDoOnceEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)		If !bDoOnce  if akNewContainer == Player && HISWHGH1.GetStage() == 10	  Debug.MessageBox("Changed container properly")		 akOldContainer.RemoveAllItems(akTransferTo = Player)							   akOldContainer.Disable()							   akOldContainer.Delete()						bDoOnce = True					else;  endIfEndIfendEvent
User avatar
Amy Cooper
 
Posts: 3400
Joined: Thu Feb 01, 2007 2:38 am

Post » Tue Nov 20, 2012 12:26 am

I see that you are removing all items. Why not just have an activator give the items? Or is it important that the player be able to view the items beforehand in inventory mode?
User avatar
Umpyre Records
 
Posts: 3436
Joined: Tue Nov 13, 2007 4:19 pm

Post » Tue Nov 20, 2012 6:18 am

I see that you are removing all items. Why not just have an activator give the items? Or is it important that the player be able to view the items beforehand in inventory mode?

The object the script is attached to is a Wolf Carcass. When it's taken, the wolf is deleted and all it's "bits" (like meat or lung, depending on which creature enhancing mod you're using is) are transferred to the player :)
User avatar
Stephanie Kemp
 
Posts: 3329
Joined: Sun Jun 25, 2006 12:39 am

Post » Mon Nov 19, 2012 11:51 pm

I have a question: how can I change the hour the game starts? so that the whole intro sequence is at night, rather than in the afternoon?
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Tue Nov 20, 2012 5:53 am

when making weapon racks those that hold 2 weapons and a shield. Making them is easy enough, but testing them ingame a large selection of weapons isnt placed properly on the rack.
Iron sword hovers above it, iron axe on the left side is turned opside down, and on the right side tilted to a 90 degree angle. Is that a bug with the scripting behind it, or is there a way i can control it?
Looks down right horrible when you try to make things look good in a desent setting
User avatar
Maya Maya
 
Posts: 3511
Joined: Wed Jul 05, 2006 7:35 pm

Post » Tue Nov 20, 2012 5:49 am

I have a question: how can I change the hour the game starts? so that the whole intro sequence is at night, rather than in the afternoon?

Should be easy. Have a quest Start Game Enabled, and a script in its stage to set the game hour... Not sure what sort of issues that can cause though.
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Tue Nov 20, 2012 8:13 am

Is there a tutorial somewhere that explains how to use arrays and what they can do in plain English? :P. I try and follow along on the CKWiki description but even the normal papyrus makes my head spin, and it seems to assume Im already coding savvy.

And another one. Are scripts attached to items always "inert"? Like the only way to affect an item without some kind of external event is to do it via a quest right? Eh, I dont know if thats a "quick" question though lol.
User avatar
Dan Wright
 
Posts: 3308
Joined: Mon Jul 16, 2007 8:40 am

Post » Tue Nov 20, 2012 8:05 am

Should be easy. Have a quest Start Game Enabled, and a script in its stage to set the game hour... Not sure what sort of issues that can cause though.
thanks. but besides some visual issues what can be expected?
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm

Post » Tue Nov 20, 2012 1:16 am

How to spawn an animal at an activator?
tried
ObjectReference property  animalref autoactor property chicken autoanimalref = Placeatme(chicken)
where chicken is one of the riverwood chickens.
the actor list list generic actors but I'm not allowed to select them just existing creatures? Do I use something else than actor for chicken?
User avatar
Alexandra walker
 
Posts: 3441
Joined: Wed Sep 13, 2006 2:50 am

Post » Tue Nov 20, 2012 5:45 am

When I view pieces, variants are only showing up exactly the same as the base part, e.g., a Green cave piece looks exactly the same as its Snow variant. This is a real pain, how can I fix this?
User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am

Post » Mon Nov 19, 2012 9:02 pm

How to spawn an animal at an activator?
Try http://www.creationkit.com/PlaceActorAtMe_-_ObjectReference
ActorBase Property ChickenBase AutoActor Property ChickenREF AutoChickenREF = PlaceActorAtMe(ChickenBase)
When I view pieces, variants are only showing up exactly the same as the base part, e.g., a Green cave piece looks exactly the same as its Snow variant. This is a real pain, how can I fix this?
File > Preferences > Shaders > ?

One of those checkboxes should make the visual differences apparent in the render window.
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Tue Nov 20, 2012 12:11 pm

Justinnnn, answer my quick question:

If I have an array with just a length defined and nothing else (like: float[] xyz = new float[3] ), will it result in true or false for a conditional like: if ( !xyz ) ?
User avatar
KiiSsez jdgaf Benzler
 
Posts: 3546
Joined: Fri Mar 16, 2007 7:10 am

Post » Mon Nov 19, 2012 8:42 pm

Hello!
I'm trying to add perk to player via quests script:

Spoiler
Scriptname MYSCRIPTAddPerk extends QuestPerk Property MYPERK Auto   if (Game.GetPlayer().HasPerk(MYPERK) == false)   Game.GetPlayer().AddPerk(MYPERK)MYQUEST.Stop()endif

But it fails with this error:
(5,1): missing EOF at 'if'

Where is my mistake?
User avatar
Jessie Butterfield
 
Posts: 3453
Joined: Wed Jun 21, 2006 5:59 pm

Post » Tue Nov 20, 2012 3:51 am

Hello!
I'm trying to add perk to player via quests script:

Spoiler
Scriptname MYSCRIPTAddPerk extends QuestPerk Property MYPERK Auto   if (Game.GetPlayer().HasPerk(MYPERK) == false)   Game.GetPlayer().AddPerk(MYPERK)MYQUEST.Stop()endif

But it fails with this error:
(5,1): missing EOF at 'if'

Where is my mistake?


Not sure what you're trying to do, but you're not calling a Function, or registering for an event. So how does the game know when you check your if statement?

Try this (put it inside a function or an event), for example:

Spoiler

Scriptname MYSCRIPTAddPerk extends QuestPerk Property MYPERK AutoQuest Property MYQUEST autoEvent OnInit()   if !Game.GetPlayer().HasPerk(MYPERK); checks if the player doesn't have the perk   Game.GetPlayer().AddPerk(MYPERK)MYQUEST.Stop()else;endifEndEvent
User avatar
claire ley
 
Posts: 3454
Joined: Fri Aug 04, 2006 7:48 pm

Post » Tue Nov 20, 2012 5:33 am

Question: I need to remove items from the PC (a quest dialogue handles this) but the number of items removed needs to be determined by a global value.

Any ideas?

:lightbulb:
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Tue Nov 20, 2012 11:07 am

Question: I need to remove items from the PC (a quest dialogue handles this) but the number of items removed needs to be determined by a global value.

Any ideas?

:lightbulb:

Easy :smile:

Here are 2 lines. 1 will remove as many items (ObjectProperty) according to your Global Property value. The other line, incase you need it, will give the player the correct amount of gold (ObjectProperty base gold value) * how many you're removing.

Player.AddItem(Gold, (ObjectProperty.GetGoldValue() As Float * GlobalProperty.GetValue()) As Int)Player.RemoveItem(ObjectProperty, (GlobalProperty.GetValueInt()))
User avatar
teeny
 
Posts: 3423
Joined: Sun Feb 25, 2007 1:51 am

Post » Tue Nov 20, 2012 6:52 am

Easy :smile:

Here are 2 lines. 1 will remove as many items (ObjectProperty) according to your Global Property value. The other line, incase you need it, will give the player the correct amount of gold (ObjectProperty base gold value) * how many you're removing.

Player.AddItem(Gold, (ObjectProperty.GetGoldValue() As Float * GlobalProperty.GetValue()) As Int)Player.RemoveItem(ObjectProperty, (GlobalProperty.GetValueInt()))

Looks like I wont have to lose hair due to stress after all, thanks.

:biggrin:
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Mon Nov 19, 2012 9:47 pm

Delete post.
User avatar
Miss K
 
Posts: 3458
Joined: Sat Jan 20, 2007 2:33 pm

Post » Tue Nov 20, 2012 1:51 am

Can an actor be in multiple aliases at the same time? Does the alias's owning quest priority decide which alias the actor gets when multiple aliases are trying to fill themselves with the same actor?
User avatar
glot
 
Posts: 3297
Joined: Mon Jul 17, 2006 1:41 pm

Post » Mon Nov 19, 2012 11:38 pm

Can an actor be in multiple aliases at the same time? Does the alias's owning quest priority decide which alias the actor gets when multiple aliases are trying to fill themselves with the same actor?

As long as you tick the Allow Reserved option in the Alias, it should cover your bases if another quest has reserved the NPC. The answer afaik, is yes, an actor can be in multiple aliases at once (as in multiple quests).
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Tue Nov 20, 2012 5:37 am

I'm redoing my portable alchemy mod and I'm trying to figure out how to best go about bringing up the alchemy crafting menu. The old method was by using a book which has a script attached to it. I'm currently trying to figure out how to do it with an item (mortar and pestle) that can be equipped and so that the item goes into the "Miscellaneous" section of the inventory. I tried doing it by making the item a light that can be equipped (like a torch) but doing that breaks the player animations. The issue isn't caused by using a custom model as even exact duplicates of the torch form exhibit the same problem. It works great when it comes down to getting the script to run. Has anybody else tried to do anything similar?
User avatar
Mylizards Dot com
 
Posts: 3379
Joined: Fri May 04, 2007 1:59 pm

Post » Mon Nov 19, 2012 9:58 pm

I'm redoing my portable alchemy mod and I'm trying to figure out how to best go about bringing up the alchemy crafting menu. The old method was by using a book which has a script attached to it. I'm currently trying to figure out how to do it with an item (mortar and pestle) that can be equipped and so that the item goes into the "Miscellaneous" section of the inventory. I tried doing it by making the item a light that can be equipped (like a torch) but doing that breaks the player animations. The issue isn't caused by using a custom model as even exact duplicates of the torch form exhibit the same problem. It works great when it comes down to getting the script to run. Has anybody else tried to do anything similar?

Well when I want to bring up a message (menu) by using an item from inventory I just add a script to that item so that when its equipped/used it triggers an activater and that activater has another script which handles the menu. By using activaters you can display as many messages as you want.

:lightbulb:
User avatar
Carolyne Bolt
 
Posts: 3401
Joined: Mon Jul 10, 2006 4:56 am

Post » Mon Nov 19, 2012 10:50 pm

I'm redoing my portable alchemy mod and I'm trying to figure out how to best go about bringing up the alchemy crafting menu. The old method was by using a book which has a script attached to it. I'm currently trying to figure out how to do it with an item (mortar and pestle) that can be equipped and so that the item goes into the "Miscellaneous" section of the inventory. I tried doing it by making the item a light that can be equipped (like a torch) but doing that breaks the player animations. The issue isn't caused by using a custom model as even exact duplicates of the torch form exhibit the same problem. It works great when it comes down to getting the script to run. Has anybody else tried to do anything similar?
Are you using those misc objects to activate a hidden vanilla alchemy bench? Because its still furniture so activating that way would be why you're getting those unwanted animations.

Try making a new bit of furniture with no model, no sit markers and only the keywords "isAlchemy" and "WICraftingAlchemy". Actually you might not even need any keywords in that field, just make sure the Workbench Data field all checks out.

http://i101.photobucket.com/albums/m57/will_cuthill/Alchemy.png
User avatar
Tyrel
 
Posts: 3304
Joined: Tue Oct 30, 2007 4:52 am

Post » Tue Nov 20, 2012 1:38 am

Thanks for the responses.

I don't even need to activate the workbench for the animations to break. Just the act of equipping an exact duplicate of the torch form (no script attached or anything modified at all) breaks the animations.

As long as the player isn't in the vicinity of the workbench that is being activated (an isolated interior cell in this case), then the alchemy workbench animations don't play (the menu works just fine). The most that I've done with an attached script so far is to make sure the OnEquipped event is called properly and trying to see if I could get around the issue by immediately unequipping the item. So it isn't related to anything that has to do with the script.


Issue is most likely solved. I thought misc items couldn't be used to call an event like OnEquipped seeing as how they can't be equipped, but apparently they can.

EDIT: Yep, problem solved.
User avatar
Sophie Louise Edge
 
Posts: 3461
Joined: Sat Oct 21, 2006 7:09 pm

Next

Return to V - Skyrim