Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AbrahamR, AndrewAMD, ozgur), 763 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
View entity becomes render target for 2d panels. A773. #257021
03/20/09 03:48
03/20/09 03:48
Joined: Oct 2003
Posts: 130
Wollongong Australia
J
Jethro Offline OP
Member
Jethro  Offline OP
Member
J

Joined: Oct 2003
Posts: 130
Wollongong Australia
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.

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.

Re: View entity becomes render target for 2d panels. A773. [Re: Jethro] #257040
03/20/09 07:46
03/20/09 07:46
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I have to look into it. But we haven't changed the render target, so it's probably some side effect from something else. Can you upload or send that project to Support?

Re: View entity becomes render target for 2d panels. A773. [Re: jcl] #257289
03/22/09 11:44
03/22/09 11:44
Joined: Oct 2003
Posts: 130
Wollongong Australia
J
Jethro Offline OP
Member
Jethro  Offline OP
Member
J

Joined: Oct 2003
Posts: 130
Wollongong Australia
The project is huge. I'm going to my publishers Monday, I'll see what I can do to make a smaller test project when I get back, to demonstrate problem.

Have you tried to duplicate the problem with my view entity code and some 2d panels on screen, like I said it even does it with the F11 Debug text.

Jethro.

Re: View entity becomes render target for 2d panels. A773. [Re: Jethro] #257423
03/23/09 10:32
03/23/09 10:32
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I'd appreciate a small test project, if possible. I can't reproduce any problem of the sort that you describe, and your code gives no hint.

Re: View entity becomes render target for 2d panels. A773. [Re: jcl] #257614
03/24/09 10:56
03/24/09 10:56
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Update: Another user reported a bug with a disappearing panel that could be verified by us. That may have the same reason. We don't need your test project at the moment - I'll post here if we need more information from you. Otherwise, the bug will be fixed in the next update.

Re: View entity becomes render target for 2d panels. A773. [Re: jcl] #260136
04/09/09 04:00
04/09/09 04:00
Joined: Oct 2003
Posts: 130
Wollongong Australia
J
Jethro Offline OP
Member
Jethro  Offline OP
Member
J

Joined: Oct 2003
Posts: 130
Wollongong Australia
This bug is now resolved in A775 Beta.


Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1