Jump to content

Making rotate the brush 45 degree (or in other) BUT like lever like.


Go to solution Solved by Ramikad,

Recommended Posts

I made the lever column

lever.jpg

The 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 :)

Link to comment

1 set as func_static the physic clipp of the lever and link the lever to it

2: 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
Link to comment

1 set as func_static the physic clipp of the lever and link the lever to it

2: 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

Link to comment
  • Solution

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.

redsaurus, Langerd and Asgarath83 like this
Link to comment

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
Link to comment

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
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...