PrincessBridget Posted March 13, 2011 Share Posted March 13, 2011 Hi. How do get a script to read a variable from a different script? Like example, say I have script1 and script2... I want script2 to be able to read a variable called cooldown from script1. But when I try it, it says "unknown command 'cooldown'!" Link to comment Share on other sites More sharing options...
fg109 Posted March 13, 2011 Share Posted March 13, 2011 Hi. How do get a script to read a variable from a different script? Like example, say I have script1 and script2... I want script2 to be able to read a variable called cooldown from script1. But when I try it, it says "unknown command 'cooldown'!" Let's say that script1 is attached to Quest1. To access it from script2, you need to use Quest1.cooldown. I know it works with scripts attached to quests since I've done that, and I've seen scripts from vanilla oblivion use variables from scripts attached to objects or NPCs. I don't think it works with magic scripts, but I don't know. Link to comment Share on other sites More sharing options...
PrettyMurky Posted March 13, 2011 Share Posted March 13, 2011 I think you can do it withlet x := sv_construct "Scriptname.Variablename"With a check that x != 0 after as well. Just to be safe. Link to comment Share on other sites More sharing options...
PrettyMurky Posted March 13, 2011 Share Posted March 13, 2011 Sorry, that should beSET x TO sv_constr... Link to comment Share on other sites More sharing options...
PrettyMurky Posted March 13, 2011 Share Posted March 13, 2011 Oh wait, you just want from another script, not from another script in another mod. So yeah, just what fg109 said. Link to comment Share on other sites More sharing options...
PrincessBridget Posted March 13, 2011 Author Share Posted March 13, 2011 Oh wait, you just want from another script, not from another script in another mod. So yeah, just what fg109 said. Yep but that would've been my next question eventually! :D Thank you both, I got it working with the quest thing! (I'm soon about to release my mod based on Stealth Camouflage from Metal Gear Solid) Link to comment Share on other sites More sharing options...
Recommended Posts