Serrieth Posted January 16, 2004 Share Posted January 16, 2004 MOVEMENT falling objects This is a script that I will show to other people who have trouble with moving objects, this script is to make an object fall. (Just an example)******************************************************************Begin MoveRockDown if (MenuMode == 1)returnendif ; you must have at least two shorts to start short (currenttime)short (move)short donefloat zpos ; Moves the rock or itemfloat xposfloat ypos if (done = 1 )returnelseendif if ( "Anything to start the script or move the rock") set currenttime to Getsecondspassed set move to 1else returnendif if (currenttime != Getsecondspassed) set move to move + 1 set currenttime to Getsecondspassedendif if ( Move > (number you want) ) ; this is where the script stops the timer and you can do anything here, set move to 1 set zpos to (GetPos, Z) set xpos to (Getpos, X) ; this is where the movement comes in set ypos to (GetPos, Y) set xpos to xpos + "makes the object spin" set zpos to zpos + "How much you want to move the item or object up or down" Position (Item or object ID), xpos, ypos, zpos endif if ( GetPos, Z < "Point were the object must stop, Ground") set done to 1 set move to 0endif End***************************************************************** Functions, each function (Move and currenttime) determine the speed of the moving item. Matching (Not a scripting) IFMove = 1 and zpos = 1 THEN movement will be realistic and the speed will be slowIFMove = 2 and zpos = 1 THEN movement will be somewhat realistic but fast movingIFMove = 3 and zpos = 1 THEN movement will be somewhat realistic but very fastBut the higher the Move value is then the fast the item will fall and if the zpos is lower then the realistic of the item will show, I do not know what the values must be but that is up to you to decide how fast an item should fall if you have any suggestions of improvements to add to this code, or if there are any errors, please reply! Link to comment Share on other sites More sharing options...
Serrieth Posted January 16, 2004 Author Share Posted January 16, 2004 If you have any Questions on how to make or use scripting, please reply and I'll help you out!or if you have any other question obut TES CS please reply also Link to comment Share on other sites More sharing options...
Marxist ßastard Posted January 16, 2004 Share Posted January 16, 2004 Begin MoveRockDown if (MenuMode == 1)returnendif ; you must have at least two shorts to start short (currenttime)short (move)short donefloat zpos ; Moves the rock or itemfloat xposfloat ypos if (done = 1 )returnelseendif if ( "Anything to start the script or move the rock")set currenttime to Getsecondspassed ; This makes no sense -- first, you're setting a short variable equal to a float; global, and secondly, this can't be used for much other than a framecounter,; and an unreliable one at that because there could be two frames that take the; exact same time to show up. I believe you're confused with the usage of; GetSecondsPassed. This variable records how much time has passed since the; last frame, not how many seconds have passed since CharGen. set move to 1elsereturnendif if (currenttime != Getsecondspassed)set move to move + 1set currenttime to Getsecondspassed; Another float-to-short operationendif if ( Move > (number you want) ); this is where the script stops the timer and you can do anything here,set move to 1set zpos to (GetPos, Z)set xpos to (Getpos, X) ; this is where the movement comes inset ypos to (GetPos, Y)set xpos to xpos + "makes the object spin"set zpos to zpos + "How much you want to move the item or object up or down"Position (Item or object ID), xpos, ypos, zpos; I believe that the only commands that take variables as arguments at this point; are position ops that begin with "My"endif if ( GetPos, Z < "Point were the object must stop, Ground"); Neat trick to use here -- Tribunal's new collision detection commands. Using; them will make the movement much more realistic and will allow you to use; virtually random spin values set done to 1set move to 0endif End Link to comment Share on other sites More sharing options...
Serrieth Posted January 16, 2004 Author Share Posted January 16, 2004 Thanks maybe I do have getsecondspassed confused! Thanks for the advise I'll have to change it now. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.