SetWorldModelPath - Form: Difference between revisions
Jump to navigation
Jump to search
→Examples
imported>Mofakin (Created page with "Category:Scripting Category:Papyrus Category:SKSE '''SKSE Member of:''' Form Script Sets the world model of the form. (This function requires SKSE) == Syntax...") |
imported>Mofakin |
||
| Line 24: | Line 24: | ||
</source> | </source> | ||
<br> | <br> | ||
<source lang="papyrus"> | |||
; example on how to set up maintenance code in order to replace world model on loading a game, with the one applied before saving the game | |||
; this example uses SkyUI menu option to replace world models via MCM menu | |||
; as long as you did not place any objects in the game world while executing SetWorldModelPath in any of your scripts, you don't necessarily need maintenance code | |||
Function MaintenanceSection() | |||
SetMenuOptionValue(MarkerModel, MarkerList[MarkerModelIndex]) | |||
If MarkerModelIndex == 0 | |||
; do stuff | |||
ElseIf MarkerModelIndex == 1 | |||
Int iIndex = MTW_WayStoneFormList.GetSize(); get all ObjectReferences of base object via array | |||
While iIndex | |||
iIndex -= 1 | |||
ObjectReference WaystoneRef = MTW_WayStoneFormList.GetAt(iIndex) as ObjectReference | |||
Utility.Wait(0.25); script latency troubleshoot | |||
WaystoneRef.disable(); needs to be disabled and reenabled in order to properly work on already plaaced instances in the game world | |||
MTW_Sign01.SetWorldModelPath("PointOfInterest/NorHitchPost01.nif") | |||
WaystoneRef.enable(); don't forget to reenable | |||
EndWhile | |||
ElseIf MarkerModelIndex == 2 | |||
; do stuff | |||
EndIf | |||
EndFunction | |||
</source> | |||
== Notes == | == Notes == | ||