PlaceAtMe problem

Post » Fri Nov 30, 2012 11:15 am

hi all, this is my first post here..so im not sure that is the right section..
*AND* im italian, so im sorry for my bad english. :)

ive a big and strange problem..i want to place a fireplace on a item (firewood01) when i drop it to the ground-when i click on it with torch in my hand-.
all works, but at the "placeatme" script, the new object "fly" over the ground.. the z axis is not at 0..some help?
tnx in advance.
ae
User avatar
Charlie Sarson
 
Posts: 3445
Joined: Thu May 17, 2007 12:38 pm

Post » Fri Nov 30, 2012 4:27 am

some to add..:this is all on papyrus scripts..not some in-game trick.
User avatar
Sarah MacLeod
 
Posts: 3422
Joined: Tue Nov 07, 2006 1:39 am

Post » Fri Nov 30, 2012 1:44 am

Please post your script code.
User avatar
Ruben Bernal
 
Posts: 3364
Joined: Sun Nov 18, 2007 5:58 pm

Post » Thu Nov 29, 2012 9:17 pm

uhh chesko!(i love ur frostfall mod :biggrin:)
is the same thing that u do with your campfire..but this is really simple, inside "FIREWOOD01":

Scriptname AE_legnaAction extends ObjectReferenceimport utilityMessage property ae_legnaMessage autoobjectreference  Property AE_fuocoSemplice  AutoObjectReference Property faloSpento  AutoObjectReference Property faloMedio  AutoObjectReference Property luce  AutoObjectReference Property luceFuoco Auto HiddenObjectReference Property legna  Auto HiddenObjectReference Property fuoco Auto HiddenObjectReference Property fuocomedio Auto HiddenObjectReference Property fuocospento Auto Hiddenevent oninit()BlockActivation()endeventEvent OnContainerChanged(ObjectReference NewContainer, ObjectReference OldContainer)If oldContainer == game.getplayer()  self.BlockActivation()endifendeventevent onActivate(objectreference akActivator)if(akActivator == game.getplayer())  if (game.getplayer().GetEquippedItemType(0) == 11);ha la torcia(11)   messaggio()    else   raccogli()  endifendifendeventfunction messaggio()Int iButton = ae_legnaMessage.show()if(iButton == 0)  raccogli()elseif(iButton == 1)  accendi()else  ;nienteendifendfunctionfunction raccogli();debug.Notification("prendo la legna..")BlockActivation(false)game.getplayer().additem(self)endfunctionfunction accendi()fuoco = self.placeatme(AE_fuocoSemplice.GetBaseObject(),abInitiallyDisabled = true)fuoco.setangle(0 , 0,  0); fuoco.setposition(GetPositionX(),GetPositionY(),(GetPositionZ()-(game.getplayer().getheight()/2)))fuoco.setposition(GetPositionX(),GetPositionY(),game.getplayer().GetPositionZ())fuoco.enable(true)lucefuoco = fuoco.placeatme(luce.getbaseobject());debug.Notification("ref: "+fuoco)delete();inizia il countdown per spegnersi;Debug.Notification("Starting countdown")RegisterForUpdateGameTime(0.10)endfunctionInt step = 0Event OnUpdateGameTime()step +=1;Debug.Notification("countdown: "+step)if (step == 4)  fuocomedio = fuoco.placeatme(faloMedio.GetBaseObject())  lucefuoco.moveto(lucefuoco,afZOffset = 0)  utility.wait(1)  fuoco.disable(true)  utility.wait(1.5)  fuoco.delete()elseif (step == 8)  fuocospento = fuocomedio.placeatme(faloSpento.GetBaseObject())  lucefuoco.moveto(lucefuoco,afZOffset = -5)  utility.wait(1)  fuocomedio.disable(true)  utility.wait(1.5)  fuocomedio.delete()elseif(step == 12)  fuocospento.disable(true)  lucefuoco.delete()  utility.wait(1.5)  fuocospento.delete()  step = 0  UnregisterForUpdateGameTime()endifEndEvent
User avatar
MarilĂș
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Fri Nov 30, 2012 10:16 am

uhm this is the line of my trouble:
fuoco = self.placeatme(AE_fuocoSemplice.GetBaseObject(),abInitiallyDisabled = true)fuoco.setangle(0 , 0,  0); fuoco.setposition(GetPositionX(),GetPositionY(),(GetPositionZ()-(game.getplayer().getheight()/2)))fuoco.setposition(GetPositionX(),GetPositionY(),game.getplayer().GetPositionZ())fuoco.enable(true)

i use the game.getplayer().GetPositionZ() because the z of my firewood is the same when i drop it(at my face!)
AND if i drag and drop my firewood in another spot, the x-y-z position of my firewood remain the old....:S
getpositionx-y-z is not updated..
User avatar
Deon Knight
 
Posts: 3363
Joined: Thu Sep 13, 2007 1:44 am


Return to V - Skyrim