Simple Spawn Dragon Script

Post » Fri Nov 16, 2012 7:00 pm

Hi everyone,

I'm new to scripting in the Creation Kit and I cannot figure out how to spawn a Dragon when the player opens a certain chest.

I've already got the dragon in place, and I've ticked the box that reads something like "Disabled" (in the Dragon's options that is) so that it doesn't spawn immediately upon loading the map.

Scriptname aaaSpawnBigDragon1 extends ObjectReference  {Event OnOpen(ObjectReference TravelerChest2)ObjectReference TravelerChest2 = Enable(aSpawnRobinsDragon1)EndEvent}

That's the code how it was in my last attempt. (Excuse me if it is far off :unsure:)

TravelerChest2 = The chest that should activate the Dragon
aaaSpawnBigDragon1 = The name of the script
aSpawnRobinsDragon1 = The name of the Dragon (Heh yea that's my name)

Thanks in advance! :thumbsup:
User avatar
Amelia Pritchard
 
Posts: 3445
Joined: Mon Jul 24, 2006 2:40 am

Post » Fri Nov 16, 2012 8:32 am

You would be better off I think making the dragon a quest alias (assuming its a quest), then using the Alias_thealiasname.Enable script.

Edit:

If not a quest, make the chest a parent of the dragon (in the options window, not base edit window for the dragon), right click in the box below Enable Parent, click new, then in the next box that pops up select Reference Window and click your chest.

The enable script should work then.

The script in the chest though would need to have a property added to it for the dragon, otherwise it can't "see" it.
User avatar
Blaine
 
Posts: 3456
Joined: Wed May 16, 2007 4:24 pm

Post » Fri Nov 16, 2012 12:22 pm

Thanks for the quick response,

However, it isn't a quest. I'm just making a small adventure, and eventually the player gets to this chest. :ermm:
User avatar
Farrah Lee
 
Posts: 3488
Joined: Fri Aug 17, 2007 10:32 pm

Post » Fri Nov 16, 2012 11:13 pm

Thanks for the quick response,

However, it isn't a quest. I'm just making a small adventure, and eventually the player gets to this chest. :ermm:

Edited my post :)
User avatar
Esther Fernandez
 
Posts: 3415
Joined: Wed Sep 27, 2006 11:52 am

Post » Fri Nov 16, 2012 8:02 am

You could try attaching a Event OnActivate script to the chest that you want to spawn the dragon and placing an xmarker/xmarker heading where you want the dragon to spawn? So it would look like this:

Event OnActivate(ObjectReference akActionRef)Marker01.PlaceAtMe(Dragon)endEvent

this means that when the chest is activated a Dragon will be spawned where ever you place the xmarker/xmarker heading.
User avatar
Megan Stabler
 
Posts: 3420
Joined: Mon Sep 18, 2006 2:03 pm

Post » Fri Nov 16, 2012 2:11 pm

@B1gBadDaddy: I thought everything went well when I tried that, but the dragon just spawned immediately even before opening the chest.
The same goes for SteezMyster's way of doing it. It was gone though when I did not make the Chest being a parent of the dragon. But then, the dragon wouldn't spawn at all again.

I'm not really getting the property part I think. Is that also required for your way, SteezMyster?

I really appreciate the help though! :turned:
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Fri Nov 16, 2012 10:53 am

Yea the properties should be:
ObjectReference Property Marker01 AutoActorBase Property Dragon Auto

make the dragon property your dragon and the Marker01 property the xmarker you placed
User avatar
A Lo RIkIton'ton
 
Posts: 3404
Joined: Tue Aug 21, 2007 7:22 pm

Post » Fri Nov 16, 2012 9:44 pm

Also you don't need to link anything to the chest and the dragon doesn't need to be in the same cell as the chest. When you activate the chest it should spawn a new dragon at the xmarker you placed. Also make sure you have attached the script to your chest and that you have selected your properties, otherwise this won't do anything.
User avatar
Assumptah George
 
Posts: 3373
Joined: Wed Sep 13, 2006 9:43 am

Post » Fri Nov 16, 2012 5:23 pm

If your still having problems you could post your script so I can see what the problem is and possibly go from there. Just let me know if you need anymore help or if your confused
User avatar
Janeth Valenzuela Castelo
 
Posts: 3411
Joined: Wed Jun 21, 2006 3:03 am

Post » Fri Nov 16, 2012 5:15 pm

Just chiming in to say forget about the enable parent thing, I don't know what I was on about then, you don't need that atall :)
User avatar
Phoenix Draven
 
