Script Question on Container and angle

Post » Sat Nov 17, 2012 6:40 am

I have a container ZZBurntCorpse01 and I want to position it the same angle as the Victim fell.

I can do


Float Ang1 =Victim.GetAngleZ()

Victim.AttachAshPile(ZZBurntCorpse01) ;ZZBurntCorpse01 is a container

and I know how to

ZZBurntCorpse01.SetAngle(0.0,0.0,Ang1) ; Wont work because its not an objectreference

But one looks for the object reference while the other the container
User avatar
Robert Devlin
 
Posts: 3521
Joined: Mon Jul 23, 2007 2:19 pm

Post » Sat Nov 17, 2012 5:42 am

I'm a little bit confused about what you are asking.

SetAngle works with ObjectReference, and I would imagine that your chest is an ObjectReference? So it should just work ...


Unless you have made the chest a ReferenceAlias .... by adding & filling an Alias in your quest with it? If you have done that then you can convert your ReferenceAlias to an ObjectReference using http://www.creationkit.com/GetReference_-_ReferenceAlias ...

ObjectReference ZZBurntBad = ZZBurntBad_Alias.GetReference()

Then use your SetAngle command on ZZBurntBad
User avatar
Eve(G)
 
Posts: 3546
Joined: Tue Oct 23, 2007 11:45 am

Post » Sat Nov 17, 2012 7:07 am

Ha!...
Actor rClone = BagOfHoldingACHR.AttachAshPile(PlayerREF.GetActorBase())
...makes a player clone that talks smack.

Hey, trollbait!. Hey, cheesbrain! Skeever butt!. Hey, ugly! Hey, mellon nose!
User avatar
Stephanie Valentine
 
Posts: 3281
Joined: Wed Jun 28, 2006 2:09 pm

Post » Fri Nov 16, 2012 5:11 pm

I first want to thank all for answers...

Float Ang1 =Victim.GetAngleZ()
Victim.AttachAshPile(ZZBurntCorpse01)

Creates a Burnt Corpse container on the ground that has what the actor(Victim) had in it.

But does not always line up with the angle of the actor that dies...

I want to match the container Burnt body to the same angle as the actor (victim) that died.

I know that .SetAngle(0.0,0.0,Ang1) will set the angle but it wont work with the container ZZBurntCorpse01 unless I can reference the container as an object which is what I am asking how to do.
User avatar
roxxii lenaghan
 
Posts: 3388
Joined: Wed Jul 05, 2006 11:53 am

Post » Fri Nov 16, 2012 8:24 pm

I know that .SetAngle(0.0,0.0,Ang1) will set the angle but it wont work with the container ZZBurntCorpse01 unless I can reference the container as an object which is what I am asking how to do.
Object, or ObjectReference?

ObjectReference ZZBurntBad = ZZBurntBad_Alias.GetReference()
The above will get you the ObjectReference of an alias (assuming the "chest" is an alias) ... I would be surprised if that won't then allow you to do SetAngle.

If it won't and you need the BaseObject, then convert the ObjectReference (above) to it's BaseObject, using this ...

http://www.creationkit.com/GetBaseObject_-_ObjectReference

:smile:
User avatar
Ben sutton
 
Posts: 3427
Joined: Sun Jun 10, 2007 4:01 am

Post » Sat Nov 17, 2012 4:32 am

i'm not sure AttachAshPile() is the appropriate function you want to use. because basically all an "ashpile" does is act as a parent activator for the actor. so dropping a container as an ash pile will not open that container, it will open the actor's inventory

you're better off using Placeatme(), which will automatically match the actor's angle by default. placeatme will also return an ObjectReference value you can then manipulate further if needed. just remember to call delete() after you're done with it or else it will stay in the world forever.
User avatar
Nick Tyler
 
Posts: 3437
Joined: Thu Aug 30, 2007 8:57 am

Post » Sat Nov 17, 2012 7:27 am

So would I use AttachAshPile() to the container I have placed with placeatme? How would I get the container to reveal the actor who I made disappear to reveal his or her contents ?


See I shoot the actor and they burn... if they die while this is happening I turn them in to a burnt body... This all works.... But I want the Burnt body to align with the actor who died.

What your saying is good... but then how do I get the container to attach to the actor ? Could I use something to transfer the actors inventory or attach it to the container after the container

is placed in the spot ?
User avatar
lillian luna
 
Posts: 3432
Joined: Thu Aug 31, 2006 9:43 pm

Post » Fri Nov 16, 2012 10:34 pm

ObjectReference CorpseRef = Victim.PlaceAtMe(ZZBurntCorpse01)Victim.RemoveAllItems(CorpseRef)
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Post » Sat Nov 17, 2012 7:35 am

:) Again I am left in awe and feel stupid at the same time LOL
User avatar
Nicole Elocin
 
Posts: 3390
Joined: Sun Apr 15, 2007 9:12 am

Post » Sat Nov 17, 2012 5:09 am

oh yeah, and make sure you set the container to delete itself after a certain amount of time or OnCellDetach. otherwise it will stay in the game forever
User avatar
teeny
 
Posts: 3423
Joined: Sun Feb 25, 2007 1:51 am


Return to V - Skyrim