Jump to content

[LE] Help needed with activator script


TyburnKetch

Recommended Posts

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

Yes ... well ... I'm trying to.

 

When activated in the exterior cell I want the markers to fire in both the exterior and interior cell.

 

I've put the action into two scripts. I also tested with one script but it made no difference.

 

The activator only fires when the markers are in the same cell.

Link to comment
Share on other sites

Make one script that switches both markers at the same time or just one marker and have the other marker linked to that marker from its enable parent tab.

 

Double click the 2nd marker move down to enable parent tab and leave that open for now. Switch cells to the 1st marker and use the

[ select reference in render window ] button from your open tab ... click on the 1st marker and you're set. Now the 2nd Marker will follow the 1st marker's state perfectly.

 

Btw, I love that fake set up to give the illusion your seeing what's inside from the outside. Only all pros do that kind of stuff, so kudos on the outside the box way of thinking there.

You can learn how to program all you like but if you can't think outside the box like this it will never do you any good. ... Technique > General know-how ... to a programer.

Edited by NexusComa
Link to comment
Share on other sites

Bah ...

I still can't get it to work. I've put ALL the markers to fire from one script on the activator (EXT - where the actual portal is) and it doesn't work - I'm seeing no visuals from the INT cell. I have also enabled parent on the INT markers from the EXT markers and that's not working either.

