Quick CK questions Thread #2

Post » Tue Jun 19, 2012 9:18 am

I would write it like this using Skyrim's scripting language:

Spoiler
ScriptName Test extends ObjectReferenceActorBase property Draugr autoActorBase property DragonPriest01 autoActorBase property DragonPriest02 autoActorBase property DragonPriest03 autoActorBase property DragonPriest04 autoActorBase property DragonPriest05 autoActorBase property DragonPriest06 autoActorBase property DragonPriest07 autoActorBase property DragonPriest08 autoWeapon property DraugrSword autoArmor property WoodenMask autoArmor property NinthMask autoEvent OnActivate(ObjectReference akActivatingRef)	if (akActivatingRef != Game.GetPlayer())		Return	;ignore the activation if it's not from the player	endif		if (Game.GetPlayer().GetItemCount(DraugrSword) >= 1)		PlaceAtMe(Draugr, 6)	elseif (Game.GetPlayer().GetItemCount(WoodenMask) >= 1) && (Game.GetPlayer().GetItemCount(NinthMask) >= 1)		PlaceAtMe(DragonPriest01, 1)		PlaceAtMe(DragonPriest02, 1)		PlaceAtMe(DragonPriest03, 1)		PlaceAtMe(DragonPriest04, 1)		PlaceAtMe(DragonPriest05, 1)		PlaceAtMe(DragonPriest06, 1)		PlaceAtMe(DragonPriest07, 1)		PlaceAtMe(DragonPriest08, 1)	endifEndEvent

Problem is. I'm using PlaceItem not PlaceAtMe. Using PlaceAtMe will cause A LOT of problems cause they all will be placed at the same spot. You know? But thx for this. That helps me a lot and I do have a good idea of how my script will work.

A PlaceItem Command a place anything, items NPCs etc, in the current cell that the player and object being activated is in and the numbers after it is (In this order) the XPosition, YPosition, ZPosition, Rotation (I always set Rotation to 0 as it not matters.)

Lastly, I notice you set the items and that sort at the beginning of the script. Do you say "Ingredient" or "Ingred" for an ingredient item?
User avatar
Jennifer May
 
Posts: 3376
Joined: Thu Aug 16, 2007 3:51 pm

Post » Tue Jun 19, 2012 9:30 am

Problem is. I'm using PlaceItem not PlaceAtMe. Using PlaceAtMe will cause A LOT of problems cause they all will be placed at the same spot. You know? But thx for this. That helps me a lot and I do have a good idea of how my script will work.

A PlaceItem Command a place anything, items NPCs etc, in the current cell that the player and object being activated is in and the numbers after it is (In this order) the XPosition, YPosition, ZPosition, Rotation (I always set Rotation to 0 as it not matters.)

Lastly, I notice you set the items and that sort at the beginning of the script. Do you say "Ingredient" or "Ingred" for an ingredient item?

PlaceItem doesn't exist in Papyrus, unless you write it yourself. The standard way of creating an item at another position than one where you have a reference already is to create an invisible marker, move it to the location, and then use placeatme on THAT marker to place your item.
User avatar
MatthewJontully
 
Posts: 3517
Joined: Thu Mar 08, 2007 9:33 am

Post » Tue Jun 19, 2012 8:27 am

PlaceItem doesn't exist in Papyrus, unless you write it yourself. The standard way of creating an item at another position than one where you have a reference already is to create an invisible marker, move it to the location, and then use placeatme on THAT marker to place your item.

So how would the PlaceAtMe line change if I use a Marker with the ID: "M1"?

Line being: PlaceAtMe(Draugr, 1)
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Tue Jun 19, 2012 10:04 am

Just a quick question that might be worth noting on this thread; http://www.gamesas.com/topic/1359385-how-can-a-papyrus-script-identify-player-inventory-favourites/
Thanks in advance.
User avatar
Tarka
 
Posts: 3430
Joined: Sun Jun 10, 2007 9:22 pm

Post » Tue Jun 19, 2012 11:22 am

Fixedmore.
User avatar
-__^
 
Posts: 3420
Joined: Mon Nov 20, 2006 4:48 pm

Post » Tue Jun 19, 2012 1:11 pm

So how would the PlaceAtMe line change if I use a Marker with the ID: "M1"?

Line being: PlaceAtMe(Draugr, 1)

New Line Being: M1.PlaceAtMe(Draugr,1) - provided you defined "Draugr" as a property that points to the type of Draugr you wanted to place of course.

There are literally hundreds of types of Draugr in the game, so "Draugr" is insufficient description by itself.
User avatar
Motionsharp
 
Posts: 3437
Joined: Sun Aug 06, 2006 1:33 am

Post » Tue Jun 19, 2012 1:58 pm