Posts: 3443
Joined: Thu Jun 29, 2006 3:50 am

Post » Fri Nov 16, 2012 6:43 pm

Just chiming in to say forget about the enable parent thing, I don't know what I was on about then, you don't need that atall :smile:
That's ok :tongue:, I'm glad actually, because it would've made it even more difficult.

Anyway, I'm sorry to be a pain, but it still won't work. Here's my script:

Scriptname aaaaSpawnBigDragon extends ObjectReference  {Event OnActivate(ObjectReference aTravelerChestReference)Marker01.PlaceAtMe(aSpawnRobinsDragon1)endEvent} ObjectReference Property Marker01 AutoActor Property aDragonProperty  Auto  

My marker is actually named Marker01, so that's not the mistake.
I've also connected the properties to their corresponding entities (The Dragon and the Marker)

Some more questions: Does it matter if I use "OnActivate" or "OnOpen" ? and after that line, I typed in the reference name of the Chest, but in your example it was akActionRef

What does that mean? Again, thank you for the help!
User avatar
lolly13
 
Posts: 3349
Joined: Tue Jul 25, 2006 11:36 am

Post » Fri Nov 16, 2012 12:36 pm

@SteezMyster, in a different topic, you mentioned this
"For the actor property select an actor base that you want to spawn when you pull the chain."

I think that's where I went wrong. Also, in this line
Marker01.PlaceAtMe(aSpawnRobinsDragon1)
Must I write the name of my Dragon's reference name or its ID name?

I've also noticed that earlier I typed the name of the property's in these lines
ObjectReference Property Marker01 AutoActor Property aDragonProperty  Auto  

But apparently that's where I should write down the reference name of the Actor and the Object.

I can try this again in a few hours. I hope it works then!
User avatar
Bambi
 
Posts: 3380
Joined: Tue Jan 30, 2007 1:20 pm

Post » Fri Nov 16, 2012 12:12 pm

@SteezMyster, in a different topic, you mentioned this

I think that's where I went wrong. Also, in this line
Marker01.PlaceAtMe(aSpawnRobinsDragon1)
Must I write the name of my Dragon's reference name or its ID name?

You use whatever name you defined in the properties. In your case you would write:

Marker01.placeatme(aDragonProperty)

- Hypno

EDIT: if that still doesn't work you can try "placeActorAtMe" instead. Also while looking up that function on the wiki, in one of the examples was a good function for you: "startcombat()". Here's how you would write the whole line:

Marker01.placeActorAtMe(aDragonProperty).startCombat(game.getplayer())
User avatar
SamanthaLove
 
Posts: 3565
Joined: Mon Dec 11, 2006 3:54 am

Post » Fri Nov 16, 2012 4:40 pm

Ooh I see, so when do I need the Reference Names that I can assign to each object? Or is that information stored within each property?
User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Fri Nov 16, 2012 8:52 pm

I think you're talking about the editor id that you can add to a specific reference after double clicking on it in the reference window, am I right?

Well, in the old scripting language used in oblivion, you used to be able to use these directly in your scripts. Now, they are pretty much for your own reference because instead we have to set properties up.

(BTW, I edited my post above)

- Hypno
User avatar
Everardo Montano
 
Posts: 3373
Joined: Mon Dec 03, 2007 4:23 am

Post » Fri Nov 16, 2012 9:57 am

Ok, that clears a lot of things up :cool:

However, unless I'm missing something completely obvious, with this script it still won't work:

Scriptname aaNewSpawnDragon extends ObjectReference   ObjectReference Property Marker01  Auto  Actorbase Property DragonProperty01  Auto  {Event OnActivate(ObjectReference akActionRef)Marker01.placeatme(aDragonProperty)endEvent}

I've also tried the other method with the Marker, but just nothing happens.
I've referred the properties properly and for the Actorbase I even tried to use a standard Dragon, but nopes :shakehead:
I don't get it :unsure:
User avatar
Heather beauchamp
 
