Quick CK questions Thread #2

Post » Tue Jun 19, 2012 11:28 am

That's correct. It's not particularly complicated, though - it just requires swapping a single bit in a file header before you open it as a master file in the Creation Kit, then swapping it back again after. There are multitudes of programs that you can use to do this quickly.

The hardest bit is remembering not to open your file without setting the ESM bit correctly in its master, as the Creation Kit will strip it out of your file's masters list (assuming it functions the same as previous editors in this respect).

Cipscis
User avatar
Shaylee Shaw
 
Posts: 3457
Joined: Wed Feb 21, 2007 8:55 pm

Post » Tue Jun 19, 2012 4:53 pm

I got a new question:

1. How do you use the "Kill" function when scripting?
I've tried "triggerRef.kill" and "kill(triggerRef)" but neither works.

I also tried "triggerRef.ModActorValue("Health", -1)", but nothing happened.


EDIT: I found out how to use "Kill";

Actor BM_TriggeringActorEvent OnTriggerEnter(objectReference triggerRef)   BM_TriggeringActor = triggerRef as Actor   BM_TriggeringActor.Kill()endEvent

I was missing the "()" after ".Kill" (which is the killer, if any.)

2. Is there any way to remove the Actor variable and use the "triggerRef" function directly with kill?
I tried doing this: "triggerRef.Kill()", but it doesn't compile if I do that.



I think you want '2'.

I was just gonna ask if the was a hotkey summary anywhere, but of all the pages on the wiki with hotkey in, http://www.creationkit.com/Creation_Kit_Keyboard_Mapping was the first I clicked.

Thanks, that helps a lot. =)
User avatar
Sweet Blighty
 
Posts: 3423
Joined: Wed Jun 21, 2006 6:39 am

Post » Tue Jun 19, 2012 6:40 pm

You can do this:
(triggerRef as Actor).Kill()

Cipscis
User avatar
Alexander Horton
 
Posts: 3318
Joined: Thu Oct 11, 2007 9:19 pm

Post » Tue Jun 19, 2012 10:25 pm

Is there a limit on the number of items (quantity and number of individual items) an NPC merchant can have?

Example: I've given an NPC 100x every alchemy ingredient. (my skyrim wont load after making this NPC just trouble shooting)
User avatar
Harry Leon
 
Posts: 3381
Joined: Tue Jun 12, 2007 3:53 am

Post » Tue Jun 19, 2012 11:48 am

Question: I havea small mod which adds a few new spells, and scripts (its an esp with the main esm as the source). Unfortunately, I have called it a rather silly test name! Is there a nice and easy way for me to rename the file to something more suitable for a larger audience, that will not mess up the way the mod works?


Thanks!
User avatar
Kanaoka
 
Posts: 3416
Joined: Fri Jun 16, 2006 2:24 pm

Post » Tue Jun 19, 2012 9:10 pm

Simply rename the .esp file?
User avatar
hannah sillery
 
Posts: 3354
Joined: Sun Nov 26, 2006 3:13 pm

Post » Tue Jun 19, 2012 12:10 pm

Is there a way to place books into a bookshelf's inventory in the Creation Kit like weapons on a weapon rack? I want to show several books in the actual bookshelf and not scatter 50+ books all over the room while leaving the bookshelves empty. That's just silly.
User avatar
Juanita Hernandez
 
Posts: 3269
Joined: Sat Jan 06, 2007 10:36 am

Post » Tue Jun 19, 2012 7:27 am

Thanks for taking the time. Noob moder here.

I'm trying to make a Follower harvest flora on their own. So if you're wondering the world you don't have to constantly do it yourself.

Is this something I can achieve via the AI package or does it need to be scripted?
You can certainly do it with a normal NPC and AI Package

I've not tried with a follower - You will be able to add the package (an Item List will tell the NPC what to pick and what not to pick, and a radius how far to wander to pick it).

