Making a Control panel

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

ncmpinc

New Member
Apr 12, 2004
13
0
0
I need to make something like a control panel in my map. Is there anyone who knows how to make triggers wich must be clicked by the mouse or something?
 

Vito

New Member
Mar 18, 2002
143
0
0
You can either take over the mouse directly, or (recommended) use Interfaces and the GUI system. Tutorials for all of them are available on UDN. You'll need to do some UnrealScript programming for this.
 

ncmpinc

New Member
Apr 12, 2004
13
0
0
Vito said:
You can either take over the mouse directly, or (recommended) use Interfaces and the GUI system. Tutorials for all of them are available on UDN. You'll need to do some UnrealScript programming for this.

Thanx, but I need something for an in-game control panel. One wich is made of movers. Something as Clicking on a Static mesh to generate an event.
 

ncmpinc

New Member
Apr 12, 2004
13
0
0
I think I've found a solution for my problem. I just put a lot of space between te buttons and use 'use triggers'.
 

conscripted

New Member
Mar 1, 2004
113
0
0
australia
hages.net
from what I understand of the lineOfSight trigger you might be able to put them closer and have the user put their cross hairs on the required trigger, then 'use' that one.. Im not 100% sure if this is what the lineOfSight trigger does, as Ive only read the tut, without any experimentation. If I'm wrong, I'd love it if someone could correct me
 

ncmpinc

New Member
Apr 12, 2004
13
0
0
Thanks it's a good idea.
I put the code of the use trigger and the line of sight trigger together and look if it works.
 

conscripted

New Member
Mar 1, 2004
113
0
0
australia
hages.net
im guessing youve found the limitations of the lineOfSight trigger by now... pity its once only and single player only. and has some fairly odd implementation requirements... like triggering itself and then something else...

my plan of action for my development now might include making a multiuse version of this trigger.. but thats for down the road
 

ncmpinc

New Member
Apr 12, 2004
13
0
0
Simple Line of Sight Redirection trigger

conscripted said:
my plan of action for my development now might include making a multiuse version of this trigger.. but thats for down the road

I've created a simple version of a line of sight redirection trigger, there's only one problem: I can't get the pitch-rotation, I know why, the player pawn is only rotated around the Z-axis. I need the rotation of the camera. How can I fix this problem?

see next reply for the complete code
 
Last edited:

ncmpinc

New Member
Apr 12, 2004
13
0
0
InLineOfSightRedirector

I've finished the code for this redirection trigger.

Code:
//=============================================================================
// InLineOfSightRedirector.
//=============================================================================
class InLineOfSightRedirector extends RedirectionTrigger
	placeable;

var(RedirectionTrigger) float Distance;
var(RedirectionTrigger) float MaxViewAngleDeg; // in degrees
var   float AngleDist; 

function PostBeginPlay()
{
	Local vector DistTemp;
	Super.PostBeginPlay();
	DistTemp.x=1-cos(MaxViewAngleDeg * PI/180);
	DistTemp.y=sin(MaxViewAngleDeg * PI/180);
	AngleDist = vsize(DistTemp);
}

function Trigger( actor Other, pawn p )
{
	local vector diff;
	local vector view;
	local float dist;
	local rotator CamRot;
	diff=p.Location-location;
	if (Distance==0 || !(abs(diff.x)>Distance || abs(diff.y)>Distance || abs(diff.z)>Distance)) {
		dist=vsize(diff);
		CamRot=p.controller.getviewrotation();
		if (Distance==0 || dist<=Distance) {
			diff/=dist;
			view.z=sin(CamRot.pitch*PI/32768);
			view.y=cos(CamRot.pitch*PI/32768);
			view.x=view.y*cos(CamRot.yaw*PI/32768);
			view.y=view.y*sin(CamRot.yaw*PI/32768);
			diff+=view;
			dist=vsize(diff);
			if (dist<=AngleDist) {
				TriggerEvent(RedirectionEvent,self,P);
			}
		}
	}
}

It calculates if the camera is pointing to the object, within a specific distance (if distace<>0)

:)