redink1
06-19-2003, 11:28 PM
After realizing that Teenage Lawnmower doesn't require an active internet connection to run, I decided to start on a new TLM mod. However... I ran into a bug in SWeD.
I created a new invisible entity, and attached this script to it to move the camera to an exact position to take screenshots:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">void OnCreate() //always put this FIRST in your script if you are going to use it. Declare script-wide globals here.
{
Vector3 vec_cam;
int id_cam;
}
void Main()
{
//don't actually do anything when loaded
id_cam = EntGetByName("Main Camera");
vec_cam = MakeVector3(497.055, 494.389, -209.215);
EntSetPosition(id_cam, vec_cam);
EntSetDirection(id_cam, 0.785);
EntSetTilt(id_cam, 2.785);
}[/QUOTE]However... EntSetTilt and EntSetDirection don't work correctly in SWeD. EntSetDirection actually controls the Tilt, and EntSetPosition actually controls the Roll (nothing visible happens, just the Roll number at the top changes). At first I was hoping that EntSetRoll would control the Direction, but that function doesn't exist.
The reason why I did the whole weird script-to-change-camera position is its hard to move the camera to an exact position, or maybe I'm just completely missing something.
I created a new invisible entity, and attached this script to it to move the camera to an exact position to take screenshots:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">void OnCreate() //always put this FIRST in your script if you are going to use it. Declare script-wide globals here.
{
Vector3 vec_cam;
int id_cam;
}
void Main()
{
//don't actually do anything when loaded
id_cam = EntGetByName("Main Camera");
vec_cam = MakeVector3(497.055, 494.389, -209.215);
EntSetPosition(id_cam, vec_cam);
EntSetDirection(id_cam, 0.785);
EntSetTilt(id_cam, 2.785);
}[/QUOTE]However... EntSetTilt and EntSetDirection don't work correctly in SWeD. EntSetDirection actually controls the Tilt, and EntSetPosition actually controls the Roll (nothing visible happens, just the Roll number at the top changes). At first I was hoping that EntSetRoll would control the Direction, but that function doesn't exist.
The reason why I did the whole weird script-to-change-camera position is its hard to move the camera to an exact position, or maybe I'm just completely missing something.