Bang! NPC disappears replaced by a cow. How?

Post » Wed Oct 30, 2013 12:53 pm

Title is misleading I want to achieve this, not its happening and I don't know why. So NPC drinks a potion, couple of explosions follow and he is replaced by a cow (for now, this will be repeated). I have it up to a point where "Drink, bang, bang, he's gone" works using this fragment...

Alias_Jojalopy.GetRef().PlaceAtMe(ExpChange1)Utility.wait(0.3)Alias_Jojalopy.GetRef().PlaceAtMe(ExpChange2)Alias_Jojalopy.GetRef().Disable()

I added a cow as an alias (unique actor) and tried adding this line...

Alias_Jojalopy.GetRef().PlaceAtMe(Alias_cowjo.GetRef())

This doesn't work and the quest fails to load any Aliases. Thinking it could be a reference problem (Alias_Jojalopy now being disabled) I tried...

DrinkMarker.PlaceAtMe(Alias_cowjo.GetRef())

Same issue as above, no aliases loaded. I guess I could place the cow in game and disable it until it is required to be enabled but that still requires that it be placed exactly where Alias_Jojalopy was disabled. Even though Alias_Jojalopy doesn't move off his marker I fear the cow would wonder off and ruin the effect as after a short conversation with the cow/Jo'jalopy - Flash, bang, Wow! another beast appears...you see where I'm going.

User avatar
REVLUTIN
 
Posts: 3498
Joined: Tue Dec 26, 2006 8:44 pm

Post » Wed Oct 30, 2013 2:50 am

I dont know of any cows that are unique actors, so that's probably your problem - I bet the cow alias doesnt get filled properly with a cow, so there's no reference to placeAtMe. I would suggest instead just adding the cow actor as a property to your script.

Actor property EncCow auto;...Alias_Jojalopy.GetRef().PlaceAtMe(EncCow)

You can placeAtMe things using a disabled reference, so that's not a problem.

Edit: and don't forget to fill the EncCow property, of course - but you should just be able to hit Auto-Fill Properties for that one.

User avatar
suzan
 
Posts: 3329
Joined: Mon Jul 17, 2006 5:32 pm

Post » Tue Oct 29, 2013 10:47 pm

That should be an ActorBase property ;)

ActorBase Property EncCow Auto

When creating a reference with PlaceAtMe, I always recommend storing the reference in a variable, but this is difficult in quest fragments as you're operating mostly within functions, and function variables are cleared as soon as the code has finished running. I'd put complex code like this in a function in a manually written script attached to your quest (colloquially referred to as a 'quest script') and call that function from your fragment.

User avatar
Spencey!
 
Posts: 3221
Joined: Thu Aug 17, 2006 12:18 am


Return to V - Skyrim