Quick Questions, Quick Answers Thread #6

Post » Sun Nov 18, 2012 5:55 pm

whatever happened to "removealltypeditems", and/or how can i substitute for this?

Pass a FormList into the akItemToRemove parameter for the RemoveItem function. The function will then check for and remove every item in the FormList it finds on the target.
User avatar
xx_Jess_xx
 
Posts: 3371
Joined: Thu Nov 30, 2006 12:01 pm

Post » Sun Nov 18, 2012 3:11 pm

I have an issue that's probably pretty simple and i'm just overlooking it. I copied a draugr ambush setup from the warehouseAmbushes, and it was wokring great. However, after the tutorial on rooms and portals, this has ceased to work. I've tried a few things (like repositioning, and bringing in a whole new one) but nothing seems to work. Any help would be greatly appreciated!

Edit: I just realized that I didn't even say what the issue was lol. When I walk into the room with the ambush, the coffin and/or lid are just gone. I can see the draugr lying there and the animation take place when I step over the trigger, but I can't get the coiffin and lid to show up.
Turn on roombounds and make sure the blue roombound completely covers the bounding box (the coloured box you see when the object is selected) of the coffin/coffin lid.
This usually fixes things
User avatar
Dan Scott
 
Posts: 3373
Joined: Sun Nov 11, 2007 3:45 am

Post » Sun Nov 18, 2012 10:43 am

While that would work great for one dog... that's not what I'm doing. I have an ActiveMagicEffect that runs on all dogs. When the player is detected by that dog and is sneaking, the dog should bark and create a detection event.
Well... have you looked at WICommentSneaking quest in the CK? You could add the dog's voice type to the list, and in the Papyrus fragments create the detection event. If you don't want to edit the vanilla form, you can just reproduce the whole quest but do it only for dogs... If I'm understanding correctly, you could forego the use of a magic effect on dogs entirely. There are some nice options in there like probability of "commenting" on your sneak status, etc.
User avatar
Jonathan Windmon
 
Posts: 3410
Joined: Wed Oct 10, 2007 12:23 pm

Post » Sun Nov 18, 2012 11:12 pm

(battlemagerecall1 As battlemagerecallscript).storedSpell() = akSpell

on an ActiveMagicEffect script. battlemagerecall1 is a MagicEffect property, and battlemagerecallscript is the script that's attached to that magic effect. storedSpell is a property of battlemagerecallscript.

If it's a property, it shouldn't have parentheses after it.
User avatar
Beast Attire
 
Posts: 3456
Joined: Tue Oct 09, 2007 5:33 am

Post » Sun Nov 18, 2012 6:01 pm

If it's a property, it shouldn't have parentheses after it.

Now it's telling me that I can't cast a magic effect to a battlemagerecallscript. Do I still need to declare the script as a property independent of the property for the object it's attached to?
User avatar
Annika Marziniak
 
Posts: 3416
Joined: Wed Apr 18, 2007 6:22 am

Post » Sun Nov 18, 2012 6:17 pm

While that would work great for one dog... that's not what I'm doing. I have an ActiveMagicEffect that runs on all dogs. When the player is detected by that dog and is sneaking, the dog should bark and create a detection event.

So create the topic and info, make sure it uses all the dog voices, and select the sound file. Then add it as a property to the active magic effect script and use "say". Should still work.

Don't dogs do that anyway if you set an aggro radius? It might be easier to just set a combat alarm on the dog.

Now it's telling me that I can't cast a magic effect to a battlemagerecallscript. Do I still need to declare the script as a property independent of the property for the object it's attached to?

You might need to use the ActiveMagicEffect rather than the MagicEffect. It's like the difference between base objects and object references.
User avatar
Vincent Joe
 
Posts: 3370
Joined: Wed Sep 26, 2007 1:13 pm

Post » Sun Nov 18, 2012 2:25 pm

So create the topic and info, make sure it uses all the dog voices, and select the sound file. Then add it as a property to the active magic effect script and use "say". Should still work.

Don't dogs do that anyway if you set an aggro radius? It might be easier to just set a combat alarm on the dog.
I just realized that instead of piggybacking on the WICommentSneaking quest, that he can just use OnAnimationEvent(), provided that these events work:

