Jump to content

Created ref vs noncreated ref ? And other various questions.


markyrocks

Recommended Posts

Ok so obviously I know what a created ref is... cruising through the papyrus scripting reference as is tradition..I had seen the author(s) refer to some functions in terms of "this will only work on created refs". Can someone give me an example of how to manipulate a noncreatedref and maybe a quick explanation? I believe I tried casting an actor base as objectreference and the editor said they were incompatible... I'd really like to know if something like this is possible? Do I need to define an object reference in the script properties and leave it blank and try something similar?

 

I know by now you're probably thinking what am I doing? Losing my MIND. But for real I really want to know. If noone answers any questions I'd rather it be the above.

 

 

What else... O I've been playing with robots and I'd like someone to take a look at something for me. If I load up the ck and only select the main fo4.esp and dlc01. No other mods ect. If I then click on body part data, then find anything that involves Mr handy or dlc01 createabothandy ect. I get an error message that pops up that says something like "warning missing node data P-modslotb|0 doesn't exist in 3d data" or something like that. Can anyone else confirm that this does this for them? These handybots are a royal pita. I'm just wondering if this is part of the problem I'm having?

 

 

 

Any help would be great guys. Ty ty ty ty ty

Edited by markyrocks
Link to comment
Share on other sites

>" I believe I tried casting an actor base as objectreference and the editor said they were incompatible."

 

OK so this demonstrates the really poor language and documentation on the game engine object model ... no dear, its not you :)

 

An ActorBase refers to a form in the game database - ObjectWindow/Actors/Actor/CompanionPiper. This defines an object but does not appear in the running world. Typically (not always) this is static and edited in the UI, not through script in the running world.

 

An ObjectReference is an instantiation of an object definition form in the running game world. These can be hand placed in the render window (PiperREF), spawned by quest alias created fills or spawned in script by PlaceAtMe/PlaceActorAtMe. This is dynamic and modified with the ObjectReference Script in the running world.

 

An Actor is an enrichment or extension of an ObjectReference that is based on an ActorBase form to expose actor specific attributes (PiperREF as Actor).

 

> ObjectWindow/Actors/Actor/CompanionPiper (PiperREF as Actor).GetActorBase()

> ObjectReference PiperREF.ObjectReferenceScriptFunction()

> (PiperREF as Actor).ActorScriptFunction()

 

HTH

Link to comment
Share on other sites

The Actor wont exist until the ObjectReference does as Actor is the child of Object. Only the ActorBase Form will exist with limited script functions.

 

Don't plan on making any ObjectReference or Actor Script configuration calls unless or until it has been spawned in the world. It can be disabled, no problem, but a reference needs to exist.

 

You can define either ObjectReference or Actor properties, or both if making a lot of context calls to save casting (although I have zero benchmark info on the overhead of a cast, just keeps complex code cleaner):

ObjectReference Property pPlayerREF   Auto Const Mandatory ;this will autofill 
Actor           Property pPlayerACTOR Auto Const Mandatory ;this will not autofill

Since Actor script extends ObjectReference script one would assume that ObjectReference script calls will work on an Actor object, and most do. BUT THERE ARE SOME THAT DO NOT. I cant remember which but lost days trying to trace an edge condition that turned out to be an ObjectReference function that failed on an Actor, so I avoid this type of back parent;

pPlayerACTOR.ObjectReferenceFunction() 
Better is to fully qualify all function calls, else you will trip up over your own shoes at some point:
(pPlayerACTOR as ObjectReference).ObjectReferenceFunction()
Link to comment
Share on other sites

I'm totally guessing at your usecase or outcome, but consider spawning and instantly disabling, or create yourself a private worldspace room and spawn in there, or use one of the existing interior holding cells (Xmarker in MinutemenHoldingCell) and set your spawn to be a Ghost so anything already in there will leave them alone. You can configure reference/actor and when ready, MoveTo() target.

Link to comment
Share on other sites

The problem specifically is that I can spawn in a handy type robot with any mods I want but they have to be manually added to the object template of the actor base.

 

If I try to attachmod(mod) the bot basically turns to crap. If I attachmod() the robot automatically loses 2 arms, 2 eyes. Its almost like the node data changes from a handy type robot to a automatron which allows regular arms to be placed on the eye nodes.

 

I've been trying for the past 2 days to figure out a way to dynamically change the object template directly b4 instantation. Doesn't seem to be anyway to do this. That's why I was hoping I could run functions on a ref b4 creation. I'm pretty sure I tried disabling b4 the mod operation but I could always try it again.

 

Is there any way to specify which mod is priced from a mod collection? If I could do that it would probably solve the problem.

 

I was trying to figure out a way to make lvled lists with keywords to point at different mod configurations on the object template but I'd still need to make a bizzilion different configurations. I thought about putting the lvled list in the bot inventory but items in the bots inventory dont seem to do anything. Idk. Tough one.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...