Jump to content

Linked Ref Scripting madness


DSoS

Recommended Posts

LinkedRef Madness

 

I don't even know anymore.

 

MarkerHeadings (Point A) is the Start and the XMarkers (Point B) is the End.

 

Each MarkerHeading is Linked Ref to the next one, for a chain.

 

XMarkers are linked only to their respective MarkerHeading

 

The Triggerzone is the, well, trigger to start the event.

 

Spell is fired from Point A to Point B for each MarkerHeading.

 

I have to figure out how to script this to fire off MySpell.Cast(???,???). Usually, with Cast you have a Start Point and End Point. However trying to setup GetLinkedRef / GetNthLinkedRef, I'm not sure how to get the Spell to fire at the proper End Point

 

Overall, at this point, I'm not even sure how many total Start Points I'll have in this cell.

 

My base script, which I use for single ref's is as follows:

Event OnTrigger(ObjectReference AkActor)
	if AkActor == Game.GetPlayer()
		if DoOnce == True 
			if Triggered == 0
				MySpell.Cast(SpellSource,SpellTarget)
				Utility.Wait(WaitTime)
				Triggered = 1
			EndIf
		ElseIf DoOnce == False
			MySpell.Cast(SpellSource,SpellTarget)
			Utility.Wait(WaitTime)
		EndIf
	Endif
	
EndEvent

But of course, really the only line here that I'll need is the MySpell.Cast(blah, blah).

 

I had a script setup slightly different for the Triggered == x but I stupidly closed out of it by mistake and didn't save and hit the yes to lose changes :peer: But that's simple to redo.

 

Anyway, my head is a total mess right now.

 

 

Anyone know of a way to do this?

Link to comment
Share on other sites

I'm just going to go the easy route and attach the following script to Point A objects.

Event OnCellAttach()
	myLinkedRef = GetLinkedRef() as ObjectReference
		MySpell.Cast(self,myLinkedRef)
		Utility.Wait(WaitTime)
	EndIf
EndEvent
Link to comment
Share on other sites

okay, I need a bit of help with my script.

 

When I go in game and COC to my cell, the fireballs only fire once and its done. They should fire continuously until the player leaves the cell.

 

I've used a variant of this script successfully, however it was a onTriggerEnter/Leave, this one does not use a triggerzone due to that I would have way too many of them.

Scriptname DSoSKzRuinsChrathurzchCastSpell extends ObjectReference  
{Attach to a XMarker and then Ref link to an XMarker to cast the spell.}

Spell Property MySpell Auto
{Spell to cast.}

; Float Property WaitTime Auto
; {Time to wait for the next cast. This may or may not work, it hasn't with other cast spell scripts.}

ObjectReference myLinkedRef

Event OnCellAttach()
	myLinkedRef = GetLinkedRef() as ObjectReference
		MySpell.Cast(self,myLinkedRef)
		;Utility.Wait(WaitTime)
EndEvent

How can I change this to tell the script to continuously fire MySpell?

 

I'm sure its something simple and my fogged brain isn't thinking about it or noticing it or whatever.

 

Thanks in advanced :D

Link to comment
Share on other sites

Haven't had to much experience with this, but there must be an answer close at hand.

Do you think it might fire if there's an OnUpdate form iimplemented. It can get a bit involved. Here's a sample script.

 

I saw that, but I think its a bit too much. I will have to link nearly 50 of these setups for what I'm doing. 

 

I'm going to try another way and I'll report back if it worked or not.

Link to comment
Share on other sites

Haven't had to much experience with this, but there must be an answer close at hand.

Do you think it might fire if there's an OnUpdate form iimplemented. It can get a bit involved. Here's a sample script.

 

I loaded that sample script into my mod and worked quite well.

 

Thank You for reminding me about it.

 

Here's a Blooper video from testing the initial properties settings :X

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...