New Line Being: M1.PlaceAtMe(Draugr,1) - provided you defined "Draugr" as a property that points to the type of Draugr you wanted to place of course.

I'm making new version of each Draugr with their own IDs because these special versions will be disabled upon death and have some different effects. Thanks for the help though. Now I just need to figure out how to make NPC-Scripts and I am good to go.

Oh crap. I should ask, what would be the thing for the M1? I notice each thing used in a script is mentioned near the top of the script like for the Draugr it is "ActorBase property JDR auto".. I do know it would be "property M1 auto" but would it be ActorBase or something else?
User avatar
Je suis
 
Posts: 3350
Joined: Sat Mar 17, 2007 7:44 pm

Post » Tue Jun 19, 2012 1:53 pm

I'm making new version of each Draugr with their own IDs because these special versions will be disabled upon death and have some different effects. Thanks for the help though. Now I just need to figure out how to make NPC-Scripts and I am good to go.

Oh crap. I should ask, what would be the thing for the M1? I notice each thing used in a script is mentioned near the top of the script like for the Draugr it is "ActorBase property JDR auto".. I do know it would be "property M1 auto" but would it be ActorBase or something else?

M1 can be anything. I usually use an Xmarker, since it's invisible, will stay where i put it, and disposable.
User avatar
Jaylene Brower
 
Posts: 3347
Joined: Tue Aug 15, 2006 12:24 pm

Post » Tue Jun 19, 2012 6:51 pm

M1 can be anything. I usually use an Xmarker, since it's invisible, will stay where i put it, and disposable.

I'll use an Xmarker then but what should say instead of ActorBase in the script line "ActorBase property M1 auto"?
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Tue Jun 19, 2012 12:45 pm

@MK-{OmegaX}

Instead of using the spells' form IDs when you declare the properties, try using their names instead.


@Jusey1

I would declare M1 to be an object reference. It's supposed to be something you can use as a spawn marker, right? That means it's something you can see and click in the render window. Anything you can click in the render window is an object reference.
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Tue Jun 19, 2012 12:19 pm

@Jusey1

I would declare M1 to be an object reference. It's supposed to be something you can use as a spawn marker, right? That means it's something you can see and click in the render window. Anything you can click in the render window is an object reference.

Oky. So it would be "ObjectReference property M1 auto"?
User avatar
sw1ss
 
Posts: 3461
Joined: Wed Nov 28, 2007 8:02 pm

Post » Tue Jun 19, 2012 9:07 pm

Yes.
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Tue Jun 19, 2012 5:54 am

And you'll need a second property for the TYPE of M1:

Function PlaceM1MarkerFromRef(ObjectReference MainLocation, float XOffset, Float YOffest, Float ZOffset)   M1 = MainLocation.PlaceAtMe(M1Type,1)   M1.MoveTo(MainLocation,XOffset,YOffset,ZOffSet)EndFunctionActivator Property M1Type Auto ; Set this to the XmarkerActivator Type

You would call that function the first time you used M1. After that, you could use MoveTo(ObjectReference,XOffset,YoffSet,ZoffSet) to move it around before placing your Draugr.
User avatar
Elisabete Gaspar
 
Posts: 3558
Joined: Thu Aug 31, 2006 1:15 pm

Post » Tue Jun 19, 2012 5:15 pm

Yes.

Okay. With what I've learned today... Do you think this script will work for Spawning the First (of 50) Wave of each type of Creature listed by activating a Stone? (Dragons, Draugrs, Dremoras, etc) Tell me if there are any flaws that I miss.

