NoM Posted September 26, 2004 Share Posted September 26, 2004 hey, well i'm new here.i'm a modder, but not realy good one, learning how to script.now i found a mod wit cheasts where the upper glass thing can go down.( i dont remember from who the script is)i edited it so it became a lift,now i only have one problem.after you activate the lift, it goes down nice and cool, but when its down, it goes up after some time, how can i make it that way that it stays down, until you activate it again? begin Liftfloat Timershort State if ( MenuMode == 1 )returnendif if ( OnActivate ==1 )if ( State == 0 )PlaySound "Door Stone Open"set State to 245endifendif if ( State >= 245 ) set timer to ( timer + GetSecondsPassed ) ;slide lid downif ( Timer < 15 )MoveWorld Z, -100 ;set back to startelseif ( Timer > 105 )SetAtStartset State to 0 ;can now press button againset Timer to 0 elseif ( Timer > 90 )if ( State == 245 )PlaySound "Door Stone Close"set State to 246endifMoveWorld Z, 100endifendif end this is the script.thank you already, when you can help me:) o and what is the hp, mp and exp thing? :Show you get exp?? Link to comment Share on other sites More sharing options...
Lethmoraa Posted September 26, 2004 Share Posted September 26, 2004 What you might do, is that when you click the button, it asks..."do you want to go down or up" -- down or up being the choices -- then depending on which one they click, it moves -100 or 100. Link to comment Share on other sites More sharing options...
NoM Posted September 27, 2004 Author Share Posted September 27, 2004 so uuhm<bla bla bla> if (onactivate == 1) MessageBox "do you want to go up or down", "up", "down"if (controlvar == 1) set button to GetButtonPressed if ( button == -1 ) moveworld Z, 100 <bla bla bla> else moveworld Z, -100 <bla bla bla> enz? edit:i edit a bit i made: begin House_wallfloat Timershort State if ( MenuMode == 1 )returnendif if ( OnActivate ==0 )(variable == 0 )setvariable 1PlaySound "Door Stone Open"endifendif set timer to ( timer + GetSecondsPassed ) if ( Timer < 15 )MoveWorld Z, -98 elseif ( Timer > 105 )SetAtStart set Timer to 0 if (onactive == 1 )(variable == 1 )setvariable 0playsound "door stone close"enddifmoveworld Z, 98endifendif endwill this work? :huh: :( i'm not realy good :( Link to comment Share on other sites More sharing options...
NoM Posted October 3, 2004 Author Share Posted October 3, 2004 hmm i did the button thing.only, it doesnt work all well.i only can press it once, then when i press again, nothing happens Link to comment Share on other sites More sharing options...
Serrieth Posted October 10, 2004 Share Posted October 10, 2004 Okay there is a way! I made a lift as well, when the player clicks on a button you need a variable that tells the script if the lift is going to go up or down. First you need 2 switchs, Different names. When the player clicks on one of them it will either make the player go up or down. Lets say the lift is at the bottom, and the player has no choice but to go up. Place a switch. Place a script within the switch.Before you add code go into the globals and add a new global variable called "States" Make it a SHORT. Now back to the switch, add a script and make the script say Begin Switch_1 Set States to 1;Up end now this will tell the computer that the lift must go up. There now must be a script within the moving object/Lift. Begin Lift1 Float Timer1 Short Done if (MenuMode == 1) return endif if ( states == 1);UP (down can be 2 or what ever but not 0) if (Done == 0 ) Set zp to "Start point" Set Done to 1 endif Move Z, 20 Set Timer1 to Timer1 + GetSecondsPassed if (Timer1 >= 1) Set zp to zp + 20 Set Timer1 to 0 endif if ( zp >= "Stop point") Set states to 0;Stop set zp to "Stop point" endif endif ****** endWhere the "*"s are is where you must add more code, to make it go up or down or what ever. Now let me explain the ZP, this variable determines when to stop the lift. Also remember that you must move the object to the spot that you want it to stop or start, take the X or Y or Z pos's and use those numbers in place of the "Stop point" or "Start point". This part of the code:if (Timer1 >= 1) Set zp to zp + 20 Set Timer1 to 0 endifWill determine how fast the ZP must count up, the "20" must be the same as the MOVE Z, num if not then the start and stop point will not work correctly. To move the object down besure the MOVE Z, num is a NEG numberExample: MOVE Z, -20 Now to get into the REAL WORLD type gravity, in real life, when an object is going up it will take longer, depending on its weight. When its moving up it will be slower than for it going down. So make it a NEG 30 or 40 to give it a better feel of an object trying to fight gravity. I really hope this gave you a better look at scripting and how to work with globals, because they ROCK! Now please remember I took alot of time helping you out. Please Quote this code I took time to do this so please give me some credit. Also remember that you can edit code, place sounds or lights or what ever :P If you continue to have problems please tell me :) Serrieth - NOW BEEN A MEMBER FOR almost A YEAR!!!!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.