Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

[OB] Using Triggerzone to invoke messageBox


KWITS
 Share

Recommended Posts

Good Day,

I have an innovative idea but putting it into practice is entirely, another matter. I can't get my Player to trigger a message response through a triggerzone. Why am I using a triggerzone for a NPC? My scenario is with a creature that by design, has no dialogue. Here is the script. Please help me to debug it.

scn WaVHauntedHallowsSCRIPT

Float Timer

Begin OnActivate

If ( GetStage WaVRescueMissionQuest == 40 ) && ( IsActionRef Player )

WaVHHCollisionBox02Ref.Enable

WaVHHPortalBarrier02Ref.Enable

set timer to timer + GetSecondsPassed

if timer >= 2

messageBox "Hault intruder, put down your weapon! There is no way out of this tomb but through me!"

endif

if timer == 8

messageBox "After two thousand years, you have managed to defeat my elite guard who swore on their death to avenge my betrayal!"

endif

if timer == 16

messageBox "You defeated one of my brothers. You knew him as Umaril but you will not find what you seek beyond this conversation."

endif

if timer == 20

messageBox "Before you, down the path behind me, was one of the greatest cities of Ayleid in the Golden Age of our Empire."

endif

if timer == 24

messageBox "Now my home is nothing more than a sunken ruin, forgetten in the ages of time. Umaril conspired with Lord Dread and betrayed the Ayleid Nation."

endif

if timer == 28

messageBox "It is here you must journey for to free yourself, you must first free my spirit and give me peace."

endif

if timer == 32

messageBox "Something precious, something that once was my source of power was taken from me by the minions of the Void."

endif

if timer == 36

messageBox "You will be searching for a soul crystal. Only with this object, will you find freedom for this accursed place."

endif

if timer == 40

messageBox "I see your doubts so someone who you know told me this, 'remember the Lady'. I a made a deal with her to save my soul from Umaril's fate."

endif

if timer == 44

messageBox "I will now allow you and you alone to pass. I will be awaiting your return. Evil greater than I dwells within deep."

endif

if timer == 60

playSound3D AMBEnchantmentBreakFinal

WaVHHCollisionBox02Ref.Disable

WaVHHPortalBarrier02Ref.Disable

WaVHHCollisionBox01Ref.Disable

WaVHHPortalBarrier01Ref.Disable

endif

Endif

End

Link to comment
Share on other sites

This:

Begin OnActivate
should be:
Begin OnTrigger Player

try that :)

EDIT:

There maybe other errors also, but I really don't remember much on OB scripting. .... Actually after I pasted this into NotePad and fixed the indention's I see a few errors off the bat...

1) I'm not sure a timer is the best thing to use for Message Box's. I'm not sure if the script will change the MB's automatically and if the player can't read fast enough, they might not be able to read it all. Another person will have to chime in on this just to make sure that I'm not lying :unsure:

Off the top of my head, I can not think of how this would be scripted better.

If the compiler throws an error, post the error up here, please

:)

Edited by DsoS
Link to comment
Share on other sites

Here is another scripted version but still no positive results. This should work.

scn WaVHauntedHallowsSCRIPT

Float Timer

Begin OnActivate Player

If ( GetStage WaVRescueMissionQuest == 40 )

WaVHHCollisionBox02Ref.Enable

WaVHHPortalBarrier02Ref.Enable

set timer to timer + GetSecondsPassed

if ( timer == 2 ) && ( timer < 14 )

messageBox "Hault intruder, put down your weapon! There is no way out of this tomb but through me!"

endif

if timer == 27

messageBox "After two thousand years, you have managed to defeat my elite guard who swore on their death to avenge my betrayal!"

endif

if timer == 39

messageBox "You defeated one of my brothers. You knew him as Umaril but you will not find what you seek beyond this conversation."

endif

if timer == 51

messageBox "Before you, down the path behind me, was one of the greatest cities of Ayleid in the Golden Age of our Empire."

endif

if timer == 75

messageBox "Now my home is nothing more than a sunken ruin, forgetten in the ages of time. Umaril conspired with Lord Dread and betrayed the Ayleid Nation."

endif

if timer == 87

messageBox "It is here you must journey for to free yourself, you must first free my spirit and give me peace."

endif

if timer == 99

messageBox "Something precious, something that once was my source of power was taken from me by the minions of the Void."

endif

if timer == 111

messageBox "You will be searching for a soul crystal. Only with this object, will you find freedom for this accursed place."

endif

if timer == 123

messageBox "I see your doubts so someone who you know told me this, 'remember the Lady'. I a made a deal with her to save my soul from Umaril's fate."

endif

if timer == 135

messageBox "I will now allow you and you alone to pass. I will be awaiting your return. Evil greater than I dwells within deep."

endif

if timer == 150

playSound3D AMBEnchantmentBreakFinal

WaVHHCollisionBox02Ref.Disable

WaVHHPortalBarrier02Ref.Disable

WaVHHCollisionBox01Ref.Disable

WaVHHPortalBarrier01Ref.Disable

endif

Endif

End

Link to comment
Share on other sites

Your script runs ONCE EVERY FPS CYCLE. Beginning to end.

GetSecondsPassed tells you how much time has passed since the last time the script ran. Usually in very small amounts, out to 4 decimal places.

But it will NOT work that great in an OnActivate block of code since it only runs ONE TIME when the object is activated. If you need looping, use a GameMode block. Your activate can set a variable, and when the variable is set, the GameMode can be instructed to work. Then you set the variable back to stop running the GameMode block of code.

Link to comment
Share on other sites

The trigger zone will only activate if a specific magic effect is used.

scn WaVICDarkPrisonTrigZoneANY02SCRIPT

; Activates linked Parent object once

; Any object will activate this (arrows, havok objects)

short triggered

ref target

ref mySelf

Begin OnMagicEffectHit FIDG

If ( GetStage WaVRescueMissionQuest == 30 )

Set triggered to 0

Endif

End

begin onTrigger

if triggered == 0 && ( GetStage WaVRescueMissionQuest == 30 )

WaVDarkPrisonGuard06Ref.Enable

WaVDarkPrisonGuard07Ref.Enable

set target to getParentRef

set mySelf to getSelf

target.activate mySelf 1

If ( WaVICDarkPrisonTrigZoneObject02Ref.IsMagicEffectOnTargetAllowed FIDG == 1 )

set triggered to 1

Endif

Endif

end

begin onReset

set triggered to 0

end

Link to comment
Share on other sites

No, I have used OnActivate to spawn a single message from a non-NPC entity like a creature or ghost. However, I just had an idea to make this process a bit easier. Although I don't understand why I could not use a looping timer to spawn delayed messages.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...