Place an object as initially "disabled"

Post » Mon Nov 19, 2012 8:33 am

Hey guys. I have a working script for a fetch quest that chooses a pelt at random, and records the inventory changes on the player for that pelt, tracking it's count as a X number out of X number.

How it works in my script, is after the script has chosen what pelt to use, it places a sample of it at an X Marker, and then tells the quest alias what it is, so the quest can track it. Video of how it works here - http://www.youtube.com/watch?v=Tgm5O5BR7Pw. It also chooses at random how many to get, but that's nothing to do with my next idea.

What I'm looking at doing is maybe implementing a series of random Kill Animal quests, using my existing system for random pelts. This will save me time designing each one individually, and will help make a dozen little quests to fill the gaps between big ones. Here is the snippet of script which chooses the object, and places the chosen pelt on the marker:

Spoiler

Function Startup()TargetCount = Utility.RandomInt(MinSkins, MaxSkins)HISJL1RWHideTotal.value = http://forums.bethsoft.com/topic/1410316-place-an-object-as-initially-disabled/TargetCountfloat CurrentCount = Game.GetPlayer().GetItemCount(TargetSkins)HISJL1RWHideCount.Value = CurrentCountUpdateCurrentInstanceGlobal(HISJL1RWHideCount)UpdateCurrentInstanceGlobal(HISJL1RWHideTotal)TargetSkinsIndex = Utility.RandomInt(1, 3)if	 (TargetSkinsIndex == 1)TargetSkins = GoatHideelseif (TargetSkinsIndex == 2)TargetSkins = DeerHideelseif (TargetSkinsIndex == 3)TargetSkins = CowHideelseTargetSkinsIndex = 1TargetSkins = GoatHideendifif (TargetCount <= 0)TargetCount = 10endif	   HISJL1RWHideActual.SetValue(TargetSkinsIndex)ObjectReference pelt = SamplePeltSpawnPoint.GetReference().PlaceAtMe(TargetSkins)SamplePelt.ForceRefTo(pelt)	  SetStage(10)endFunction

At the bottom is the bits of code that place the chosen pelt. Now it would be really easy I believe to substitute TargetSkins (whatever Pelt the script chooses) for an Actor, for example EncWolf, or EncBear. And instead of the marker being in a hidden interior cell away from view, the marker could be out in the world. When the script chooses an animal, it places it on the marker, and tells you to kill it.

My question (although it took a while for me to get there) is how do I place the object as initially disabled, so that I can later use a Alias_Animal1.GetReference().Enable() script to enable to object? Is that even possible? The reason is because if I place the animal near a public area, it could very well be dead by the time the player reaches it. Also if I want to add "tracking" along the way, I only want the animal to exist after a certain point in the quest.

Thanks for the help guys :smile:
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Mon Nov 19, 2012 12:32 am

Actually, thinking about it, if it isn't possible I could just disable the Alias straight away, and then enable it later when I want to.
User avatar
Krista Belle Davis
 
Posts: 3405
Joined: Tue Aug 22, 2006 3:00 am

Post » Sun Nov 18, 2012 8:38 pm

Just place your actor in the world, double click it, then tick the "initially disabled" box. Shimplez :D

Then you can use Alias_Animal.http://www.creationkit.com/TryToEnable_-_ReferenceAlias

- Hypno
User avatar
Laura Hicks
 
Posts: 3395
Joined: Wed Jun 06, 2007 9:21 am

Post » Mon Nov 19, 2012 8:42 am

Just place your actor in the world, double click it, then tick the "initially disabled" box. Shimplez :biggrin:

Then you can use Alias_Animal.http://www.creationkit.com/TryToEnable_-_ReferenceAlias

- Hypno

Noooo it's the script which places the object on the x marker (it pulls this object out of thin air), and I wanted to place a "disabled" object. I can tick a box for an actor that exists, but my object that get's placed is born into existence, much like the Whale in Hitchhikers Guide :tongue: I'll just use my workaround :wink:
User avatar
sunny lovett
 
Posts: 3388
Joined: Thu Dec 07, 2006 4:59 am

Post » Mon Nov 19, 2012 10:26 am

http://www.creationkit.com/PlaceAtMe_-_ObjectReference(Form akFormToPlace, int aiCount = 1, bool abForcePersist = false, bool abInitiallyDisabled = false)

So something like:
PlaceAtMe(TargetSkins, 1, False, True)
User avatar
Penny Courture
 
Posts: 3438
Joined: Sat Dec 23, 2006 11:59 pm


Return to V - Skyrim