rjhelms84 Posted January 30, 2014 Share Posted January 30, 2014 Actually, ignore most of what I just wrote! It's a lot easier than that! You can reuse the same script with the Add button, and just set the properties to point to a different reference in your subsequent activators, as the properties need to be set for each activator individually. So you can simply set your gate property to point to the specific gate you want, in the properties window of each activator. Link to comment Share on other sites More sharing options...
AzerDraco Posted January 30, 2014 Author Share Posted January 30, 2014 That is awesome. Now, what about the timer mechanism variables? Is there a way to make them private, to where ONLY the script running them sees them? In Java, setting a variable private means that any classes looking for that variable need to "ask permission" to access it. This is what I want to do, to where the Timer Count on one gate will continue to run and not be accessed by any other gate activation. I'm looking to make the gates open immediately as the player enters the trigger, then have a roughly 3 to 5 second cooldown before the gate closes again. This is to prevent players from trying to "break" the gate (Which I WILL be attempting in due course.), but also adds a bit of immersion because I want to add the whole "Dwemer Steam Hiss" sounds to the gates as well... The code is coming along slowly ... syntax is a pain when you aren't exactly sure of the rules.Ah well ... at least I'm getting a bit better at it. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 30, 2014 Share Posted January 30, 2014 All local variables on the script can and usually do contain different values per instance of an object running the script. So your timer variable would be unique to that instance without any special work on your part. A local variable is one that you define and modify within the script but usually is not set up as a property. For an example of a local variable used on a script in use by multiple instances please see my Random Mining mod. There I use local variables to determine a random value and then modify the real value which was property/default assigned. Probably clear as mud but perhaps it might help. Link to comment Share on other sites More sharing options...
rjhelms84 Posted January 30, 2014 Share Posted January 30, 2014 Yeah, like Ishara says, each trigger has its own separate instance/version of the script, so practically speaking they each have a different script. Link to comment Share on other sites More sharing options...
AzerDraco Posted January 30, 2014 Author Share Posted January 30, 2014 Thanks Ishara. I checked out your Mining Mod before ... very interesting. I have always thought that the ore inside mines should not run out..... but then, I'm not a player to start mining Ebony in a mine like that and let the game run for days on end........ So the local variables are all unique instances... Well, that means that my doors will behave like I want them to. Lights too. Both will have a timer that can be interrupted for their scripts when the player leaves the trigger zone. Thank you to those that have helped so far, and thank you in advance to those that would drop suggestions, bits of code, or even just links to references that can help a fledgling script writer. Now I'm off to start piecing together code and test my triggers... Link to comment Share on other sites More sharing options...
Recommended Posts