Adras Posted February 12, 2005 Share Posted February 12, 2005 Anyone know how to do a simple script that will make a wall move to the side when it is clicked on? I'm working on a mod and just need this quick script. If you could even put it right here on the forums, it would be much appreciated! Link to comment Share on other sites More sharing options...
Kevin Woodman Posted February 12, 2005 Share Posted February 12, 2005 I'm new to morrowind, and am just now learning scripting, I haven't even played that much of the game, i probably have no business tinkering with it but, I think that the move command will do that. the move command moves it on the objects axis, (positive y moves it forward, z up, ) format being: Move axis x/y/z , units example: WallObjectID -> Move x, 10 should move it to the side by 10 the MOVEWORLD command moves along the world's axis, north, east, up, x,y,z's (regardless of what way it's facing.) and i think you'll need some kind of a, if activateyou might have to make a new object in activators, and use the wall's model (NIF file) Do you need the wall to move back? if so, like a door when clicked on, or automatically go back after a short time? Anyway I'm probably just wasting space as I'm still just theorizing I was just researching something similar, i'm trying to make a 'trap door' that opens up underneath you making you fall down to a lower level, using GetStandingPC == 1 or something. Someone who knows what they're taklking about want to help Adras out? Link to comment Share on other sites More sharing options...
Adras Posted February 12, 2005 Author Share Posted February 12, 2005 Heh, thanks, I'll try that out. You know more about scripting than me. Link to comment Share on other sites More sharing options...
Abramul Posted February 12, 2005 Share Posted February 12, 2005 Err...one thing to bear in mind, though. 10 is a TINY amount. try 500 or so...not sure just how much it is, though. Link to comment Share on other sites More sharing options...
Kevin Woodman Posted February 13, 2005 Share Posted February 13, 2005 I just found what the game units are 1 game unit = 0.56 inches = 1.42 cm50 = 28 inches500 = 23.3 feet5000 = 233.3 feet8192 = 385 feet = 116.33 meters = 1 game cell From- Morrowind Scripting for Dummies 8th edition by GhanBuriGhan it also had a script example using a timer to make objects slowly move, I'm still overwhemed at this point, I haven't programmed since i was a kid, but it's not too different from what i can remember, i was also thinking if you want the wall to slide back on activation, you could use a global variable so the script knows which way to move it. as an example,if it's the left position set your variable to 1, if it's in the right position set it to 0. something LIKE, if ( on activation == 1 )if ( yourglobalvariable == 1 )wallobjectid -> move x, -50set yourglobalvariable to 0endifendif if ( on activation == 1 )if ( yourglobalvariable == 0 )wallobjectid -> move x, 50set yourglobalvariable to 1endifendif i might have the positive and negatives reversed. -and you need at the beginning- Begin YourScriptName -and at the end - EndEnd YourScriptName this might not work as-is but it should be a step in the right direction, or left, x-axis, or variable, i'm confusing myself. Link to comment Share on other sites More sharing options...
Adras Posted March 12, 2005 Author Share Posted March 12, 2005 Ok, I know this is an old topic, but I'm right here again. Using Kevin's example script: if ( on activation == 1 )if ( yourglobalvariable == 1 )wallobjectid -> move x, -50set yourglobalvariable to 0endifendif I need this from a very good scripter. Will that work? What I want to do is to have the PC click on, say a torch or something, and the wall will slide to the side, revealing a passage or something. I remember a house mod that I had long ago and you go into the armory and you can click on a shield or candle stick, then a trap door is revealed. I need something like that. And it will have to be able to move two objects, actually. I really need this soon. Before Sunday if at all possible! Link to comment Share on other sites More sharing options...
Kevin Woodman Posted March 12, 2005 Share Posted March 12, 2005 Actually you don't need a global variable, a short local variable will do. I Copy Pasted a real script from a working mod below that uses a switch to open the secret door(wall static). In this case the wall moved down and up, but that can be changed with x y or z. It also uses a timer so you can see the wall moving, instead of just instantly moving, and uses a sound file. Just cahnge the script name and make a new static and use it's ID in the script, and apply it to your new activater. I'm not sure if the sound file is a morrowind file or an addon in this script. I hope this helps. -------------------------------------------begin marcSwitch01 ; A switch that lowers the secret wall '_vl_atg_scrtwall'; to reveal a room.; Created by Viking_Lord for 'Anastasio The Greats Hideout' short Movingfloat Timershort ToggleSound if ( MenuMode == 1 ) returnendif if ( OnActivate == 1 ) if ( Moving == 0 ) set Moving to 1 set ToggleSound to 0elseif ( Moving == 2 ) set Moving to 3 set ToggleSound to 0endifendif ; Moving States:; 0 at close position; 1 moving from closed to open position; 2 at open position; 3 moving from open to closed position if ( Moving == 0 ) returnelseif ( Moving == 2 ) returnelseif ( Moving == 1 ) if ( ToggleSound == 0 ) PlaySound "endrumble" set ToggleSound to 1 endif"marcSecretWall"->MoveWorld Z, -100elseif ( Moving == 3 ) if ( ToggleSound == 0 ) PlaySound "endrumble" set ToggleSound to 1endif"marcSecretWall"->MoveWorld Z, 100endif if ( Timer > 4 ) set Timer to 0 if ( Moving == 1 ) set Moving to 2else set Moving to 0endifendif set Timer to ( Timer + GetSecondsPassed ) end Link to comment Share on other sites More sharing options...
Abramul Posted March 12, 2005 Share Posted March 12, 2005 The sound is part of the destroy helpless Mainquest creature sequence. ^^ the above is certified 100% spoiler free! Link to comment Share on other sites More sharing options...
Adras Posted March 12, 2005 Author Share Posted March 12, 2005 That script works absolutly great! Thanks so much. Link to comment Share on other sites More sharing options...
Adras Posted March 12, 2005 Author Share Posted March 12, 2005 Ok, after working with some of the stuff, I relized there is something that isnt working right. Is there any way you can add a timer to it so it closes after like 10 seconds or so? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.