Jump to content

Moving Player Twice


Recommended Posts

This should be a very simple script. I move an Xmarker to a location, move a return marker to Player's location, then move player to the first Xmarker.

 

That works fine, and so does the return script.

 

However, when I try executing a second time, a load screen comes up as though the player is moving, but the player does not move.

 

I have tried experimenting with several variations, like setting player X, Y, and Z positions instead of using the MoveTo command, but the results are exactly the same. I have also tried sending the Xmarker to a holding cell first, then bringing it back.

 

I can get it to work a second time in a row, sometimes, after a fast travel, but not always. The distance does not seem to matter, but the second try seems more likely to work after a longer fast travel.

 

The movement is part of a spell script. I have also experimented with different variations of EffectStart and EffectFinish.

 

There has got to be some reason for the way it is behaving, but I can't make any sense out of it. It just seems random to me.

 

The return script has NEVER failed. What could possibly be going on with the first move?

 

I am changing the player's angle to face a certain direction, and that Always works, but not the move. WTF?

Link to comment
Share on other sites

Thank you. I have figured some more things out about the situation. The script does not matter; I can duplicate the problem in other scripts.

 

I have discovered the following:

Xmarkers will not stay in mid air; they fall until they hit something. This was giving the appearance of my player not moving.

World art can be updated by the Disable/GetPos/SetPos/Enable Routine. This works better as Disable/Enable/GetPos/SetPos.

However, even though the world art is updated, the object physics are not always updated.

 

I have been experimenting and getting some crazy results, again, seemingly random; sometimes one thing happens; sometimes another.

 

Move an object to Player + 10000

object.Disable

object.MoveTo Player 0,0,10000

object.Enable

 

set x to object.GetPos x

set y to object.GetPos y

set z to object.GetPos z

 

object.SetPos x x

object.SetPos y y

object.SetPos z z

 

Now move the Xmarker

Xmarker.Disable

Xmarker.MoveTo Object

Xmarker.Enable

 

Now try to move the player

Player.MoveTo Xmarker

 

Sometimes it works; like the first time I pull the object from it's holding cell. After that, the Xmarker is falling through the object and landing back on top of the player; the Player.MoveTo Xmarker therefore appears to do nothing.

 

Sometimes the physics update after fast travel; sometimes not.

 

Move the object for the first time; move the player; save the game; reload the game; try to move the object a 2nd time does NOT produce any more reliable results. The Xmarker still lands on top of the player.

Link to comment
Share on other sites

Why are you moving the object first, then using an xmarker to be moved to where the object is?

 

What object is being moved, and why is it being positioned so high above the player?

 

xmarkers do not have physics and do not move, I believe you are mistaken in your impression that the xmarker is falling because of some physics, and are missing some other component related to where the xmarker is being placed.

 

Can you explain exactly what you are trying to accomplish here? And the full script with an indication about what it is being attached to?

Link to comment
Share on other sites

I'm trying to levitate a boat.

 

Guaranteed that the Xmarker is falling. By accident I stepped under an arch on the waterfront. Standing under the arch and casting the spell moves me to the top of the wall. Move away from the arch where nothing is overhead, and the player does not move, but the angle changes and the loading screen flashes.

 

tcl inside the big lighthouse on the waterfront, tcl to turn collision back on again, cast the spell, and the player is moved to the top of the tower. Maybe the Xmarker itself does not fall, but the player is placed at the lowest point under the Xmarker. The effect is the same.

 

I remember something like this in the Anvil Bay Expansion Mod. When buying the ship the developer had to resort to instructing players to walk to the edge of the dock, save, and then reload. Only then could they walk onto the ship, otherwise they would fall through the deck.

 

I tried moving a collision box under the Xmarker, and that sort of worked, but none of the objects, like the wheel, had any physics so that did not do any good. When moving objects within the same cell, the world art can be updated, but I'm guessing the physics cannot be.

 

I did found a workaround, not great, but it works. A second script moves the boat to another cell. Save. Reload. Then cast the spell again and the physics are updated when the object is moved.

 

Thank you for trying to help.

Link to comment
Share on other sites

Ok... The second issue is being caused by the first. The boat has no physics when it is being brought in, so when the player is being moved to the marker, they are simply being dropped down to the ground.

 

You seem to misunderstand how to disable and enable statics when moving them. You must disable boat, move the boat to the player, move the boat 1000 units above the player, perform some other minor action, such as moving the marker to where the boat is (boat is there, just is not being seen, and as explained, the marker will remain in position) THEN enable the boat. This is because it takes a few miliseconds for the disabling and enabling to take full effect. If you simply disable, move to the spot, and enable, only the visual aspect will be registered properly, but if you have a few other functions between the movement and the enabling (thus creating a momentary pause for those miliseconds), the object will be fully disabled, and enabled in the same location.

 

For example

beginscripteffectstart
object.Disable
object.MoveTo Player 0,0,10000

set x to object.GetPos x
set y to object.GetPos y
set z to object.GetPos z
object.SetPos x x
object.SetPos y y
object.SetPos z z
Xmarker.MoveTo Object
object.Enable

Player.MoveTo Xmarker
end

 

You do not need to disable/enable xmarkers since they have no visual or physical component to be enabled or disabled. This is also why you seemed to have inconsistent results, in some cases either you were re-enabling the object before it was moved to the location, or were using scripting that had slightly different timings between the disable and enable.

 

Disabled objects do not get removed from the world, they are simply not checked for the purposes of AI, rendering, and havok. The position of a disabled object will be the same as an enabled object until some other force acts upon it as soon as it is enabled.

 

This is also why the assumption that the xmarker was falling was a mistake. The two are not the same, in one case it is believing that the marker is changing position, in the other it is believing that the player is instead simply being moved to the first solid surface below said marker.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...