Papyrus Debug.CenterOnCell() command bug

Post » Tue Jun 19, 2012 5:06 am

I think that I found a bug in Debug.CenterOnCell() command, and I need somebody to confirm it.

I tried to create spell which will teleport player to target cell. When using this spell in game, game and Windows hangs - only possible solution is to do hard reset.

Scriptname TOWBook extends ActiveMagicEffectCell Property Backup autoCell Property BookTarget autoEvent OnEffectStart(Actor Caster, Actor Target)Debug.Notification("Started")if(Game.GetPlayer().GetParentCell() != BookTarget)  Debug.Notification("Inside")  Backup = Game.GetPlayer().GetParentCell()  Debug.CenterOnCell("EmbershardMine01")else  Debug.Notification("You already at home!")endIfDebug.Notification("Finished")EndEvent

or


Scriptname TutDungeonSword extends ObjectReferenceEvent OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)if (newContainer == Game.GetPlayer())  Debug.CenterOnCell("EmbershardMine01")endifEndEvent
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Tue Jun 19, 2012 10:12 am

I'm not sure what the issue with that command is, but it is a debug command. They are not meant to be used in production scripts. What you'll want to do is find or add an xmarker or other type of marker in the cell you want to go to, set an objectreference property pointing to it, and then use Game.GetPlayer().MoveTo(MarkerProperty)
User avatar
Sarah Edmunds
 
Posts: 3461
Joined: Sat Jul 08, 2006 8:03 pm

Post » Mon Jun 18, 2012 9:54 pm

Like said, you shouldn't use debug commands in release mods (excluding messagebox and notification, they're alright). Also, the reason your hanging is because the game is trying to apply the coc command over and over and over. You need to put some sort of condition in there.
User avatar
KiiSsez jdgaf Benzler
 
Posts: 3546
Joined: Fri Mar 16, 2007 7:10 am

Post » Tue Jun 19, 2012 4:41 am

Ok. Thanks, I'll try.

Edit:
Works now, thanks again.

PS. With coc I had there a condition (before I started testing other cells).

Scriptname TOWBook extends ActiveMagicEffectCell Property Backup autoCell Property BookTarget auto ; == storyhouseEvent OnEffectStart(Actor Caster, Actor Target)Debug.Notification("Started")if(Game.GetPlayer().GetParentCell() != BookTarget)  Debug.Notification("Inside")  Backup = Game.GetPlayer().GetParentCell()  Debug.CenterOnCell("storyhouse")else  Debug.Notification("You already at home!")endIfDebug.Notification("Finished")EndEvent

Game.GetPlayer().GetParentCell() != BookTarget - so when player get into cell this script should stop (or I should do something else - wiki doesn't say much about it http://www.creationkit.com/CenterOnCell_-_Debug)
User avatar
Adam
 
Posts: 3446
Joined: Sat Jun 02, 2007 2:56 pm


Return to V - Skyrim