Make an MiscItem that tracks coordinates.

Post » Tue Oct 02, 2012 6:42 am

Hello,
I have created a spell that will place an item to the player. I made it this way (and not using additem) in order to give the item a reference.
The item is placed properly and it gives me the coordinates at the current point.
The following spell script works just fine:

ScriptName NPCSummonLocationItemSpellScriptref LocationObjectfloat PosXfloat PosYfloat PosZfloat PlayerPosXfloat PlayerPosYfloat PlayerPosZfloat ObjectOnAirBegin ScriptEffectStartset PlayerPosZ to Player.GetPos Z;Setting a reference to a placed object.set LocationObject to Player.placeatme NPCDecorationLocationTrigger 1,20,0;These line will make the item appear always over ground.set PlayerPosZ to Player.GetPos Zset ObjectOnAir to (PlayerPosZ + 50)LocationObject.SetPos Z ObjectOnAir;These line will get the item current position using the reference i got.set PosX to LocationObject.GetPos Xset PosY to LocationObject.GetPos Yset PosZ to LocationObject.GetPos Z;Message for trackingPrintToConsole "GameModeObject: %0.f, %0.f, %0.f" PosX PosY PosZend


But I want to get the coordinates to other points too
and I want this item to produce the coordinates at (game mode) or when it (moved or dropped).
Thats why i created the following script:



ScriptName NPCDecorationLocationScriptref Objectref LocationObjectfloat ObjectLocationPosXfloat ObjectLocationPosYfloat ObjectLocationPosZBegin GameModeSet ObjectLocationPosX to LocationObject.GetPos XSet ObjectLocationPosY to LocationObject.GetPos YSet ObjectLocationPosZ to LocationObject.GetPos ZPrintToConsole "Coordinations: %0.f, %0.f, %0.f" ObjectLocationPosX ObjectLocationPosY ObjectLocationPosZEnd

but it gives me always 0,0,0 even if the object is staying at the same position as it fell and produced the coordinates.
It doesnt work properly.

What i have done wrong to the second script?
How it can be done?
User avatar
Soraya Davy
 
Posts: 3377
Joined: Sat Aug 05, 2006 10:53 pm

Return to IV - Oblivion