Simply, creating static object with code and moving it

Post » Tue Jun 19, 2012 4:44 pm

Hi! Iam C++ coder and i just started playing with Papyrus, and overall Creation Kit. I have a simple question for you guys!

I want to create portable tent (yeah there are many camping mods but i want to do it for training) but i cant figure out how to create new object by code, and then moving it or do other stuff with it. I Figured out how to create objects like skulls, ores and stuff, but i cant figure out how to do it with static object like ImperialTentSmall. I tried creating a tent as ObjectReference in one of the Cells and then moving it to the player but i doesn't work lol, and its not what i want to do.

My code was:
Scriptname CreateTent extends ObjectReference{lolnamiota}ObjectReference Property Namiot AutoEvent OnActivate(ObjectReference akActionRef)CreateTent()endEventMessage function CreateTent()ObjectReference tenttent = Namiottent.MoveTo(Game.GetPlayer())endFunction
User avatar
Maeva
 
Posts: 3349
Joined: Mon Mar 26, 2007 11:27 pm

Post » Tue Jun 19, 2012 5:52 pm

In Oblivion, we had to disable static objects before moving them and then re-enable them afterwards, or else it wouldn't work properly. You might have to do the same thing in Skyrim.
User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Tue Jun 19, 2012 5:02 pm

I tried what u said but it still doesn't work :/

tent.Disable()tent.MoveTo(Game.GetPlayer())tent.Enable()

I tried SetPosition too

tent.Disable()tent.SetPosition(0.0,0.0,0.0)tent.Enable()

Any other ideas ? Maby i have to change something in Tent object ?
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am

Post » Wed Jun 20, 2012 4:21 am

moving static object does'nt work, you have to create movablestatic form if you want to.
User avatar
Brandon Wilson
 
Posts: 3487
Joined: Sat Oct 13, 2007 1:31 am

Post » Wed Jun 20, 2012 5:52 am

So i have to create New MovableStatic type Object with ImperialTent Model ?
User avatar
yessenia hermosillo
 
Posts: 3545
Joined: Sat Aug 18, 2007 1:31 pm

Post » Tue Jun 19, 2012 9:43 pm

So i have to create New MovableStatic type Object with ImperialTent Model ?
since you are moving an item from a cell, yes.
Otherwise, you cant set any static/movablestatic into property.
User avatar
Mrs. Patton
 
Posts: 3418
Joined: Fri Jan 26, 2007 8:00 am


Return to V - Skyrim