Jump to content

Camera scene scripting


Recommended Posts

So, I was finally able to put in a camera in my map ( you know the one that makes the scenes in single player), but it absolutely uncontrollable, how does it decide where to spawn itself? since in behaved I only could make a command which puts me in camera mod (camera/enable), but I wasn't able to find any kind of variable in it, I mean no targetnames for camera entities. First it put itself in the only existing target_relay entity, now I deleted it, but it looks it finds that postion again and put itself there instead of my ref_tag named cam1. I've tried to change my ref_tag into a target_relay (the only one in the map now) and it has the targetname cam1. Well the camera put itself to the same position, and there is nothing in radiant what I can see, no specific entity or position (like 0 0 0). So How do I do this?

 

And how do I tell an NPC to move from here to there?

 

(Yes I'm working on a singleplayer map.)

Link to comment
//(BHVD)
rem ( "Enable cutscene mode, move the camera to the position/orientation of the ref_tag with targetname camera_ref_tag_name" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "camera_ref_tag_name", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "camera_ref_tag_name", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
rem ( "Tell the NPC with npc_targetname npc_name to go to the waypoint_navgoal with targetname navgoal_name" );
affect ( "npc_name", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@ SET_TYPES*/ "SET_NAVGOAL", "navgoal_name" ); // Without the space after the @ - but the name-mention-highlighting is overly aggresive here.
rem ( "Or, to pause script execution until he has arrived:" );
task ( "unique_task_name" )
{
set ( /*@ SET_TYPES*/ "SET_NAVGOAL", "navgoal_name" ); // same
}
dowait ( "unique_task_name" );
print ( "!npc_name has arrived at navgoal_name!" );
}

AradorasXeon likes this
Link to comment

//(BHVD)
rem ( "Enable cutscene mode, move the camera to the position/orientation of the ref_tag with targetname camera_ref_tag_name" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "camera_ref_tag_name", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "camera_ref_tag_name", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
rem ( "Tell the NPC with npc_targetname npc_name to go to the waypoint_navgoal with targetname navgoal_name" );
affect ( "npc_name", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@ SET_TYPES*/ "SET_NAVGOAL", "navgoal_name" ); // Without the space after the @ - but the name-mention-highlighting is overly aggresive here.
rem ( "Or, to pause script execution until he has arrived:" );
task ( "unique_task_name" )
{
set ( /*@ SET_TYPES*/ "SET_NAVGOAL", "navgoal_name" ); // same
}
dowait ( "unique_task_name" );
print ( "!npc_name has arrived at navgoal_name!" );
}

 

First of all thanks for your help! This means a lot to me (since there isn't too many tutorial for scripting, at least I haven't found any detailed one)

Well it work half way, no matter what I target with the ref_tag it turns somehow in a strange direction (tried it with another ref_tag targeted from the camera/pan, with the very same result), anyway my npc doesn't spawn in for some reason so I have to look after things. thanks again!

Link to comment

The important part for rotation is the PAN setting. You have to target your ref_tag to a target_position. You can also make the camera follow an npc, or export a camera animation as a .rof animation from the modelling tool of your choice (as long as that choice is either an ancient 3ds max with an official exporter or Blender, for which I wrote one). But for now, simple ref_tags will suffice. :)

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...