Papyrus help is needed: Spawn object within the skyrim world

Post » Mon Jun 18, 2012 12:00 am

Hello

I'm currently working on a hunter mod where I want to make it possible to place tents, campfires and other hunter objects dynamicly in the world, but I have run into a problem.

I am trying to spawn a object next to the player, prefereble a campfire with animating fire, though right now I'm just trying to spawn what ever object next to the player, without succes.

I have tried the following.
Creating a WETempleActivator, to listen for its OnActivate event
Assign a Papyrus script to the WETempleActivator
Scriptname helloWorldScript extends ObjectReference{First script};Assigning the value of a Idle marker property from the Properties button, right now I'm trying to spawn the object at this marker.ObjectReference Property Marker AutoEvent OnActivate(ObjectReference akActionRef)	  ObjectReference spawn = Marker.PlaceAtMe(EncWolf)endEvent

I'm getting the error that EncWolf is undefined, which tells me its trying to grab an variable named EncWolf. EncWolf is an editor ID for a regular grey wolf, the Editor ID list is probably only defining object within the editor itself and not ingame.

I cannot figure out how to make a variable containing a link/reference to that Wolf base object and or other object(s), since I dont create an object in the render window but instead dynamicly generating the object with Papyrus when an event is happening.

I have figured out I have to somehow get the base of the object I want to create since "PlaceAtMe" creates a copy of the base object
From Creation Kit Wiki "Creates a new instance of an object and places it at the calling object's location."
User avatar
Jonathan Braz
 
Posts: 3459
Joined: Wed Aug 22, 2007 10:29 pm

Post » Mon Jun 18, 2012 6:10 am

In Papyrus, you can't refer to forms directly by their editorIDs. Instead, you need to make a property, and assign it a value via the Creation Kit's dialogue window for the form with the script attached to it.

Cipscis
User avatar
Kate Murrell
 
Posts: 3537
Joined: Mon Oct 16, 2006 4:02 am

Post » Mon Jun 18, 2012 2:59 am

Okay, so I have to pull an EncWolf from the Object Window into the Render Window, hide it somewhere, create a Form variable, use the Properties button on my WETempleActivator to assign the EncWolf to my newly created form variable, and that should do it ?

Going to try it right now
User avatar
Jenna Fields
 
Posts: 3396
Joined: Mon Dec 11, 2006 11:36 am

Post » Mon Jun 18, 2012 9:15 am

I just saw you had a tutorial on EditorId's and I have followed it, this is what I have now

Scriptname helloWorldScript extends ObjectReference{First script};Assigning the value of a Idle marker property from the Properties buttonObjectReference Property Marker AutoObjectReference Property EncWolf AutoEvent OnActivate(ObjectReference akActionRef)	  ObjectReference spawn = Marker.PlaceAtMe(EncWolf )endEvent

The code saves succesfully now though I still cannot spawn a wolf in the game.
In the "Edit Properties" I have also assigned the idle marker value to Marker and I have manually spawned a EncWolf from the Object Window into my room and through properties assigned that wolf to my EncWolf property variable.

Though I still don't have succes spawning my wolf.
User avatar
Liv Staff
 
Posts: 3473
Joined: Wed Oct 25, 2006 10:51 pm

Post » Mon Jun 18, 2012 2:41 am