But I think you may well run into issues with other AI Packages followers have.

Try it. Worse case it's a nightmare, but you only have to delete the package if that's the case.

Watch this tutorial (not all of it). Just before the Scripting The Quest section he does a longish piece on a creature foraging for stuff (cheese, as it happens :wink:) - That should be most of what you want ... but should also show you where you will get problems with other follower functionality.

http://www.youtu.be/pLAJi-JDyXM?hd=1
User avatar
Rach B
 
Posts: 3419
Joined: Thu Mar 08, 2007 11:30 am

Post » Tue Jun 19, 2012 2:14 pm

Is there a way to place books into a bookshelf's inventory in the Creation Kit like weapons on a weapon rack? I want to show several books in the actual bookshelf and not scatter 50+ books all over the room while leaving the bookshelves empty. That's just silly.

http://www.creationkit.com/Tutorial_Bookshelves

There are also interior cells named Warehouse, which contain premade traps,mannequins, dummys and bookshelf etc, that you can copy and paste.




Im having a bit of a problem with lighting. My cells look fine for darkness and lighting set up in the CK, but when i go ingame, its as if the lights button "A" is turned on. Far too bright. Not quite sure why its doing it.
Sorted. Had to set Directional Ambient lighting.
User avatar
Red Sauce
 
Posts: 3431
Joined: Fri Aug 04, 2006 1:35 pm

Post » Tue Jun 19, 2012 3:18 pm

I have a quick question: Is it possible to cast a spell on anything other than an actor and have it apply the associated active magic effects? I assume so since the Spell.Cast function takes two Objectreference variables as its parameters, but am obliged to ask because the wiki page on ActiveMagicEffect seems to imply that they can only be attached to actor objects.
User avatar
Pixie
 
Posts: 3430
Joined: Sat Oct 07, 2006 4:50 am

Post » Tue Jun 19, 2012 7:07 am

How can I change the bulky stance of Lydia for a more feminine one in CK?

I have seen some mods pretending to do so but I want to achieve it myself and I'm struggleing to see where in CK I can change it.

EDIT: sigh at me... I think it was just the "Use opposite genre animation" checkbox.
User avatar
louise hamilton
 
Posts: 3412
Joined: Wed Jun 07, 2006 9:16 am

Post » Tue Jun 19, 2012 7:55 am

http://www.creationkit.com/Tutorial_Bookshelves

There are also interior cells named Warehouse, which contain premade traps,mannequins, dummys and bookshelf etc, that you can copy and paste.

I know how to make a bookshelf. My question is if you can add the books to the bookshelf inventory within the Creation Kit similar to already sticking a weapon on a rack so that the player doesn't have to.
User avatar
Becky Palmer
 
Posts: 3387
Joined: Wed Oct 04, 2006 4:43 am

Post » Tue Jun 19, 2012 10:26 pm

I know how to make a bookshelf. My question is if you can add the books to the bookshelf inventory within the Creation Kit similar to already sticking a weapon on a rack so that the player doesn't have to.

Ah, sorry. Will have a quick look and see, think ive seen something like this somewhere, either on wiki or in Ck
*think* being the keyword there, as i cant find anything. Tried adding a book to the bookshelfcontainer, you can loot it from the bookshelf, but it doesnt actually show up stacked, so thats not much use really.
User avatar
Taylah Illies
 
Posts: 3369
Joined: Fri Feb 09, 2007 7:13 am

Post » Tue Jun 19, 2012 5:08 pm

I have a quick question: Is it possible to cast a spell on anything other than an actor and have it apply the associated active magic effects? I assume so since the Spell.Cast function takes two Objectreference variables as its parameters, but am obliged to ask because the wiki page on ActiveMagicEffect seems to imply that they can only be attached to actor objects.
http://www.creationkit.com/ActiveMagicEffect_Script can only be applied to http://www.creationkit.com/Actor_Script, although casting spells on some other types of http://www.creationkit.com/ObjectReference_Script (I'm pretty sure it's those listed under "World Objects", although I've not tested this extensively) will cause the http://www.creationkit.com/OnMagicEffectApply_-_ObjectReference event to be called on them.

