Results 1 to 6 of 6
  1. #1
    Skaarj
    Join Date
    Aug 2011
    Posts
    28
    Gamer IDs

    Gamertag: iTz FiNaL PSN ID: iTzFiNaL

    Default UDKPawn & Trigger

    Hi,

    Please read second post

    I have been following these tutorials

    http://www.moug-portfolio.info/index.php?page=tutorials

    I created a gametype that uses a custom pawn, using UDKPawn. So I have basically ended up like this

    http://www.youtube.com/watch?v=e5gi8...layer_embedded

    I am now doing the trigger tutorial and I am having a problem. The trigger does not seem to work unless I am using a UT game type, if I use my custom gametype the trigger doesn't work, the prompt doesn't even appear. If anyone could tell me why this might be then I would be grateful.

    Thanks
    Last edited by d0m13; 09-16-2011 at 09:11 AM.

  2. #2
    Skaarj
    Join Date
    Aug 2011
    Posts
    28
    Gamer IDs

    Gamertag: iTz FiNaL PSN ID: iTzFiNaL

    Default

    OK, so ignore the last post, I did some experimenting and here is where I am.

    I want some test to come up when the players touches the trigger, here is what I have go so far.

    I think the problem is in this line in the trigger touch function

    "PlayerController(Pawn(Other).Controller).myHUD.Ad dPostRenderedActor(self);"

    I don't think the PostRenderFor is being sent to the HUD, maybe I need to fix change this line? I got it from the Mougli's tutorials.

    Trigger Touch Code

    Code:
    event Touch (Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal)
    {
    	super.Touch(Other, OtherComp, HitLocation, HitNormal);
    	
    	if (Pawn(Other) != None)
    	{
    			
    			   PlayerController(Pawn(Other).Controller).myHUD.AddPostRenderedActor(self);
    			IsInInteractionRange = true;
    		
    	}
    		
    }
    Trigger PostRenderFor Function

    Code:
    simulated event PostRenderFor(PlayerController PC, Canvas Canvas, vector CameraPosition, vector CameraDir)
    {
    	
    	
    	super.PostRenderFor(PC, Canvas, CameraPosition, CameraDir);
    	
    	Canvas.SetPos(100, 100); //top left corner
    	Canvas.SetDrawColor(255, 255, 255, ); //white
    	Canvas.DrawText("AT LAST!!", , 1.0f, 1.0f); //the 2.0f is X and Y scale
    	
    }
    I have made a basic HUD class aswell, which works fine

    Code:
    class BaseHUD extends UDKHUD
    	config(BaseHUD);
    
    simulated event PostRender()
    {
    	super.PostRender();
    
    	Canvas.SetPos(10, 10); //top left corner
    	Canvas.SetDrawColor(255, 255, 255, ); //white
    	Canvas.DrawText("Hurray, it WORKS!", , 1.0f, 1.0f); //the 2.0f is X and Y scale
    }
    
    
    
    
    defaultproperties
    {
    
    
    }
    If anyone could help me out I would appreciate it, it is driving me crazy.

    Thanks

  3. #3
    Skaarj
    Join Date
    Aug 2011
    Posts
    28
    Gamer IDs

    Gamertag: iTz FiNaL PSN ID: iTzFiNaL

    Default

    Nobody? All the code that I have works fine in UTGame, but in my own game mode it doesn't work.

  4. #4
    Skaarj
    Join Date
    Aug 2011
    Posts
    28
    Gamer IDs

    Gamertag: iTz FiNaL PSN ID: iTzFiNaL

    Default

    Please could someone reply, it has been 4 days since I made this thread and not a single reply. There is obviously something I need to put in my HUD class to make the text appear, that ITHID has but mine doesn't.

  5. #5
    Redeemer
    Join Date
    Dec 2008
    Location
    Germany
    Posts
    1,227

    Default

    I was hoping someone else has an idea what exactly the problem is.

    Check if the log says anything like accessed 'none' etc.
    Put `log("Message"); to the begining of PostRenderFor() and see if that is called, most likely not.

    Check if self got added to this:
    Code:
    /** Holds a list of Actors that need PostRender calls */
    var array<Actor> PostRenderedActors;
    The Trigger needs something to render, otherwise it won't be called.
    Try adding a mesh or bPostRenderIfNotVisible=TRUE in the defaultproperties.
    2B || !(2B)

  6. #6
    Skaarj
    Join Date
    Aug 2011
    Posts
    28
    Gamer IDs

    Gamertag: iTz FiNaL PSN ID: iTzFiNaL

    Default

    Quote Originally Posted by UnrealEverything View Post
    I was hoping someone else has an idea what exactly the problem is.

    Check if the log says anything like accessed 'none' etc.
    Put `log("Message"); to the begining of PostRenderFor() and see if that is called, most likely not.

    Check if self got added to this:
    Code:
    /** Holds a list of Actors that need PostRender calls */
    var array<Actor> PostRenderedActors;
    The Trigger needs something to render, otherwise it won't be called.
    Try adding a mesh or bPostRenderIfNotVisible=TRUE in the defaultproperties.
    The thing is, it all works when I change it to UTHUD or try it in a UT game type, but not with UDKHUD and my custom gametype, so I must be missing something. I set it up now so when I enter the trigger a texture appears, which works in UT, but not in my game. So the problem must lie with my HUD class.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.