Editing
SetWorldModelPath - Form
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Scripting]] [[Category:Papyrus]] [[Category:SKSE]] '''SKSE Member of:''' [[Form Script]] Sets the world model of the form. (This function requires SKSE) == Syntax == <syntaxhighlight lang="papyrus"> Function SetWorldModelPath(String Path) native </syntaxhighlight> == Parameters == *Path: the new world model for this form. == Return Value == *none == Examples == '''Setting up correct world model path properly''' <syntaxhighlight lang="papyrus"> ; Set 1st person iron sword static to use 1st person elven sword static world model, emerging from Data/Meshes 1stPersonIronSword.SetWorldModelPath("Weapons/Elven/1stPersonElvenSword.nif") ; Iron sword's now using the Elven sword world model! </syntaxhighlight> <br> '''How to execute maintenance code to apply changes on already placed instances of base object''' <syntaxhighlight 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 </syntaxhighlight> == Notes == * This function can only be applied to items that actually have a 'physical/visual' world model. * This will affect all instances of the passed form. * World Model changes will not be saved and must be maintained via a [[Complete_Example_Scripts#Maintenance.2Fupdate_code_which_runs_once_per_save_load_and_shows_a_message_when_a_mod_is_updated_or_first_loaded|maintenance setup]] or something similar. * In order to make it work, you'll need to use / (slash) instead of \ (backslash) == See Also == *[[Form Script]] *[[GetWorldModelPath - Form]]
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Landing page
Tutorials
Game Systems
Editor Reference
Scripting Reference
Recent changes
Help
Tools
What links here
Related changes
Special pages
Page information
Page values