Bump - Still stuck :(
User avatar
DarkGypsy
 
Posts: 3309
Joined: Tue Jan 23, 2007 11:32 am

Post » Mon Jun 18, 2012 8:56 am

http://www.creationkit.com/PlaceAtMe_-_ObjectReference takes a Form as its first parameter, not an ObjectReference. Change EncWolf to type Form, and pick the wolf's base form as its property.

You can also delete the extra reference you created, as it's not required.

Cipscis
User avatar
latrina
 
Posts: 3440
Joined: Mon Aug 20, 2007 4:31 pm

Post » Mon Jun 18, 2012 2:16 am

http://www.creationkit.com/PlaceAtMe_-_ObjectReference takes a Form as its first parameter, not an ObjectReference. Change EncWolf to type Form, and pick the wolf's base form as its property.

You can also delete the extra reference you created, as it's not required.

Cipscis

I believe Placeatme should be able to work with any thing that is an extention of form like actorbase for instance. At least that how inheritance should work.

Add a new property of type: ActorBase, name: EncWolf, make sure it links to the right thing in the properties screen and then placeatme should work right. I assume you tried using the type Actor which is an ObjectReference and must be already placed in the world, ActorBase is a form so it should work with placeatme.
User avatar
Laura Samson
 
Posts: 3337
Joined: Wed Aug 29, 2007 6:36 pm

Post » Mon Jun 18, 2012 6:56 am

I believe Placeatme should be able to work with any thing that is an extention of form like actorbase for instance. At least that how inheritance should work.
As far as I'm aware, it only works with types that can be classified as "base forms", which is basically everything the extends Form except for ObjectReference. I expect it will compile, as ObjectReference extends Form, but I don't expect it to work and I've seen other reports for Papyrus that this is the case.

It's probably worth noting that this behaviour is consistent with previous games.

Cipscis
User avatar
Bek Rideout
 
Posts: 3401
Joined: Fri Mar 02, 2007 7:00 pm

Post » Mon Jun 18, 2012 4:40 am

PlaceAtMe takes a Form as its first parameter, not an ObjectReference. Change EncWolf to type Form, and pick the wolf's base form as its property.

You can also delete the extra reference you created, as it's not required.

Cipscis

I have changed my code to this
Scriptname helloWorldScript extends ObjectReference{First script}Form Property EncWolf AutoEvent OnActivate(ObjectReference akActionRef)	  ObjectReference spawn = Game.GetPlayer().PlaceAtMe(EncWolf)endEvent
When Im inside Properties for this script and choose my EncWolf property and click Auto-Fill, it automaticly puts in the name and ID of the Base Object EncWolf though when I click OK and I open the dialog again it resets its value to "None"
The dropdown list I can choose from is
NONE
CommandingActorPersistenceForm
PapyrusPersistenceForm

It seems it will not link to the base object
User avatar
Manny(BAKE)
 
Posts: 3407
Joined: Thu Oct 25, 2007 9:14 am

Post » Mon Jun 18, 2012 3:39 am



I have changed my code to this
Scriptname helloWorldScript extends ObjectReference{First script}Form Property EncWolf AutoEvent OnActivate(ObjectReference akActionRef)	  ObjectReference spawn = Game.GetPlayer().PlaceAtMe(EncWolf)endEvent
When Im inside Properties for this script and choose my EncWolf property and click Auto-Fill, it automaticly puts in the name and ID of the Base Object EncWolf though when I click OK and I open the dialog again it resets its value to "None"
The dropdown list I can choose from is
NONE
CommandingActorPersistenceForm
PapyrusPersistenceForm

It seems it will not link to the base object

Use ActorBase like I suggested.
User avatar
Chloe :)
 
Posts: 3386
Joined: Tue Jun 13, 2006 10:00 am

Post » Mon Jun 18, 2012 12:35 pm

Use ActorBase like I suggested.

It worked perfectly, the wolf spawned, it attacked me and I killed it :) thank you!

My next milestone is being able to spawn static object in the world, like a animated campfire, a tent and the like.
The problem is I don't know which object type they are and cannot seem to find any information on it either, it would be perfect if it worked the same way as ActorBase where I create the property and through the property dropdown I can choose whichever object I like to spawn.
User avatar
adame
 
Posts: 3454
Joined: Wed Aug 29, 2007 2:57 am

Post » Mon Jun 18, 2012 12:55 am

I have figured out I can use the type STATIC to get some kind of campfire, but it doesnt have any fire.

STATIC Property myStatic Auto
With this I can example get: Campfire01LandOff, Campfire01LandOffCaveDirt and meny more kind of Camp fires the problem is there is no fire to them.
These objects is inside WorldObjects -> Static -> CLUTTER

Where those campfires I need is inside
WorldObjects -> MovableStatic -> CLUTTER
Example: Campfire01Burning

The problem is I cannot figure out which data type the burning campfire is associated with
User avatar
Manuel rivera
 
Posts: 3395
Joined: Mon Sep 10, 2007 4:12 pm


Return to V - Skyrim