Cipscis
User avatar
Sunny Under
 
Posts: 3368
Joined: Wed Apr 11, 2007 5:31 pm

Post » Tue Jun 19, 2012 5:33 pm

Can't believe I hadn't noticed the OnMagicEffectApply event before. It simplifies my script logic quite a bit. Thanks for that.

That being said, there's 2 things missing from my mod until I can consider it releasable:
1. Is there a way to know when an ActiveMagicEffect ends without modifying the MagicEffect or extending its script? I have already managed to listen to the magic effects I want to watch for by adding a second Papyrus script to them, that basically forwards the events to my managing Quest. But if at all possible, I'd rather avoid modifying the original effects since that increases the likelihood of conflicts.

2. Is there any way to tell in script if a player is currently being seen? More precisely, when the status of the stealth indicator is fully "lit up"? I just need to know if the player is truly stealthed when committing an action. There are individual LOS checks, which I assume I could patch through local actors by applying an effect on them through a huge explosion or something... But that's unyieldy, and as far as I can tell, the LOS checks don't factor in "awareness", so Actors that have LOS but haven't spotted the player would still be counted as having seen him.
User avatar
Elisabete Gaspar
 
Posts: 3558
Joined: Thu Aug 31, 2006 1:15 pm

Post » Tue Jun 19, 2012 7:00 am

1. Is there a way to know when an ActiveMagicEffect ends without modifying the MagicEffect or extending its script? I have already managed to listen to the magic effects I want to watch for by adding a second Papyrus script to them, that basically forwards the events to my managing Quest. But if at all possible, I'd rather avoid modifying the original effects since that increases the likelihood of conflicts.
The only way I could think of would be continually polling http://www.creationkit.com/HasMagicEffect_-_Actor. Hopefully I'm missing something, and someone else can recommend a more efficient method.

2. Is there any way to tell in script if a player is currently being seen? More precisely, when the status of the stealth indicator is fully "lit up"? I just need to know if the player is truly stealthed when committing an action. There are individual LOS checks, which I assume I could patch through local actors by applying an effect on them through a huge explosion or something... But that's unyieldy, and as far as I can tell, the LOS checks don't factor in "awareness", so Actors that have LOS but haven't spotted the player would still be counted as having seen him.
I think the closest function currently available to what you want is http://www.creationkit.com/IsDetectedBy_-_Actor. Again, hopefully I've just missed something, but I couldn't find any other function that seemed related to what you want to do.

Cipscis
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Tue Jun 19, 2012 2:12 pm

I need help if possible,

I gave my npc for testing a "Patrol" AI package based off the tutorial found on wiki.
The package work fine if I put the npc outside, but if I put the npc in the house it doesnt leave the house to do the patrol. Instead it just stand there doing nothing.
I have no idea why he doesnt leave the house.

Everything is fully "teleported" and fully navmashed with finalization.

I added pic:
http://oi41.tinypic.com/2mhx4ye.jpg
http://oi41.tinypic.com/33vk8dx.jpg

Help please!!
User avatar
Kaley X
 
Posts: 3372
Joined: Wed Jul 05, 2006 5:46 pm

Post » Tue Jun 19, 2012 6:21 am

How do I add a spell to the player without it saying "Spell added" in the corner? This is a scripting question.

Cheers!
User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am

Post » Tue Jun 19, 2012 9:07 am

How do I add a spell to the player without it saying "Spell added" in the corner? This is a scripting question.

Game.GetPlayer().AddSpell(mySpell, false)


http://www.creationkit.com/AddSpell_-_Actor
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Tue Jun 19, 2012 1:46 pm

Q: How do I apply a shader effect to the player using a papyrus fragment?
User avatar
IM NOT EASY
 
