News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > UnrealEngine2 Runtime > Level Design, Skinning and Modelling

Reply
 
Thread Tools Display Modes
Old 12th Apr 2004, 02:01 AM   #1
ncmpinc
Registered User
 
Join Date: Apr. 12th, 2004
Posts: 13
Making a Control panel

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?
ncmpinc is offline   Reply With Quote
Old 12th Apr 2004, 02:44 AM   #2
Vito
Registered User
 
Join Date: Mar. 18th, 2002
Posts: 143
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.
Vito is offline   Reply With Quote
Old 12th Apr 2004, 11:25 AM   #3
ncmpinc
Registered User
 
Join Date: Apr. 12th, 2004
Posts: 13
Quote:
Originally Posted by Vito
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 is offline   Reply With Quote
Old 15th Apr 2004, 01:34 PM   #4
ncmpinc
Registered User
 
Join Date: Apr. 12th, 2004
Posts: 13
I think I've found a solution for my problem. I just put a lot of space between te buttons and use 'use triggers'.
ncmpinc is offline   Reply With Quote
Old 24th Apr 2004, 05:45 AM   #5
conscripted
Registered User
 
Join Date: Mar. 1st, 2004
Location: australia
Posts: 113
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
conscripted is offline   Reply With Quote
Old 24th Apr 2004, 07:19 AM   #6
ncmpinc
Registered User
 
Join Date: Apr. 12th, 2004
Posts: 13
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.
ncmpinc is offline   Reply With Quote
Old 27th Apr 2004, 04:32 AM   #7
conscripted
Registered User
 
Join Date: Mar. 1st, 2004
Location: australia
Posts: 113
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
conscripted is offline   Reply With Quote
Old 7th May 2004, 07:11 AM   #8
ncmpinc
Registered User
 
Join Date: Apr. 12th, 2004
Posts: 13
Lightbulb Simple Line of Sight Redirection trigger

Quote:
Originally Posted by conscripted
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 by ncmpinc; 18th May 2004 at 11:20 AM. Reason: Script Update
ncmpinc is offline   Reply With Quote
Old 18th May 2004, 11:19 AM   #9
ncmpinc
Registered User
 
Join Date: Apr. 12th, 2004
Posts: 13
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)

ncmpinc is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:15 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer