IsharaMeradin Posted August 5, 2016 Share Posted August 5, 2016 Was just pointed out to me in another thread that it could be made even shorter. ObjectReference SomeObject Event OnInit() If Game.GetModByName("SomeMod.esp") != 255 SomeObject = (Game.GetFormFromFile(0x00123456,"SomeMod.esp") as ObjectReference) EndIf EndEvent @lofgrenYes, I think it should recognize the form and store it into the variable. I don't know about performing manipulations on it. But I'm fairly certain that the object will be stored into the variable. Link to comment Share on other sites More sharing options...
lofgren Posted August 5, 2016 Share Posted August 5, 2016 (edited) My guess is that it won't matter if it's an object you hasn't encountered before, but if it is something you have encountered then it will be reverted back to the way it appears in the CK, for example items in a container will be lost and the original position of anything that has moved will be restored. Again, just a guess. Edited August 5, 2016 by lofgren Link to comment Share on other sites More sharing options...
cdcooley Posted August 5, 2016 Share Posted August 5, 2016 ObjectReference SomeObject = (Game.GetFormFromFile(0x00123456,"SomeMod.esp") as ObjectReference) Just the GetFormFromFile code is sufficient to grab an object. If the mod isn't loaded you'll get a None value and log spam about the mod being missing. Avoiding the log spam is the only real benefit of using GetModByName first. If it works you'll get the form reference and if it's in a loaded cell it will be forced to be temporarily persistent just like any reference held in a script variable. If you use it on an object that isn't persistent and isn't in a currently loaded cell then you can get strange and unpredictable results if you run certain functions on it. Many things will simply fail until you actually go to item's original cell location. And you can also run into small but annoying quirks like having the object drop to the floor (or if you're really unlucky fly across the room) the first time you enter the cell that holds it. The CK forces the persistent flag on items you use in properties to make sure none of those quirks can happen with unloaded objects. Markers are the safest thing to target because they are always persistent and unique actors are also reasonably safe because they are semi-persistent too. Link to comment Share on other sites More sharing options...
MaxShadow09 Posted August 7, 2016 Share Posted August 7, 2016 (edited) Is there a way to copy a script with all its properties from one object and paste it in another? I have like 30 objects that use the same script, with almost the same properties, and adding them one by one is a pain, specially because the script list takes a moment to load. There's a .pas script for TES5Edit that copies VMAD records, but it copies the entire VMAD block from the source, and replaces the entire block from the destination. I only need to copy one script, and add it to another Form withour replacing anything. EDIT: As a workaround, I changed the property names to the name of the forms I need. At least now I can autoassign the values. Edited August 7, 2016 by MaxShadow09 Link to comment Share on other sites More sharing options...
Elias555 Posted August 18, 2016 Author Share Posted August 18, 2016 (edited) Is the VoiceSprintEffect1 script box empty for you? It's empty for me and I can't figure out how it works. I want to make a short dash out of it and temporarily make the player a ghost to make it look like the player went through the actor(is that the correct method?). Another question. What's the standard/safe way to add a perk when a spell tome or spell is used? I can do it with a script but is that the best way? Edited August 18, 2016 by Elias555 Link to comment Share on other sites More sharing options...
azraelb Posted August 18, 2016 Share Posted August 18, 2016 When I drag a light into the render window and change its intensity, color... then I only change this reference, not the light object itself right? Besides that, is it better to use vanilla lights when creating a mod or should I duplicate vanilla light objects and only use my own?Using my own lights and image spaces probably should be better as my interiors always will look exactly like I want, even if another mod does change lighting - am I right? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 18, 2016 Share Posted August 18, 2016 Is the VoiceSprintEffect1 script box empty for you? It's empty for me and I can't figure out how it works. I want to make a short dash out of it and temporarily make the player a ghost to make it look like the player went through the actor(is that the correct method?). Another question. What's the standard/safe way to add a perk when a spell tome or spell is used? I can do it with a script but is that the best way?VoiceSprintEffect1 script box is empty. It is given a magnitude value of 10 in the VoiceWhirlwindSprint1 spell. That value is most likely what controls how far the player moves with just the first effect. As far as the perk, under those two scenarios, script is probably best. OnRead event for the tome and scripted effect for the spell. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 18, 2016 Share Posted August 18, 2016 When I drag a light into the render window and change its intensity, color... then I only change this reference, not the light object itself right? Besides that, is it better to use vanilla lights when creating a mod or should I duplicate vanilla light objects and only use my own?Using my own lights and image spaces probably should be better as my interiors always will look exactly like I want, even if another mod does change lighting - am I right?Not made interior spaces, but you are right. If you have a specific look you desire, use your own lights and image spaces. Link to comment Share on other sites More sharing options...
Elias555 Posted August 18, 2016 Author Share Posted August 18, 2016 Is the VoiceSprintEffect1 script box empty for you? It's empty for me and I can't figure out how it works. I want to make a short dash out of it and temporarily make the player a ghost to make it look like the player went through the actor(is that the correct method?). Another question. What's the standard/safe way to add a perk when a spell tome or spell is used? I can do it with a script but is that the best way?VoiceSprintEffect1 script box is empty. It is given a magnitude value of 10 in the VoiceWhirlwindSprint1 spell. That value is most likely what controls how far the player moves with just the first effect. As far as the perk, under those two scenarios, script is probably best. OnRead event for the tome and scripted effect for the spell. So how does it work exactly? There's nothing in the mgef, projectile or spell. Must be hidden for some reason. I went with script. I didn't try OnRead but OnEquipped worked. Link to comment Share on other sites More sharing options...
lofgren Posted August 18, 2016 Share Posted August 18, 2016 Is the VoiceSprintEffect1 script box empty for you? It's empty for me and I can't figure out how it works. I want to make a short dash out of it and temporarily make the player a ghost to make it look like the player went through the actor(is that the correct method?). Another question. What's the standard/safe way to add a perk when a spell tome or spell is used? I can do it with a script but is that the best way?VoiceSprintEffect1 script box is empty. It is given a magnitude value of 10 in the VoiceWhirlwindSprint1 spell. That value is most likely what controls how far the player moves with just the first effect. As far as the perk, under those two scenarios, script is probably best. OnRead event for the tome and scripted effect for the spell. So how does it work exactly? There's nothing in the mgef, projectile or spell. Must be hidden for some reason. I went with script. I didn't try OnRead but OnEquipped worked. The effect itself does nothing. The animation graph detects which shout you have equipped and plays the proper animation. If you have the whirlwind sprint shout equipped, it plays the whirlwind sprint animation instead of the usual shout animation. You can see animations by going to Character -> Animations in the drop-down menu. For humanoid NPCs, select 0_Master. The shout animations are near the bottom of the 0_Master animation tree, but above the "loose" animations. Link to comment Share on other sites More sharing options...
Recommended Posts