Below is the script ( I STILL need to sort out Array's - apologies for the wall of script)

Scriptname THPortalActivator extends ObjectReference

Spell Property THPortalGateSpell auto
Spell Property THPortalGateSpell2 auto
Spell Property THPortalGateSpell3 auto
ObjectReference Property TargetLocationCentre0 auto
ObjectReference Property TargetLocationCentre1 auto
ObjectReference Property TargetLocationCentre2 auto
ObjectReference Property TargetLocationCentre3 auto
ObjectReference Property TargetLocationCentre4 auto
ObjectReference Property TargetLocationCentre5 auto
ObjectReference Property TargetLocationCentre6 auto
ObjectReference Property TargetLocationCentre7 auto
ObjectReference Property TargetLocation0 auto
ObjectReference Property TargetLocation1 auto
ObjectReference Property TargetLocation2 auto
ObjectReference Property TargetLocation3 auto
ObjectReference Property TargetLocation4 auto
ObjectReference Property TargetLocation5 auto
ObjectReference Property TargetLocation6 auto
ObjectReference Property TargetLocation7 auto
ObjectReference Property TriggerBox Auto
ObjectReference Property TargetLocationCentre0INT auto
ObjectReference Property TargetLocationCentre1INT auto
ObjectReference Property TargetLocationCentre2INT auto
ObjectReference Property TargetLocationCentre3INT auto
ObjectReference Property TargetLocationCentre4INT auto
ObjectReference Property TargetLocationCentre5INT auto
ObjectReference Property TargetLocationCentre6INT auto
ObjectReference Property TargetLocationCentre7INT auto
ObjectReference Property TargetLocation0INT auto
ObjectReference Property TargetLocation1INT auto
ObjectReference Property TargetLocation2INT auto
ObjectReference Property TargetLocation3INT auto
ObjectReference Property TargetLocation4INT auto
ObjectReference Property TargetLocation5INT auto
ObjectReference Property TargetLocation6INT auto
ObjectReference Property TargetLocation7INT auto


Auto State Off
Event OnActivate(ObjectReference akActionRef)
GotoState("On")
TriggerBox.enable()
THPortalGateSpell.Cast(TargetLocationCentre0, TargetLocation0)
THPortalGateSpell.Cast(TargetLocationCentre1, TargetLocation1)
THPortalGateSpell.Cast(TargetLocationCentre2, TargetLocation2)
THPortalGateSpell.Cast(TargetLocationCentre3, TargetLocation3)
THPortalGateSpell.Cast(TargetLocationCentre4, TargetLocation4)
THPortalGateSpell.Cast(TargetLocationCentre5, TargetLocation5)
THPortalGateSpell.Cast(TargetLocationCentre6, TargetLocation6)
THPortalGateSpell.Cast(TargetLocationCentre7, TargetLocation7)
THPortalGateSpell3.Cast(TargetLocation0, TargetLocation4)
THPortalGateSpell3.Cast(TargetLocation1, TargetLocation5)
THPortalGateSpell3.Cast(TargetLocation2, TargetLocation6)
THPortalGateSpell3.Cast(TargetLocation3, TargetLocation7)
THPortalGateSpell3.Cast(TargetLocation4, TargetLocation0)
THPortalGateSpell3.Cast(TargetLocation5, TargetLocation1)
THPortalGateSpell3.Cast(TargetLocation6, TargetLocation2)
THPortalGateSpell3.Cast(TargetLocation7, TargetLocation3)
THPortalGateSpell.Cast(TargetLocationCentre0INT, TargetLocation0INT)
THPortalGateSpell.Cast(TargetLocationCentre1INT, TargetLocation1INT)
THPortalGateSpell.Cast(TargetLocationCentre2INT, TargetLocation2INT)
THPortalGateSpell.Cast(TargetLocationCentre3INT, TargetLocation3INT)
THPortalGateSpell.Cast(TargetLocationCentre4INT, TargetLocation4INT)
THPortalGateSpell.Cast(TargetLocationCentre5INT, TargetLocation5INT)
THPortalGateSpell.Cast(TargetLocationCentre6INT, TargetLocation6INT)
THPortalGateSpell.Cast(TargetLocationCentre7INT, TargetLocation7INT)
THPortalGateSpell3.Cast(TargetLocation0INT, TargetLocation4INT)
THPortalGateSpell3.Cast(TargetLocation1INT, TargetLocation5INT)
THPortalGateSpell3.Cast(TargetLocation2INT, TargetLocation6INT)
THPortalGateSpell3.Cast(TargetLocation3INT, TargetLocation7INT)
THPortalGateSpell3.Cast(TargetLocation4INT, TargetLocation0INT)
THPortalGateSpell3.Cast(TargetLocation5INT, TargetLocation1INT)
THPortalGateSpell3.Cast(TargetLocation6INT, TargetLocation2INT)
THPortalGateSpell3.Cast(TargetLocation7INT, TargetLocation3INT)

EndEvent
EndState

State On
Event OnActivate(ObjectReference akActionRef)
GotoState("Off")
TriggerBox.disable()
THPortalGateSpell2.Cast(TargetLocationCentre0, TargetLocation0)
THPortalGateSpell2.Cast(TargetLocationCentre1, TargetLocation1)
THPortalGateSpell2.Cast(TargetLocationCentre2, TargetLocation2)
THPortalGateSpell2.Cast(TargetLocationCentre3, TargetLocation3)
THPortalGateSpell2.Cast(TargetLocationCentre4, TargetLocation4)
THPortalGateSpell2.Cast(TargetLocationCentre5, TargetLocation5)
THPortalGateSpell2.Cast(TargetLocationCentre6, TargetLocation6)
THPortalGateSpell2.Cast(TargetLocationCentre7, TargetLocation7)
THPortalGateSpell2.Cast(TargetLocation0, TargetLocation3)
THPortalGateSpell2.Cast(TargetLocation1, TargetLocation4)
THPortalGateSpell2.Cast(TargetLocation2, TargetLocation5)
THPortalGateSpell2.Cast(TargetLocation3, TargetLocation6)
THPortalGateSpell2.Cast(TargetLocation4, TargetLocation7)
THPortalGateSpell2.Cast(TargetLocation5, TargetLocation0)
THPortalGateSpell2.Cast(TargetLocation6, TargetLocation1)
THPortalGateSpell2.Cast(TargetLocation7, TargetLocation2)
THPortalGateSpell2.Cast(TargetLocationCentre0INT, TargetLocation0INT)
THPortalGateSpell2.Cast(TargetLocationCentre1INT, TargetLocation1INT)
THPortalGateSpell2.Cast(TargetLocationCentre2INT, TargetLocation2INT)
THPortalGateSpell2.Cast(TargetLocationCentre3INT, TargetLocation3INT)
THPortalGateSpell2.Cast(TargetLocationCentre4INT, TargetLocation4INT)
THPortalGateSpell2.Cast(TargetLocationCentre5INT, TargetLocation5INT)
THPortalGateSpell2.Cast(TargetLocationCentre6INT, TargetLocation6INT)
THPortalGateSpell2.Cast(TargetLocationCentre7INT, TargetLocation7INT)
THPortalGateSpell2.Cast(TargetLocation0INT, TargetLocation3INT)
THPortalGateSpell2.Cast(TargetLocation1INT, TargetLocation4INT)
THPortalGateSpell2.Cast(TargetLocation2INT, TargetLocation5INT)
THPortalGateSpell2.Cast(TargetLocation3INT, TargetLocation6INT)
THPortalGateSpell2.Cast(TargetLocation4INT, TargetLocation7INT)
THPortalGateSpell2.Cast(TargetLocation5INT, TargetLocation0INT)
THPortalGateSpell2.Cast(TargetLocation6INT, TargetLocation1INT)
THPortalGateSpell2.Cast(TargetLocation7INT, TargetLocation2INT)

EndEvent
EndState



All the properties are correctly set....

Edited by TyburnKetch
Link to comment
Share on other sites

Without recreating what you're doing and just looking at your script ... the part it says:

 

Event OnActivate(ObjectReference akActionRef)

GotoState("On")

 

or

 

Event OnActivate(ObjectReference akActionRef)

GotoState("Off")

 

The GotoState part will jump out of the current state and never even do anything under it. (am I wrong here) ...

Looks like to me the place you want that line is the one over EndEvent. And is this all triggering off a box activator ?

Once you disable that it will no longer fire a OnActivate.

 

Also, just wondering why is there so many spell casts in a row.

Edited by NexusComa
Link to comment
Share on other sites

When you're trouble shooting a script try using things like Debug.Notification("I made it pass the 1st test").

This is the part of programming the programmer took out when they was done you never see or it's remed out.

And a huge part of debugging a script. You will see the message top left of the screen in game.

 

Try dropping a few in and let the code talk to you ...

 

Debug.Notification("I'm waiting to be activated from the state on")

Event OnActivate(ObjectReference akActionRef)

Debug.Notification("I'm activated")

GotoState("Off")

Debug.Notification("Coma was wrong I'm passed the GotoState Off")

 

Keep in mind if you do to many the readout will skip any if they are the same message and/or coming in to fast.

The messages are on a timer and show for a few seconds. So it's easy for it to get way behind if the messages are

coming in fast. And like I said it will skip messages that are the same as the last one.

 

All programmer's do this in some fashion when debugging a script. Sometimes all you have to work with is a sound or beep

and you debug by how many beeps you hear ... :smile: There is a difference between a syntax error and a logic error.
Logic errors are much harder to weed out and need debugging.

 

I don't know how verced you are in programming but imagine a cursor moving down the code line by line.
Look at your code and trace that movement in your head. That is your program's flow. If the script jumps (in this case a goto)

then move with the jump as you trace out it's flow path.

Just because you wrote something in the script don't always mean it is being read or done at all if the program flow never reaches it.

 

There is also Debug.MessageBox("I'm just like a pop up ... whooowaaaa")

 

Also: Don't to hard on yourself papyrus as a language is far from a good choice when you're first learning how to program.

Edited by NexusComa
Link to comment
Share on other sites

Thank you very much for continuing to reply to my woes. I really appreciate it. I have literally just started modding (about 2 months ago)

 

I've just tried moving the GotoState line and it didn't make a difference (script is still working as intended on the EXT markers). You are completely right of course ... moving it to the bottom makes a lot more sense.

 

The script is working well on the actual (EXT) portal. All the spells are being fired from one xmarker to another around a ring (Portal Ring) The spells are all projectiles. I have 8 markers in the middle of the ring and eight around the outside. I am also firing 2 spells around them all. It is giving a wonderful effect.

 

The script now has ALL of the markers from the INT portal added to it - (which makes it look even worse - without Arrays)

 

The activator is just a pedstal bowl (originally an activator anyway) ... and like i say the script is working fine on the markers in the same cell as the activator (EXT - where the actual portal is). The triggerbox is behind the portal ring (it holds the teleport spells - and i needed to enable and disable it from the activator so the player wouldn't just be able to walk through the portal and trigger the teleport spells without first activating the portal - it works well)

 

I've tried so many different options - enable parent on the activator, on the markers, activate parents, new activators, different scripts (just the INT markers in a script), new markers ... the only time i have got the interior cell markers working was when (for testing purposes) i put an activator with a script pointing to the INT markers in the same cell as them (the INT cell)

 

Whenever the activator is in the EXT cell ... no matter what i do (enable parent etc) the INT markers just don't fire.

 

Is so weird.

 

Thank you for the advice on trouble shooting scripts with debug. I will start to use it.... but i feel this script should work. It works on the markers in the same cell as it ... sooo odd it doesnt on markers in another cell. Is the script missing something?

 

EDIT* Just ran another test using the same script on a new activator placed in the INT cell (same activator object) and the INT markers fired - but the EXT markers didn't. So it's going both ways. Only the markers in the cell the activators are in are firing.

 

Is this a cell setup issue? Both cells are named. The INT has a location, some lighting templates, selected audio (vanilla) I've also got an encounter zone in the INT cell. The EXT hasn't been edited bar giving it a cell name.

Edited by TyburnKetch
Link to comment
Share on other sites

hmmm. Is there some type of make sure the player hit the activator going on in any of the scripts or activators or activate on parent only check mark set ...

Maybe try linking the activators to each other so when one is used it triggers the other. With the Activate Parents tab.

Possibly the magic effects don't go off if your not in the cell. I would assume they do but I've never actually tested that.

Edited by NexusComa
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...