Line 50:	 idleDogBarkStartLine 82:	 idleDogSitBarkStartLine 83:	 idleDogLayBarkStartLine 102:	 idleBarkRun

Not sure if the last one is necessary. So, provided these actually fire, after using RegisterForAnimationEvent on all 3 or 4 events in the OnEffectStart block, just run:

Event OnAnimationEvent(ObjectReference akSource, string asEventName)  if (asEventName == "idleDogBarkStart" || asEventName == "idleDogSitBarkStart" || asEventName == "idleDogLayBarkStart" )	Debug.Trace("Dog Barked")	; Do your stuff here  endIfendEvent
User avatar
Brooks Hardison
 
Posts: 3410
Joined: Fri Sep 07, 2007 3:14 am

Post » Sun Nov 18, 2012 12:20 pm

I have a quick question, but I posted it in a different thread before I noticed this one. It can be found http://www.gamesas.com/topic/1407140-custom-voices-wont-work/
but feel free to awnser it in this topic. I just need the awnser and I'm not really all to interested in where it's posted ;)
User avatar
Noraima Vega
 
Posts: 3467
Joined: Wed Jun 06, 2007 7:28 am

Post » Mon Nov 19, 2012 12:05 am

You might need to use the ActiveMagicEffect rather than the MagicEffect. It's like the difference between base objects and object references.

Sooo... how would I do that XD

Cast the magic effect to active magic effect? The ActiveMagicEffect doesn't exist until the spell is cast, and it's the MagicEffect that has the script attached to it, not its more Active cousin.
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Post » Sun Nov 18, 2012 7:17 pm

Recently I downloaded a Nightingale Texture Replacer & Since the gloves do not cover the fingers I cropped a piece of the Armour texture. I saved the image as dds & tried to put it into a texture set in the CK. But it will not allow me to add it to the texture sets so I can replace skin texture with the new texture. Is there any reason why trying to add a texture set on a new dds image won't work?
User avatar
Lil Miss
 
Posts: 3373
Joined: Thu Nov 23, 2006 12:57 pm

Post » Mon Nov 19, 2012 1:31 am

How would you script to check the item counts on multiple items inside a chest?
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Sun Nov 18, 2012 11:57 pm

Sooo... how would I do that XD

Cast the magic effect to active magic effect? The ActiveMagicEffect doesn't exist until the spell is cast, and it's the MagicEffect that has the script attached to it, not its more Active cousin.

And yet, magic effect scipts attached to actors get the same events the actors receive. I think it's like attaching a script to an actor and then dragging them into the render window. The object reference gets the script as well.

But yeah, getting the active effect reference is a pain. The easiest way is to do it from the activem magic effect script. Next easiest is to give the effect a property pointing to a quest. Then you can call a quest function and pass self as a parameter.

I don't know if there is a third way, offhand
User avatar
Damien Mulvenna
 
Posts: 3498
Joined: Wed Jun 27, 2007 3:33 pm

Post » Sun Nov 18, 2012 9:45 pm

How would you script to check the item counts on multiple items inside a chest?
If counting members total of a list of items:
Int iCount = SomeContainerREF.GetItemCount(FormListWithTheItems)
User avatar
Zach Hunter
 
Posts: 3444
Joined: Wed Aug 08, 2007 3:26 pm

Post » Sun Nov 18, 2012 7:32 pm

If counting members total of a list of items:
Int iCount = SomeContainerREF.GetItemCount(FormListWithTheItems)

Cheers mate I'll try that :)
User avatar
Zosia Cetnar
 
Posts: 3476
Joined: Thu Aug 03, 2006 6:35 am

Post » Sun Nov 18, 2012 12:48 pm

Is there a way to change an object's type? For example, changing an object of type ReferenceAlias to Actor.
User avatar
Brad Johnson
 
Posts: 3361
Joined: Thu May 24, 2007 7:19 pm

Post » Sun Nov 18, 2012 10:18 am

Actor a = myRefAlias.GetActorReference()

There's also a GetRef version that returns an object reference.

If there's an inheritance relationship you can generally cast one object as another, although you'll need a separate cast for each level in the heirarchy.
User avatar
Dawn Porter
 
