Difference between revisions of "Talk:OnTrigger"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Antares
(→‎BlockType Behaviour: It would seem that OnTrigger and GameMode blocks clash within the same script)
imported>DragoonWraith
Line 16: Line 16:
::Further information on BlockType Behaviour for this function: It would seem that when you try to run a '''GameMode''' block '''inside''' a script that has an '''OnTrigger''' block they will conflict. I was pulling my hair out wondering why my OnTrigger wasn't being triggered, I removed my Gamemode block because I changed my method and the code within became redundant and voila! it was all better. Just thought this would be useful information.
::Further information on BlockType Behaviour for this function: It would seem that when you try to run a '''GameMode''' block '''inside''' a script that has an '''OnTrigger''' block they will conflict. I was pulling my hair out wondering why my OnTrigger wasn't being triggered, I removed my Gamemode block because I changed my method and the code within became redundant and voila! it was all better. Just thought this would be useful information.
::--[[User:Antares|Antares]] 02:46, 22 September 2008 (EDT)
::--[[User:Antares|Antares]] 02:46, 22 September 2008 (EDT)
:::OnTrigger (and OnTriggerActor) '''are''' Blocktypes. Blocktypes cannot be nested, i.e. nothing like this:
<dl><dd><dl><dd><dl><dd><pre>Begin GameMode
  Begin OnTrigger
    ;blah blah
  End
End</pre></dl></dl></dl>
:::but only something more like this:
<dl><dd><dl><dd><dl><dd><pre>Begin GameMode
  ;blah blah
End
Begin OnTrigger
  ;blah blah more
End</pre></dl></dl></dl>
:::I hope this clears that up for you? Or did you mean something else?
:::[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 11:10, 22 September 2008 (EDT)

Revision as of 10:10, 22 September 2008

Triggering Reference

How do you get a reference to the triggering object? I have setup a trigzone and want to retrieve a reference for the object responsible for the trigger. This object is added to the game dynamically.
--Antares 09:42, 7 September 2008 (EDT)

GetActionRef
Dragoon Wraith TALK 10:41, 7 September 2008 (EDT)
The Man, thanks DragoonWraith, I thought it would be something simple. I am updating the article "See Also" section for both OnTrigger and GetActionRef.
--Antares 22:36, 7 September 2008 (EDT)

BlockType Behaviour

It would appear that this function behaves like a GameMode block in that it won't run in other modes (MenuMode). I tried to use this function to circumvent an effectshader called on an object in GameMode from not being run in other modes. I needed a seperate script for this due to the dynamic nature of the object I was adding. I also needed a way to retrieve a reference to the dynamic object inside the seperate script so I thought creating a TrigZone and using an OnTrigger block would be the end of my problems, obviously not. OnLoad would work perfectly but I cannot see way to run OnLoad on a dynamic reference.
--Antares 23:34, 7 September 2008 (EDT)

Further information on BlockType Behaviour for this function: It would seem that when you try to run a GameMode block inside a script that has an OnTrigger block they will conflict. I was pulling my hair out wondering why my OnTrigger wasn't being triggered, I removed my Gamemode block because I changed my method and the code within became redundant and voila! it was all better. Just thought this would be useful information.
--Antares 02:46, 22 September 2008 (EDT)
OnTrigger (and OnTriggerActor) are Blocktypes. Blocktypes cannot be nested, i.e. nothing like this:
Begin GameMode
  Begin OnTrigger
    ;blah blah
  End
End
but only something more like this:
Begin GameMode

  ;blah blah

End

Begin OnTrigger

  ;blah blah more

End
I hope this clears that up for you? Or did you mean something else?
Dragoon Wraith TALK 11:10, 22 September 2008 (EDT)