PDA

View Full Version : Making a Control panel


ncmpinc
12th Apr 2004, 01:01 AM
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
12th Apr 2004, 01:44 AM
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
12th Apr 2004, 10:25 AM
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
15th Apr 2004, 12:34 PM
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
24th Apr 2004, 04:45 AM
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
24th Apr 2004, 06:19 AM
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
27th Apr 2004, 03:32 AM
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
7th May 2004, 06:11 AM
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

ncmpinc
18th May 2004, 10:19 AM
I've finished the code for this redirection trigger.


//=============================================================================
// 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)

:)