Posts: 3456
Joined: Mon Aug 13, 2007 6:05 pm

Post » Fri Nov 16, 2012 11:26 pm

You changed the name of the property but didn't use this name in the placeatme part

Also, did you look at the edit of my previous post because I think placeActorAtMe() along with startCombat() will be better for you.

Try this (dont forget to set the properties after you compile the script)

Scriptname aaNewSpawnDragon extends ObjectReference  ObjectReference Property myMarker  Auto  Actor Property myDragon  Auto  Event OnActivate(ObjectReference akActionRef)   myMarker.placeActorAtMe(myDragon).startcombat(game.getplayer())endEvent
User avatar
Nicholas C
 
Posts: 3489
Joined: Tue Aug 07, 2007 8:20 am

Post » Fri Nov 16, 2012 10:52 am

Oh right, I quickly tried something else and I suppose I accidentally used the old name then. But I did it the correct way earlier. I'm gonna test and see if this works now, thanks!

Oh, before I forget, must the marker be disabled or enabled?

Edit: Eh, I really appreciate the effort, but that doesn't do the trick either. I checked the script carefully and cannot find any mistakes at all. Does it have to do with the dragon still being disabled? Is there not just a script that tells the dragon that it gets enabled, and it spawns at the location where I placed it?
User avatar
Chantelle Walker
 
Posts: 3385
Joined: Mon Oct 16, 2006 5:56 am

Post » Fri Nov 16, 2012 11:39 am

You shouldn't disable the dragon or the marker, the dragon doesn't need to be present in the world of Skyrim. When you open the chest the script is set up to spawn a new dragon into existence not move the current one to your marker.
User avatar
Motionsharp
 
Posts: 3437
Joined: Sun Aug 06, 2006 1:33 am

Post » Fri Nov 16, 2012 1:03 pm

Oh I didn't realise you still had the dragon in the world, set as disabled. As SteezMyster just said, remove the dragon from the world altogether. The script spawns a new reference of the base dragon actor. Just make sure you set the properties accordingly

- Hypno
User avatar
Harry Hearing
 
Posts: 3366
Joined: Sun Jul 22, 2007 6:19 am

Post » Fri Nov 16, 2012 3:28 pm

you also you need to change your actor property to actorbase property
User avatar
Charles Weber
 
Posts: 3447
Joined: Wed Aug 08, 2007 5:14 pm

Post » Fri Nov 16, 2012 11:20 pm

So the script should look like this:

ObjectReference Property MyMarker AutoActorBase Property MyDragon AutoEvent OnActivate(ObjectReference akActionRef)MyMarker.PlaceAtMe(MyDragon)EndEvent
User avatar
Breanna Van Dijk
 
Posts: 3384
Joined: Mon Mar 12, 2007 2:18 pm

Post » Fri Nov 16, 2012 1:11 pm

@Hypno, ya, in your last script you used Actor instead of Actorbase, so I used Actor instead.

@SteezMyster, I even tried adding the exact script of yours to the Chest itself and not to it's ID (if that makes sense) but really, no dragon appears at all.

It's really strange, because I now know what I'm doing... I'm confused.

Edit:

Scriptname aFinishedDragonScript extends ObjectReference  ObjectReference Property Markerx02  Auto  ActorBase Property DragonProperty02  Auto  {Event OnActivate(ObjectReference akActionRef)Markerx02.PlaceAtMe(DragonProperty02)EndEvent}

I started all over and renamed everything again, but still nothing happens..
User avatar
Louise Andrew
 
Posts: 3333
Joined: Mon Nov 27, 2006 8:01 am

Post » Fri Nov 16, 2012 8:33 pm

did you choose your properties? There is a tab in the script part that says properties, you have to select your marker and the dragon for it to work.
User avatar
kristy dunn
 
Posts: 3410
Joined: Thu Mar 01, 2007 2:08 am

Post » Fri Nov 16, 2012 7:28 pm

Yeah, here's what it looks like:

[img]http://i45.tinypic.com/5jww8o.jpg[/img]
User avatar
Jack Bryan
 
Posts: 3449
Joined: Wed May 16, 2007 2:31 am

Next

Return to V - Skyrim