1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

Making a Control panel

Discussion in 'Level Design, Skinning and Modelling' started by ncmpinc, Apr 12, 2004.

  1. ncmpinc

    ncmpinc New Member

    Joined:
    Apr 12, 2004
    Messages:
    13
    Likes Received:
    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?
     
  2. Vito

    Vito New Member

    Joined:
    Mar 18, 2002
    Messages:
    143
    Likes Received:
    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.
     
  3. ncmpinc

    ncmpinc New Member

    Joined:
    Apr 12, 2004
    Messages:
    13
    Likes Received:
    0
    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.
     
  4. ncmpinc

    ncmpinc New Member

    Joined:
    Apr 12, 2004
    Messages:
    13
    Likes Received:
    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'.
     
  5. conscripted

    conscripted New Member

    Joined:
    Mar 1, 2004
    Messages:
    113
    Likes Received:
    0
    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
     
  6. ncmpinc

    ncmpinc New Member

    Joined:
    Apr 12, 2004
    Messages:
    13
    Likes Received:
    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.
     
  7. conscripted

    conscripted New Member

    Joined:
    Mar 1, 2004
    Messages:
    113
    Likes Received:
    0
    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
     
  8. ncmpinc

    ncmpinc New Member

    Joined:
    Apr 12, 2004
    Messages:
    13
    Likes Received:
    0
    Simple Line of Sight Redirection trigger

    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: May 18, 2004
  9. ncmpinc

    ncmpinc New Member

    Joined:
    Apr 12, 2004
    Messages:
    13
    Likes Received:
    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)

    :)
     

Share This Page