"Equipitem" failing to compile

Post » Mon Mar 25, 2013 3:34 am

I'm working on a little nostalgic mod, and part of it requires giving an actor a pair of shoes. I have added a line to give him the shoes (and it compiles perfectly fine)
Alias_basksinthesunref.GetReference().Additem (ArmorIronBoots, 1)
But when I try to get him to equip it with the following:
Alias_basksinthesunref.GetReference().Equipitem (ArmorIronBoots, true)
I get this as an error in the compiler:
Equipitem is not a function or does not exist
Does anyone know what's wrong or how to fix it?
User avatar
Vickey Martinez
 
Posts: 3455
Joined: Thu Apr 19, 2007 5:58 am

Post » Sun Mar 24, 2013 10:44 pm

You have to cast GetReference() to an Actor, otherwise I think it treats it as an ObjectReference.

Actor BaskRef = Alias_bask.GetReference() as  ActorBaskRef.AddItem(ArmorIronBoots)BaskRef.EquipItem(ArmorIronBoots)
User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am

Post » Sun Mar 24, 2013 9:12 pm

From this page: http://www.creationkit.com/EquipItem_-_Actor

Don't you have a space too many in your line?
User avatar
JERMAINE VIDAURRI
 
Posts: 3382
Joined: Tue Dec 04, 2007 9:06 am

Post » Sun Mar 24, 2013 7:27 pm

Yeh, after the EquipItem you've got a space before the brackets, get rid of it

myactor_alias.GetReference().EquipItem(myItem, true)

EDIT: or if that doesn't make a difference try http://www.creationkit.com/GetActorReference_-_ReferenceAlias

Or

(myActor_Alias.GetReference() as Actor).EquipItem(myItem, true)

- Hypno
User avatar
saxon
 
Posts: 3376
Joined: Wed Sep 19, 2007 2:45 am

Post » Mon Mar 25, 2013 1:11 am

The http://www.creationkit.com/GetActorReference_-_ReferenceAlias function basicly just contains this:
Actor Function GetActorReference()return GetReference() as Actorendfunction
And it's faster to use GetReference() as Actor directly on the alias. I would always recommend doing so.
User avatar
Conor Byrne
 
Posts: 3411
Joined: Wed Jul 11, 2007 3:37 pm

Post » Mon Mar 25, 2013 9:07 am

or if that doesn't make a difference try GetActorReference()

- Hypno

That seemed to work. At least, it compiled alright. I'll get back to you if it works, because I seem to have run into another problem.
User avatar
saharen beauty
 
Posts: 3456
Joined: Wed Nov 22, 2006 12:54 am

Post » Mon Mar 25, 2013 3:26 am

Okay, it worked :)
User avatar
Harinder Ghag
 
Posts: 3405
Joined: Wed Jan 17, 2007 11:26 am


Return to V - Skyrim