Posts: 3449
Joined: Sun Jun 18, 2006 11:17 am

Post » Mon Nov 19, 2012 12:07 am

Thanks Doc, I read the wiki page on casting but I couldnt get my head around it for some reason.
User avatar
Scotties Hottie
 
Posts: 3406
Joined: Thu Jun 08, 2006 1:40 am

Post » Mon Nov 19, 2012 12:04 am

Pass a FormList into the akItemToRemove parameter for the RemoveItem function. The function will then check for and remove every item in the FormList it finds on the target.
thanks, found an alternative solution in this case meanwhile, but good to know - would that work with nested form lists too?
hm... it's still not quite the same though. if i wanted to remove, say, all misc-items, i could just catch vanilla items with a form list like this, none from mods (others than mine i mean), or do i get something wrong here?
User avatar
Silvia Gil
 
Posts: 3433
Joined: Mon Nov 20, 2006 9:31 pm

Post » Sun Nov 18, 2012 10:42 am

Can a formlist hold references (not base objects) if they're added with a script?
User avatar
Arrogant SId
 
Posts: 3366
Joined: Sat May 19, 2007 11:39 am

Post » Sun Nov 18, 2012 4:43 pm

Is there any easy way I could rig a Lute to be used kind of like a staff... I want to make an electric shooting lute. I know nothing about editing meshes/animations but I am willing to learn if a suitable tutorial could be pointed to.
User avatar
Darlene DIllow
 
Posts: 3403
Joined: Fri Oct 26, 2007 5:34 am

Post » Sun Nov 18, 2012 11:20 am

Can a formlist hold references (not base objects) if they're added with a script?

I don't believe FormLists can hold ObjectReferences, only Forms. You'd want to use an array.
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Sun Nov 18, 2012 11:11 pm

Is there any easy way I could rig a Lute to be used kind of like a staff... I want to make an electric shooting lute. I know nothing about editing meshes/animations but I am willing to learn if a suitable tutorial could be pointed to.

Someone quite recently released a mod called Bard's Lute, which allows you to wield a lute. Take a look there. I dunno much about making staves, but I imagine that once you had the lute rigged as a weapon you could duplicate an existing lightning staff and replace the model with the lute model.

As a price for this information, I demand that sweet licks from Tenacious D's Wonderboy be used as the combat sounds.
User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Sun Nov 18, 2012 7:37 pm

Recently I downloaded a Nightingale Texture Replacer & Since the gloves do not cover the fingers I cropped a piece of the Armour texture. I saved the image as dds & tried to put it into a texture set in the CK. But it will not allow me to add it to the texture sets so I can replace skin texture with the new texture. Is there any reason why trying to add a texture set on a new dds image won't work?

If you cropped it maybe the size of the image (as in, pixel area) isn't correct? Or maybe you didn't save mipmaps, whatever those are.
User avatar
biiibi
 
Posts: 3384
Joined: Sun Apr 08, 2007 4:39 am

Post » Sun Nov 18, 2012 10:22 pm

Someone quite recently released a mod called Bard's Lute, which allows you to wield a lute. Take a look there. I dunno much about making staves, but I imagine that once you had the lute rigged as a weapon you could duplicate an existing lightning staff and replace the model with the lute model.

As a price for this information, I demand that sweet licks from Tenacious D's Wonderboy be used as the combat sounds.

Price denied!

Unfortunately the game handles the rigging of the two different weapon types differently, so the staff is treated in a completely different manner. So while he has made it a weapon, it won't work as a staff... though I will download it, then maybe I will make a custom model of my guitar :wink:

https://p.twimg.com/AsBCDMQCAAA3LBk.jpg:large

Who doesnt want to club a skeleton with a 58' style explorer
User avatar
Enie van Bied
 
Posts: 3350
Joined: Sun Apr 22, 2007 11:47 pm

Post » Sun Nov 18, 2012 4:32 pm

Can a formlist hold references (not base objects) if they're added with a script?
Yes, they can. FormLists can bear any form, even other FormLists.
User avatar
Sasha Brown
 
Posts: 3426
Joined: Sat Jan 20, 2007 4:46 pm

PreviousNext

Return to V - Skyrim