Complete Example Scripts: Difference between revisions
Jump to navigation
Jump to search
→A Trigger To Activate When Player Walks Through It: Updated capitalisation and parameter names to make the more in line with documentation
imported>Cipscis (Tried to make the first section a bit clearer, and added titles to the section containing actual examples) |
imported>Cipscis (→A Trigger To Activate When Player Walks Through It: Updated capitalisation and parameter names to make the more in line with documentation) |
||
| Line 17: | Line 17: | ||
===A Trigger | ===A Trigger That Detects When The Player Enters=== | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Scriptname ExampleTrigger extends ObjectReference | Scriptname ExampleTrigger extends ObjectReference | ||
Event | Event OnTriggerEnter(ObjectReference akActionRef) | ||
if(akActionRef == Game.GetPlayer()) ; This condition ensures that only the player will trigger this code | |||
if( | |||
Debug.MessageBox("Yippee!") | Debug.MessageBox("Yippee!") | ||
endif | endif | ||
EndEvent | |||
</source> | </source> | ||
| Line 58: | Line 53: | ||
* Non-player triggers can be used by changing the == to a != in the script above, to do things to other actors like restoring their health or moving them around (but not affecting player if player walks through the trigger) | * Non-player triggers can be used by changing the == to a != in the script above, to do things to other actors like restoring their health or moving them around (but not affecting player if player walks through the trigger) | ||
===A Fully Functional Dwemer Button=== | ===A Fully Functional Dwemer Button=== | ||