linking three objectreferences

Post » Tue Nov 20, 2012 9:13 am

I have one activator who crates two other activators. They will disable and enable each other so they need to know each other ObjectReferences. The original activator must know the ObjectReferences to delete them.

Activator Property act1 AutoActivator Property act2 AutoObjectReference Property act1ref AutoObjectReference Property act2ref AutoFunction createobject()	act1ref  = Placeatme(act1 )	act2ref  = Placeatme(act2 )   ;trying to link	act1ref.linktoother.setvalue(act2ref)	act2ref.linktoother.setvalue(act1ref)	act2ref.disable()endfunction
This fails,


: linktoother is not a property on script objectreference or one of its parents

However linktoother is an objectreference in each of the two new activators.
ObjectReference Property linktoother Auto

act1 and act2 is linked to the two activator objects.
Any idea that is wrong?
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Tue Nov 20, 2012 9:33 am

If they are activators, why are you using PlaceAtMe?

Wouldn't it be better to use Enable and Disable?

Place all three activators, and set the other two as 'initially disabled'.
The master activator then links to the other two activators as ObjectReferences.

You then can enable or disable the other two activators when-ever you want, based on your conditions in the master activator. You did not say much about what you are doing with them.
User avatar
Rhi Edwards
 
Posts: 3453
Joined: Fri Jul 28, 2006 1:42 am

Post » Tue Nov 20, 2012 1:15 am

If they are activators, why are you using PlaceAtMe?

Wouldn't it be better to use Enable and Disable?

Place all three activators, and set the other two as 'initially disabled'.
The master activator then links to the other two activators as ObjectReferences.

You then can enable or disable the other two activators when-ever you want, based on your conditions in the master activator. You did not say much about what you are doing with them.
It's an farming mod, the first activator is an mound of fertile soil created by the player, normal plants is just one object controlled by the soil, however crimson nirnroot is two activators, the grown plant and the harvested plant.
Then the grown plant is activated/ harvested it give you an nirnroot, enables the harvested plant object and disables it's self, the harvested plant start an countdown and enables the grown plant and disables its self then its time to regrow.

My first try was to create the harvested plant and delete the grown on harvest and to the opposite then regrown, dirty and no way to access the soil interface and delete the plant.
I could just use enable and disable, then the soil would know both referances and can delete them, however then the plants need to know each other as I has no way of telling grownnirnrootref about harvestednirnrootref and opposite.
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Tue Nov 20, 2012 3:34 am

In my Levelers Tower mod, I have two planters with harvestable Nirnroot. It also allows you to water it, and it grows back quickly (5 seconds). I also included options to turn the sound off permanantly, or have the sound come back with the grown plant.

I control the entire process with a trigger zone set to user activation.
User avatar
Cartoon
 
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm

Post » Mon Nov 19, 2012 10:49 pm

Solved it an simpler way with simply recolor the nirnroot plant model from heartfire.
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Tue Nov 20, 2012 8:16 am

You need to cast actXref as the script you put on the activators. But then still may have problem, I had a similar situation, look here:
http://www.gamesas.com/topic/1413703-reference-from-referencealias-with-fill-type-create-cant-be-casted-to-the-type-i-know-it-is/page__fromsearch__1
User avatar
Invasion's
 
Posts: 3546
Joined: Fri Aug 18, 2006 6:09 pm


Return to V - Skyrim