Reference Alias cast as actor only executing some actor func

Post » Thu Jun 21, 2012 7:11 am

I don't understand this.


i have a filled ref alias, and the following 2 lines in my test code:

MyAlias.GetActorRef().EnableAI(False)
MyAlias.GetActorRef().OpenInventory(False)


script compiles, the first line executes (my Manny-me stands there like a statue, but she wont open her inventory)


i also tried this embedded in a function in a script attached to the alias, tried both ways: script extends actor and extends referencealias


scirpt always compiles but the openInventory and a couple of other actor functions do not ever execute. no error dumped in the logs either.
User avatar
Lilit Ager
 
Posts: 3444
Joined: Thu Nov 23, 2006 9:06 pm

Post » Thu Jun 21, 2012 1:07 am

Is the mannequin a player teammate? if not, you need to call openinventory(true) not false, as that means that the inventory opening won't be forced (by the way, it's the default flag) and in that case only player teammate's inventories are opened.
User avatar
Solina971
 
Posts: 3421
Joined: Thu Mar 29, 2007 6:40 am

Post » Thu Jun 21, 2012 7:13 am

the mannequin is a clone of myself. i already tried it both true and false

i'm wondering if it is not working because of factions or keywords

i really hope it's not because its a clone of myself, and its trying to access the base actor and not the object reference (which would be myself, i cant open my own inventory and trade with myself)
User avatar
Sun of Sammy
 
Posts: 3442
Joined: Mon Oct 22, 2007 3:38 pm

Post » Thu Jun 21, 2012 4:42 am

You could cast the returned data to a string and print it with one of the debug script commands, to ensure it's not returning the base character or the player reference. If it's the case it should return 7 or 14.

Maybe casting to actor could also do the trick: (MyAlias.GetActorRef() as actor).OpenInventory(True). It shouldn't be necessary, but you didn't lost anything trying.
User avatar
Oyuki Manson Lavey
 
Posts: 3438
Joined: Mon Aug 28, 2006 2:47 am

Post » Thu Jun 21, 2012 9:20 am

iva already debugged the formID to make sure its filling properly and it returns a FF-somenumber formID which means it's returning the reference.

but i don't know if OpenInventory is native to base actor (it shouldnt be but nothing surprises me anymore)


worst case scenario i will just use a 3rd party container. pain in the ass to retrofit the script to a non-actor container but i will just have to make-do if i cant get this to work
User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm

Post » Thu Jun 21, 2012 1:36 pm

I don't see any way of openinventory being native of baseactor. It wouldn't make any sense. You can find various instances of the same base actor ingame.
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Thu Jun 21, 2012 4:54 am

Wait a sec. Openinventory is not an actor function. It's an objectreference function.


EDIT: No. Sorry. Is an actor function.
User avatar
Flash
 
Posts: 3541
Joined: Fri Oct 13, 2006 3:24 pm

Post » Thu Jun 21, 2012 11:41 am

i tried it with the alias filled with a random actor, and it still wont open inventory

tried it with no alias, just a plain PlaceAtMe, and the reference will not open inventory.

i think the problem is because it's its a placed reference


i'm just going to have to use a hidden container and use the actor as a.... mannequin
User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Thu Jun 21, 2012 1:38 am

Did you tried casting to actor while placing the flag at true? (MyAlias.GetActorRef() as actor).OpenInventory(True)
I suppose it should work even if placed references usually can't be opened this way.
User avatar
louise tagg
 
Posts: 3394
Joined: Sun Aug 06, 2006 8:32 am

Post » Thu Jun 21, 2012 5:02 am

yeah just tried that. it does not work.


now i just hope it takes EquipItem or else my idea is effed
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Thu Jun 21, 2012 6:36 am

I have an idea. cast a spell on it with actor script attached. then try opening the inventory.

EDIT: Or equip that script on it any other way. Just to try it quickly, select the mannequin in the console and type aps actor. Now (despite the error message) use your method for accessing the inventory. If it works this way it will work if you assing the script in any other way.
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Wed Jun 20, 2012 11:20 pm

thanks for the suggestion, but this thing has already spilled out of control (currently 4 separate scripts) i dont want to complicate it further if i dont have to
User avatar
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm

Post » Thu Jun 21, 2012 2:03 pm

Any actor attached to a quest has the actor script attached. That's why I think it could work. If that's the case you won't be doing anything odd or cumbersome to the mannequin.
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Thu Jun 21, 2012 1:02 am

hmm, the APS test works, i will try it out. thanks
User avatar
Code Affinity
 
Posts: 3325
Joined: Wed Jun 13, 2007 11:11 am

Post » Thu Jun 21, 2012 7:50 am

wtf. now the original script works with the plain OpenInventory cast as actor. i didnt even change anything
User avatar
SEXY QUEEN
 
Posts: 3417
Joined: Mon Aug 13, 2007 7:54 pm

Post » Thu Jun 21, 2012 6:46 am

holy crap....

Manny-Me is now fully functional hahhahahahaha
User avatar
Catharine Krupinski
 
Posts: 3377
Joined: Sun Aug 12, 2007 3:39 pm

Post » Thu Jun 21, 2012 11:39 am

Glad to hear that :)
User avatar
Catherine N
 
Posts: 3407
Joined: Sat Jan 27, 2007 9:58 pm

Post » Wed Jun 20, 2012 11:18 pm

yeah, turns out in my stupidity, i for whatever reason thought OpenInventory defaulted at true, so i was testing OpenInventory() and OpenInventory(false) ... LOL

it was one one of those great face-palming moments
User avatar
Enny Labinjo
 
Posts: 3480
Joined: Tue Aug 01, 2006 3:04 pm

Post » Thu Jun 21, 2012 2:10 am

All of us had one of those now and then :)
User avatar
maddison
 
Posts: 3498
Joined: Sat Mar 10, 2007 9:22 pm


Return to V - Skyrim