Spoiler
ScriptName WaveStone extends ObjectReference
ObjectReference property M1 auto
ObjectReference property M2 auto
ObjectReference property M3 auto
ObjectReference property M4 auto
ObjectReference property M5 auto
ObjectReference property M6 auto
ObjectReference property M7 auto
ObjectReference property M8 auto
ObjectReference property M9 auto
ObjectReference property M10 auto
ObjectReference property M11 auto
ObjectReference property M12 auto
ActorBase property JDR auto
ActorBase property JDRW1 auto
ActorBase property JDNW1 auto
ActorBase property JF auto
ActorBase property JFW1 auto
ActorBase property JDS auto
ActorBase property JDSW1 auto
ActorBase property JDC auto
ActorBase property JDCW1 auto
ActorBase property JW auto
ActorBase property JWW1 auto
ActorBase property JMC auto
ActorBase property JMCW1 auto
ActorBase property JG auto
ActorBase property JGW1 auto
ActorBase property JSN auto
ActorBase property JSkNW1 auto
Weapon property 0002c66f auto
MiscObject property 0003ada3 auto
Ingredient property 0003ad5d auto
MiscObject property 000f4983 auto
Ingredient property 0003ad5b auto
MiscObject property 0003ad74 auto
Ingredient property 0006bc00 auto
Ingredient property 0003ad63 auto
MiscObject property 000af5fd auto
Event OnActivate(ObjectReference akActivatingRef)
_If (akActivatingRef != Game.GetPlayer())
__Return ;ignore the activation if it's not from the player
_Endif
_If (Game.GetPlayer().GetItemCount(0002c66f) >= 1)
__M1.PlaceAtMe(JDRW1, 1)
__M2.PlaceAtMe(JDR, 1)
__M3.PlaceAtMe(JDR, 1)
__M4.PlaceAtMe(JDR, 1)
__M5.PlaceAtMe(JDR, 1)
__M6.PlaceAtMe(JDR, 1)
__M7.PlaceAtMe(JDR, 1)
__M8.PlaceAtMe(JDR, 1)
__Debug.MessageBox("WAVE ONE!")
__Return
_Elseif (Game.GetPlayer().GetItemCount(0003ada3) >= 1)
__M1.PlaceAtMe(JDNW1, 1)
__Debug.MessageBox("WAVE ONE!")
__Return
_Elseif (Game.GetPlayer().GetItemCount(0003ad5d) >= 1)
__M1.PlaceAtMe(JFW1, 1)
__M2.PlaceAtMe(JF, 1)
__M3.PlaceAtMe(JF, 1)
__M4.PlaceAtMe(JF, 1)
__M5.PlaceAtMe(JF, 1)
__Debug.MessageBox("WAVE ONE!")
_Return
_Elseif (Game.GetPlayer().GetItemCount(000f4983) >= 1)
__M1.PlaceAtMe(JDSW1, 1)
__M2.PlaceAtMe(JDS, 1)
__M3.PlaceAtMe(JDS, 1)
__M4.PlaceAtMe(JDS, 1)
__M5.PlaceAtMe(JDS, 1)
__M6.PlaceAtMe(JDS, 1)
__M7.PlaceAtMe(JDS, 1)
__M8.PlaceAtMe(JDS, 1)
__M9.PlaceAtMe(JDS, 1)
__M10.PlaceAtMe(JDS, 1)
__Debug.MessageBox("WAVE ONE!")
__Return
_Elseif (Game.GetPlayer().GetItemCount(0003ad5b) >= 1)
__M1.PlaceAtMe(JDMCW1, 1)
__M2.PlaceAtMe(JDMC, 1)
__M3.PlaceAtMe(JDMC, 1)
__M4.PlaceAtMe(JDMC, 1)
__Debug.MessageBox("WAVE ONE!")
__Return
_Elseif (Game.GetPlayer().GetItemCount(0003ad74) >= 1)
__M1.PlaceAtMe(JWW1, 1)
__M2.PlaceAtMe(JW, 1)
__M3.PlaceAtMe(JW, 1)
__M4.PlaceAtMe(JW, 1)
__M5.PlaceAtMe(JW, 1)
__M6.PlaceAtMe(JW, 1)
__M7.PlaceAtMe(JW, 1)
__M8.PlaceAtMe(JW, 1)
__Debug.MessageBox("WAVE ONE!")
__Return
_Elseif (Game.GetPlayer().GetItemCount(0006bc00) >= 1)
__M1.PlaceAtMe(JMCW1, 1)
__M2.PlaceAtMe(JMC, 1)
__M3.PlaceAtMe(JMC, 1)
__M4.PlaceAtMe(JMC, 1)
__M5.PlaceAtMe(JMC, 1)
__M6.PlaceAtMe(JMC, 1)
__M7.PlaceAtMe(JMC, 1)
__M8.PlaceAtMe(JMC, 1)
__M9.PlaceAtMe(JMC, 1)
__M10.PlaceAtMe(JMC, 1)
__M11.PlaceAtMe(JMC, 1)
__M12.PlaceAtMe(JMC, 1)
__Debug.MessageBox("WAVE ONE!")
__Return
_Elseif (Game.GetPlayer().GetItemCount(0003ad63) >= 1)
__M1.PlaceAtMe(JGW1, 1)
__M2.PlaceAtMe(JG, 1)
__M3.PlaceAtMe(JG, 1)
__M4.PlaceAtMe(JG, 1)
__Debug.MessageBox("WAVE ONE!")
__Return
_Elseif (Game.GetPlayer().GetItemCount(000af5fd) >= 1)
__M1.PlaceAtMe(JSNW1, 1)
__M2.PlaceAtMe(JSN, 1)
__M3.PlaceAtMe(JSN, 1)
__M4.PlaceAtMe(JSN, 1)
__M5.PlaceAtMe(JSN, 1)
__M6.PlaceAtMe(JSN, 1)
__M7.PlaceAtMe(JSN, 1)
__M8.PlaceAtMe(JSN, 1)
__Debug.MessageBox("WAVE ONE!")
__Return
_Endif
EndEvent
_ = Tabs.
Also, anything that ends with W1 will be scripted that, upon death, will spawn "Wave Two" of that creature type.
User avatar
sophie
 
