TDL_Guvie Posted October 14, 2004 Share Posted October 14, 2004 I have an script that I need pretty badly. If you could write this out for me I would greatly appreciate it. I have a big stone static up against the wall of the imperial keep. I wanna make a script that attaches to a switch, when the switch is activated i want the big stone static to slide down into the ground revealing a hidden door behind it. Hope thats not to hard. --TDL_Guvie Link to comment Share on other sites More sharing options...
Serrieth Posted October 14, 2004 Author Share Posted October 14, 2004 No no no, this kind of script is very simple and fun!But before I get a draft of the script, you want a Static object to move? well this is imposible, Static objects cannot be changed, thats why they are STATIC. You need to make another object that is the same as your static object under the tab ACTIVATOR. Look up the mesh and load it into the object. Now we can place a script within that object. Now we need the switch, get any kind of switch you want, 'button recomended' and make a copy or a new switch. Copy as in use a switch in Morrowind and make a new switch. Now! The first thing we need to do is make a GLOBAL, just goto GamePlay -- Globals. Add a NEW global called "DoorState" Make this new Global a Short. The next thing we need to do is make a new script to put in the switch: Begin ActivateDoor If (OnActivate == 1) Set DoorState to 1;open door endif End Place the above script into the switch. Now for the door/stone or what ever. Begin MOVEDoor Float Timer Short ZP Short Sett if (MenuMode == 1) Return endif if (DoorState == 1) if (Sett == 0) Set ZP to "START POSITION" Set Sett to 1 endif Set Timer to Timer + GetSecondsPassed If (Timer >= "Number you want") NOTE THIS LINE AS NOTE 1 Move, Z 10;NOTE THIS LINE AS NOTE 2 Set Timer to 0 Set ZP to ZP + 10; NOTE THIS LINE AS NOTE 3 endif if (ZP >= "Stop position") Set DoorState to 0;Stop Movement Set Timer to 0 Set Sett to 0 endif endif End Now let me explain this script and hopfully this script WILL work. The Timer will have a speed set to is, remember that NOTE you took. Get NOTE 1if (Timer >= "Number you want") The number you WANT may not be the number YOU want. There are two constant numbers you must stick with. The Lines with NOTES 2 and 3 next to them must be constant. Example:Begin MOVEDoor Float Timer Short ZP Short Sett if (MenuMode == 1) Return endif if (DoorState == 1) if (Sett == 0) Set ZP to "START POSITION" You need to find the start Pos Set Sett to 1 endif Set Timer to Timer + GetSecondsPassed If (Timer >= 5); NOT SAME Move, Z 10;SAME Set Timer to 0 Set ZP to ZP + 10; SAME endif if (ZP >= "Stop position") You need to find the Finish Pos Set DoorState to 0;Stop Movement Set Timer to 0 Set Sett to 0 endif endif EndThe timer just allows the object to move more than just one little move. The ZP will keep the loop going until it reaches a position that it must stop at. Set the Timer to 1 then the MOVE, Z Alpha speed to 35 or higher, depending on how fast you want the object to move.You might have to play around with these numbers to get the movement you want.ALSO you need to play around with the positions, Like either useMove, X "Alpha speed"Move, Y "Alpha Speed"move, Z "Alpha Speed"Either one of these might work. If your not rotating the object then use Z. Hope this script works if not please tell me. Link to comment Share on other sites More sharing options...
Serrieth Posted October 16, 2004 Author Share Posted October 16, 2004 I just got an email saying, I am going to post his help here and send the email, if you have any other questions concering ENABLING please reply here. Hi I am having a little trouble with making a building build up after time. How can I make this happen? This is simple, the first thing you need to do is make a new GLOBAL variable.Goto GamePlay -- Globals and add a new variable called "BuildingState" Make this a SHORT. Now the next thing you need to do is create the stages used. If your going to use time then you must figure out how long it will take and how many stages the building is going to have. I am just going to give an example, you can edit the scriptings and make the length of each stage longer. The first thing I must do is create a new ACTIVATOR under the Tab 'Activator'Load the Mesh into your new object and name it "Building_01"Then create another activator and load the final mesh and name it "Building_02" Once you have the art you can place it in the Render window. Besure that both of the objects are on top of each other. So that when we see them they wont jump around on the screen. The first script will be placed in 'Building_01' We must first tell the program when to Enable its visibility. The Function to enable its visiblility is "Enable and Disable"Enable will make the object visible again and Disable will hide the object. Place this script in Building_01 Begin Building_State_01 if (BuildingState == 1);First Stage Enable else Disable endif End The next script will be exactly like the one above, just different names. Place this script in Building_02 Begin Building_State_02 if (BuildingState == 2);Second Stage Enable else Disable endif End Now to give a time scale to this building. We have declared when to Enable the stages and when to disable the stages, all we need to do is make it so that the building will start to build up in its stages on a time scale. This script will be a GLOBAL script. Do not place it inside of any object. Begin TIMESCALE Short CurrentDay Short DaysPassed Short Done if (MenuMode == 1) return endif if (Done == 0) Set CurrentDay to Day Set Done to 1 endif if (Done == 1) if ( CurrentDay != Day) Set DaysPassed to DaysPassed + 1 Set Done to 0 endif endif if (DaysPassed >= 3);Took 3 days to get to stage 1 Set BuildingState to 1 Set Done to 0 elseif (DaysPassed >= 6);Took 3 more days to get to stage 2 Set BuildingState to 2 Set Done to -1;Stop the script endif endif End Alright now that we have declared the time script you are ready to test your plugin file, I really hope this script helps you out and hopefully it will work. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.