Posts: 3419
Joined: Mon Aug 13, 2007 10:48 pm

Post » Tue Jun 19, 2012 1:47 pm

Q: How do I apply a shader effect to the player using a papyrus fragment?

EffectShader Property myShader Auto myShader.Play(Game.GetPlayer())
where you assign certain shader effect in papyrus fragment's properties to myShader property...


http://www.creationkit.com/Play_-_EffectShader
User avatar
JD FROM HELL
 
Posts: 3473
Joined: Thu Aug 24, 2006 1:54 am

Post » Tue Jun 19, 2012 6:19 pm

a quick question from a scripting newbie here. trying to make a script to create a dragon.

essentialy i'm trying to make some script to when activated use the console command "player.placeatme"

for those interested in the code idea so far (and the failed attempt)
Spoiler

Scriptname custDragonSummon extends ObjectReference  {a dragon summon test}Actor BM_TriggeringActorEvent OnTriggerEnter(objectReference triggerRef)  	if BM_TriggeringActor == actor.player()				BM_TriggeringActor = triggerRef as Actor		BM_TriggeringActor.placeatme(457FC)				endif	endEvent

Additional, compiler error read out
Spoiler

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\custDragonSummon.psc(8,32): player is not a function or does not exist
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\custDragonSummon.psc(8,32): cannot call the member function player alone or on a type, must call it on a variable
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\custDragonSummon.psc(11,21): type mismatch on parameter 1 (did you forget a cast?)
No output generated for custDragonSummon, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on custDragonSummon

User avatar
Anthony Diaz
 
Posts: 3474
Joined: Thu Aug 09, 2007 11:24 pm

Post » Tue Jun 19, 2012 9:44 am

For failed scripts, it is better to also post the error the compiler produces, so we know exactly what is not working.
User avatar
Stace
 
Posts: 3455
Joined: Sun Jun 18, 2006 2:52 pm

Post » Tue Jun 19, 2012 7:32 pm

I've been trying to rebalance the NPCs in the game level wise. I've been editing the levels under the actor category, but here is my dilemna, I just saw that encounter zones have minimum levels and max levels. Do the encounter zones merely control what level the player needs to be for the encounter to happen (ala high level players will only encounter high level monsters) or do the zones actually control creature levels? I'm confused about all this and the actual information on the CK wiki is a bit misleading.
User avatar
Janeth Valenzuela Castelo
 
Posts: 3411
Joined: Wed Jun 21, 2006 3:03 am

Post » Tue Jun 19, 2012 6:39 am

Sorry about the lack of script compiler Error. here is a revision of the code with the last few hours progress after research

Spoiler
Scriptname custDragonSummon extends ObjectReference  {a dragon summon test}Actor BM_TriggeringActorEvent OnTriggerEnter(objectReference triggerRef)  	if BM_TriggeringActor == game.GetPlayer()		BM_TriggeringActor = triggerRef as Actor	BM_TriggeringActor.placeatme()				endif	endEvent

along with the compiler Error

Spoiler

Starting 1 compile threads for 1 files...
Compiling "custDragonSummon"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\custDragonSummon.psc(11,20): argument akformtoplace is not specified and has no default value
No output generated for custDragonSummon, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on custDragonSummon


so if i'm reading the compiler right the error occurs when it reaches ".placeatme()" but if i put in the item code to fufill the "akFormToPlace" requirement it then tells me "extraneous input 'FC' expecting RPAREN"

i'v tried several varius combinations. at the moment i'm working with the code "457FC" which is GenericWoodElf. just for testing purposes, so i dont go spawning dragons everywhere XD

i'm almost sure this is a case of simply not using the correct command, but i'm not sure what the command to use would be, and cant navigate the wiki well enough to find said command.
User avatar
Stacy Hope
 
Posts: 3391
Joined: Thu Jun 22, 2006 6:23 am

PreviousNext

Return to V - Skyrim