Posts: 3482
Joined: Fri Apr 20, 2007 7:31 pm

Post » Tue Jun 19, 2012 6:31 am

And you'll need a second property for the TYPE of M1:
 Function PlaceM1MarkerFromRef(ObjectReference MainLocation, float XOffset, Float YOffest, Float ZOffset) M1 = MainLocation.PlaceAtMe(M1Type,1) M1.MoveTo(MainLocation,XOffset,YOffset,ZOffSet) EndFunction Activator Property M1Type Auto ; Set this to the XmarkerActivator Type 
You would call that function the first time you used M1. After that, you could use MoveTo(ObjectReference,XOffset,YoffSet,ZoffSet) to move it around before placing your Draugr.

Crap. I guess I do have a flaw, lol. Ye' said that while I was typing up the script.

~Edit~

Maybe. Can I just make the invisible M1 Object and place it in the same cell that everything else is in? As long it is there, it would work? Right?
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Tue Jun 19, 2012 9:21 am

Yeah, if the markers are already in the cell, they should work. The function Redwood Elf gave you is if you wanted to create the markers dynamically, during run time. I'm confused about the second property M1Type though...

Never mind, I understand now. M1Type is supposed to be the base object for M1. He's doing it this way so that you could have different types of objects for each marker. The reason for different types of objects for each marker, is because each of the objects is supposed to have a script of its own to spawn the monsters.

So in the end, you end up with something that spawns markers that spawns monsters.
User avatar
Kevin S
 
Posts: 3457
Joined: Sat Aug 11, 2007 12:50 pm

Post » Tue Jun 19, 2012 6:25 pm

Yeah, if the markers are already in the cell, they should work. The function Redwood Elf gave you is if you wanted to create the markers dynamically, during run time. I'm confused about the second property M1Type though...

Never mind, I understand now. M1Type is supposed to be the base object for M1. He's doing it this way so that you could have different types of objects for each marker. The reason for different types of objects for each marker, is because each of the objects is supposed to have a script of its own to spawn the monsters.

So in the end, you end up with something that spawns markers that spawns monsters.

I rather just have the Markers already there to begin with and keep using them to spawn monsters because this stuff should be redo-able and having 50 Waves of one set of monsters will = A LOT of Invisible Markers in the are and I have a feeling that will cause A LOT of problems. Btw, can you check my thread I have about NPC Scripts I need help with and help me out in there? I'm good with my main 3 Stone Scripts (Which you saw one) and now I need to start working on scripts for the Monsters themselves.
User avatar
Heather Kush
 
Posts: 3456
Joined: Tue Jun 05, 2007 10:05 pm

Post » Tue Jun 19, 2012 9:36 pm

Problem Conqured
User avatar
Benji
 
Posts: 3447
Joined: Tue May 15, 2007 11:58 pm

Post » Tue Jun 19, 2012 1:09 pm

I am not sure that I understand all that you are saying, but in papyrus, it doesn't matter where you put the properties (as long as it's not in the middle of an event or function block). If you want, you can simply cut and paste it back to the top of the script.
User avatar
Julia Schwalbe
 
Posts: 3557
Joined: Wed Apr 11, 2007 3:02 pm

Post » Tue Jun 19, 2012 6:26 am

Aye but the Script itself is fine, everything I need it to do is there, its just not recognizing the Extra property Spell that I put, and when I do, several other properties disappear, not from the script Source itself but from Properties index. and when I add them back, the suddenly appear at the End of the Script when they weren't there originally. guess I'l go test some more.
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Tue Jun 19, 2012 9:54 pm

Problem Conqured
User avatar
Ladymorphine
 
Posts: 3441
Joined: Wed Nov 08, 2006 2:22 pm

Post » Tue Jun 19, 2012 5:37 pm

Maybe you should take a screenshot of the conditions... "GetLevel >30 <= 60" looks really weird.
User avatar
ZzZz
 
Posts: 3396
Joined: Sat Jul 08, 2006 9:56 pm

Post » Tue Jun 19, 2012 9:24 pm

Problem Conqured
User avatar
Ashley Hill
 
Posts: 3516
Joined: Tue Jul 04, 2006 5:27 am

Post » Tue Jun 19, 2012 2:44 pm

Did you try a clean save? (Grasping at straws here)
User avatar
Jeneene Hunte
 
Posts: 3478
Joined: Mon Sep 11, 2006 3:18 pm

Post » Tue Jun 19, 2012 4:53 pm

Problem Conqured
User avatar
Arrogant SId
 
Posts: 3366
Joined: Sat May 19, 2007 11:39 am

PreviousNext

Return to V - Skyrim