Langerd Posted October 6, 2015 Posted October 6, 2015 I made the lever columnThe column and the lever is the doffrent MD3 . Maybe You will ask : Why not making simple MD3 animation.My answer - the animation in MD3 look laggy...My idea is to parent the lever model to the little clip brush that You see on the picture. After pressing the trigger that i want to make there the brush will rotate 45 degress (in the angle towards us). The model will be parent to this brush and i think (i hope it should) it will rotate with the brush that it is parented. The origin of the model is on the end of the lever not in the middle so it should rotate with the same origin as the brush.But my question how to do that? It requires script am i right?Help is appreciated
Asgarath83 Posted October 6, 2015 Posted October 6, 2015 1 set as func_static the physic clipp of the lever and link the lever to it2: build a trigger_multiple around the lever with two script: one that move down the lever, the other that move up of 45° every script also change the usescript of trigger_multiple so a time is executed the first that turn clipper and lever into position B, the second time the second script the move the lever and the clipper to position A.IMPORTANT: you need to put at the base of the lever a little cube brush textured with system\origin. and you need to convert as unique func_static entity the physic clip of the lever and the origin brush. in this mode, the lever rotate around the origin brush pivot.IMPORTANT 2: you need to use a misc_model, NOT a misc_model_static entity for the lever. Langerd likes this
Langerd Posted October 6, 2015 Author Posted October 6, 2015 1 set as func_static the physic clipp of the lever and link the lever to it2: build a trigger_multiple around the lever with two script: one that move down the lever, the other that move up of 45° every script also change the usescript of trigger_multiple so a time is executed the first that turn clipper and lever into position B, the second time the second script the move the lever and the clipper to position A.IMPORTANT: you need to put at the base of the lever a little cube brush textured with system\origin. and you need to convert as unique func_static entity the physic clip of the lever and the origin brush. in this mode, the lever rotate around the origin brush pivot.IMPORTANT 2: you need to use a misc_model, NOT a misc_model_static entity for the lever.But how to write the script like that?Yeah i use misc_model only
Solution Ramikad Posted October 6, 2015 Solution Posted October 6, 2015 Additionally, you might need to set a script_targetname key on the entity, to be used as the entity affected by the commands in the script.About the scripts, something like this should suffice: //(BHVD)affect ( "Lever", /*@AFFECT_TYPE*/ FLUSH ){ rotate ( < X Y Z >, T ); set ( /*@SET_TYPES*/ "SET_USESCRIPT", "lever_activate_up" );} Simply make it so that it affects the script_targetname you chose for the lever, and rotate it 90 degrees on the correct axis (totally NOT sure which one it would be - you'll have to experiment on that), in T number of milliseconds. The last command will set the entity usescript to a similar script, but that rotates -90 degrees on the same axis (to switch it back), and sets the entity usescript to the original script - going by the example here, lever_activate_down. Then again... I'm not really experienced with moving objects with BehavEd, so I might be mistaken on a few points. Langerd, Asgarath83 and redsaurus like this
Asgarath83 Posted October 7, 2015 Posted October 7, 2015 But how to write the script like that?Yeah i use misc_model only I did it with two func_static doors of a temple in past. Additionally, you might need to set a script_targetname key on the entity, to be used as the entity affected by the commands in the script.About the scripts, something like this should suffice: //(BHVD) affect ( "Lever", /*@AFFECT_TYPE*/ FLUSH ){ rotate ( < X Y Z >, T ); set ( /*@SET_TYPES*/ "SET_USESCRIPT", "lever_activate_up" );} Simply make it so that it affects the script_targetname you chose for the lever, and rotate it 90 degrees on the correct axis (totally NOT sure which one it would be - you'll have to experiment on that), in T number of milliseconds. The last command will set the entity usescript to a similar script, but that rotates -90 degrees on the same axis (to switch it back), and sets the entity usescript to the original script - going by the example here, lever_activate_down. Then again... I'm not really experienced with moving objects with BehavEd, so I might be mistaken on a few points.Ramikad procedure is correct, follow this @@Langerd. if you get troubles tell to us and we will help you Langerd likes this
Asgarath83 Posted October 7, 2015 Posted October 7, 2015 Many thanks 83 i will check it today decompile kor1.bsp of JKA there are some misc_model sith lord statue pushable, you can study how they works. for understand how is configured into a map a moving misc_model .
mrwonko Posted October 7, 2015 Posted October 7, 2015 rotate ( < X Y Z >, T );It's actually pitch/yaw/roll, which is Y Z X, if memory serves. Asgarath83 likes this
Langerd Posted October 7, 2015 Author Posted October 7, 2015 It's actually pitch/yaw/roll, which is Y Z X, if memory serves.Strange O.o It is always XYZ well .. usually
Langerd Posted October 7, 2015 Author Posted October 7, 2015 Many thanks guys!!! It works 83 Asgarath83 likes this
Langerd Posted October 8, 2015 Author Posted October 8, 2015 Additionally, you might need to set a script_targetname key on the entity, to be used as the entity affected by the commands in the script.About the scripts, something like this should suffice: //(BHVD) affect ( "Lever", /*@AFFECT_TYPE*/ FLUSH ){ rotate ( < X Y Z >, T ); set ( /*@SET_TYPES*/ "SET_USESCRIPT", "lever_activate_up" );} Simply make it so that it affects the script_targetname you chose for the lever, and rotate it 90 degrees on the correct axis (totally NOT sure which one it would be - you'll have to experiment on that), in T number of milliseconds. The last command will set the entity usescript to a similar script, but that rotates -90 degrees on the same axis (to switch it back), and sets the entity usescript to the original script - going by the example here, lever_activate_down. Then again... I'm not really experienced with moving objects with BehavEd, so I might be mistaken on a few points.And You can also make it this way - affect ( $get( STRING, "SET_PARM1")$, /*@AFFECT_TYPE*/ FLUSH ){ rotate ( < -90 0 0 >, 2000 );} In the target_scriptruner You just add parm1 or parm2. This is helpful because You can do this with many enities - not only one that is named Asgarath83 likes this
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now