Posted By: Jethro
View entity becomes render target for 2d panels. A773. - 03/20/09 03:48
Updated to A7.73 Pro.
A few of our levels have view entities in them. They act like a GPS/Compass pointing to the next object the player needs to pickup.
Problem is that when they are visible, the 2D panels in the level actually render to like a giant sprite above the View Entity, as the GPS view entity rotates, so does the whole 2D Panel rotate, even the F11 debug text.
This works perfectly in all previous editions of A7.
I think this may be related to the new render target for panels, getting mixed up.
I do NOT change the render taget of my 2D panels from default.
A few of our levels have view entities in them. They act like a GPS/Compass pointing to the next object the player needs to pickup.
Problem is that when they are visible, the 2D panels in the level actually render to like a giant sprite above the View Entity, as the GPS view entity rotates, so does the whole 2D Panel rotate, even the F11 debug text.
Code:
//////////////////////// // 3D Interface pointer to point to the Eggs, turtle, sanctuary // ENTITY* GPS_Pointer; //assign the correct gps pointer to this pointer. ENTITY GPS_Pointer1={ type = "Arrow_1.mdl"; layer = 2; // display above view entities with layer 1 //flags = VISIBLE; // client_id = camera; // same camera parameters as the default view x = 120; // place 100 quants ahead of the view y = 0; // center z = 53; // and top of screen } ENTITY GPS_Pointer2={ type = "Arrow_2.mdl"; layer = 2; // display above view entities with layer 1 //flags = VISIBLE; // client_id = camera; // same camera parameters as the default view x = 120; // place 100 quants ahead of the view y = 0; // center z = 53; // and top of screen } ENTITY GPS_Pointer3={ type = "Arrow_3.mdl"; layer = 2; // display above view entities with layer 1 //flags = VISIBLE; // client_id = camera; // same camera parameters as the default view x = 120; // place 100 quants ahead of the view y = 0; // center z = 53; // and top of screen } ///////////////////// // Init_GPS // This is the code that controls our GPS_Pointer Panel entity. // When you need the GPS_Pointer, attach this action to a Placeholder entity in the level. // // This is the logic behind the following, // Hide GPS in security panels. // If they are carrying a turtle, point to the Sanctuary. // Otherwise point to the eggs in order then the turtle. This way the eggs can guide them to the turtle. ACTION Init_GPS{ GPS_Pointer=GPS_Pointer1;//default to turtle and eggs. If (Curr_level==3){GPS_Pointer=GPS_Pointer2;} //life rafts and powercells If (Curr_level==5){GPS_Pointer=GPS_Pointer3;} //rubbish and barn GPS_Pointer.Visible=on; GPS_Pointer.skin=1; While (ME!=NULL) { //While the level exists, keep the pointer pointing at the relevant objects. If (Curr_SP==NULL){ //show GPS pointer GPS_Pointer.Visible=on; }ELSE{//hide GPS pointer GPS_Pointer.Visible=off; } If (Got_turtle!=0) {//Then aim at sanctuary or maybe eggs in reverse order? GPS_Pointer.skin=3; If (Sanctuary_Ent!=NULL) {//Point at this egg vec_set(temp,Sanctuary_ent.x); } }ELSE{ If (Egg1_Ent!=NULL) {//Point at this egg GPS_Pointer.skin=1; vec_set(temp,Egg1_ent.x); }ELSE{ If (Egg2_Ent!=NULL) {//Point at this egg GPS_Pointer.skin=1; vec_set(temp,Egg2_ent.x); }ELSE{ If (Egg3_Ent!=NULL) {//Point at this egg GPS_Pointer.skin=1; vec_set(temp,Egg3_ent.x); }ELSE{ If (Egg4_Ent!=NULL) {//Point at this egg GPS_Pointer.skin=1; vec_set(temp,Egg4_ent.x); }ELSE{ If (Egg5_Ent!=NULL) {//Point at this egg GPS_Pointer.skin=1; vec_set(temp,Egg5_ent.x); }ELSE{ If (Egg6_Ent!=NULL) {//Point at this egg GPS_Pointer.skin=1; vec_set(temp,Egg6_ent.x); }ELSE{ If (Turtle_Ent!=NULL) {//Point at this egg GPS_Pointer.skin=2; vec_set(temp,Turtle_ent.x); } } } } } } } } //Do this once after temp set above to correct entity note:- must be no waits to modify temp vec_sub(temp,camera.x); vec_to_angle(MY_Angle.pan,temp); // now MY looks at YOU GPS_Pointer.Pan=MY_ANGLE.PAN-Camera.pan; // -camera.pan because the Entity panel is referenced to the camera angle. Wait(1); } }
This works perfectly in all previous editions of A7.
I think this may be related to the new render target for panels, getting mixed up.
I do NOT change the render taget of my 2D panels from default.