Jump to content

[LE] Help needed with activator script


TyburnKetch

Recommended Posts

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

Testing Update

I have managed to get the two activators talking to each other by another method by using this basic default script (adapted) and linked referencing (no activate parent) to the other activator that has the spell effect attached:

 

 

Scriptname THActivateLinkedChestDummyScript extends ObjectReference


EVENT onActivate(objectReference akActivator)
; debug.trace("Sending "+getLInkedRef()+" an activate from "+akActivator)
if (akActivator as Actor) == game.getPlayer()
getLinkedRef().activate(akActivator)
endif
endEVENT

 

 

Simple spell effect script on the other activator (dummy INT activator):

 

 

Scriptname THPortalTest extends ObjectReference

Spell Property zap auto

ObjectReference Property TargetLocation0 auto
ObjectReference Property TargetLocation1 auto

Event OnActivate(ObjectReference akActionRef)

zap.Cast(TargetLocation0, TargetLocation1)

EndEvent

 

 

The zap is my THPortalGateEffect3 spell (simply shoots lightning constantly and aimed) - (I thought i'd test syntax changing the named spell to just zap)

 

But Again - it only works if the activators are in the same cell.

 

I'm still unsure what this means. Why can't i activate a spell/script from one cell to another? Is it to do with loading a cell? - Like I say, having tested a simple portculis activation from the activator in my INT cell to the portculis activator in my EXT cell - and it working great - I know activation from one of my cells to the other can work - just not this bloody spell (or any spell it seems that i attach to this script)!

Edited by TyburnKetch
Link to comment
Share on other sites

Hi. Sorry. What do you mean?

 

Yes. The cells are linked and loaded through load doors.

 

I meant are both the cells you're trying to work with loaded and in memory at the same time: i.e. if you call Is3DLoaded() on objects within either cell you will receive "true" as a result.

Link to comment
Share on other sites

 

Hi. Sorry. What do you mean?

 

Yes. The cells are linked and loaded through load doors.

 

I meant are both the cells you're trying to work with loaded and in memory at the same time: i.e. if you call Is3DLoaded() on objects within either cell you will receive "true" as a result.

 

So I've altered the script that activates it's linked ref (i'm still using this instead of activate parent - not sure it makes a difference) to include a check on is3dloaded.

 

The result was the else firing (two xmarkers placed in the EXT cell with the Activator - the 2nd Spell, THPortalGateSpell, fired) - so i presume the 3d on the INT activator is not firing. Is this correct?

 

 

Scriptname THActivateLinkedChestDummyScript extends ObjectReference

 

Spell Property THPortalGateSpell3 auto

Spell Property THPortalGateSpell auto

ObjectReference Property TargetLocation0 auto

ObjectReference Property TargetLocation1 auto

 

bool Function Is3DLoaded() Native

 

EVENT onActivate(objectReference akActivator)

; debug.trace("Sending "+getLInkedRef()+" an activate from "+akActivator)

if (akActivator as Actor) == game.getPlayer()

getLinkedRef().activate(akActivator)

if getLinkedRef().Is3DLoaded()

THPortalGateSpell3.Cast(TargetLocation0, TargetLocation1)

else

THPortalGateSpell.Cast(TargetLocation0, TargetLocation1)

 

endif

endif

endEVENT

 

Link to comment
Share on other sites

Is3DLoaded is already declared and implemented for you. Any function that is listed on the CK wiki for the kind of script object you are extending does not need to be re-defined in your script unless you are specifically seeking to change its normal behaviour, something you need to be cautious about doing. I'm not sure I can trust your test because Is3DLoaded() might not be working as expected as a result.

 

However if the else-branch is being triggered, it suggests the cell the linked activator is in is not being loaded. That in turn would explain a number of your issues.

Link to comment
Share on other sites

Ok. Thank you.

 

How do I get a cell to load remotely / why is this happening? (It goes both ways - in and out of my INT cell) or can I jig in a workaround with some script?

 

Could this be linked to a room bound / portal issue? I have no experience of working with these yet.

 

Could it have something to do with how I load into the game to test? I always Coc which I gather is correct. I have never used any saves.

 

Is the .cast function the problem?

 

I feel like I am staring down a rabbit hole atm ...

Edited by TyburnKetch
Link to comment
Share on other sites

I am painfully aware of the black hole missing from my extremely limited modding experience and now it seems is the time to address it.

Next time I get the chance I will be looking into papyrus error logs. I realise it had to happen at some point and here it is.

I have not had the chance to test this yet but having read somewhere that the unofficial patch may address my issue I am eager to ask if you think that may help? I obviously have it ... I do not load it when I am modding however.

 

Edit*

For some reason I actually have been running the unofficial patch ingame (think i forgot to uninstall it after testing it for a well rested bonus) (not loaded in CK) - so it doesn't help this particular issue.

Edited by TyburnKetch
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...