Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Sammieo

Member Since 17 Feb 2013
Offline Last Active May 08 2013 04:35 AM

Topics I've Started

[Update 8pm GMT] UDK: Model's animations aren't playing!

12 March 2013 - 01:23 PM

Very basic question, I imagine, and forgive me if I'm phrasing it wrong, but Google has not been kind to me in my search for an answer. I want to give my character in UDK a model, but I'm not quite sure how, and the amount of tiny questions I have about it only seems to grow:

- Must my model be in a specific directory? If so, which one?
- Do I need to use unrealscript to do it, or is that simply the recommended way?
- How do I play animations? Must the call to the animation be written in unrealscript as it enters a new function or state?

This is how I understand how to attach a mesh to an actor right now, by writing this in the defaultproperties section of a Pawn or Actor:
 

Begin Object Class=StaticMeshComponent Name=BasicMesh

        StaticMesh=StaticMesh'UN_SimpleMeshes.TexPropCube_Dup'

        Materials(0)=Material'EditorMaterials.WidgetMaterial_X'

        LightEnvironment=MyLightEnvironment

        Scale3D=(X=0.25,Y=0.25,Z=0.5)

  End Object

  Components.Add(BasicMesh)


From this I can tell that 'UN_SimpleMeshes.TexPropCube_Dup' is the actual object, and exists somewhere in the UDK folders, but that is the extent of my knowledge. If anyone could offer some wisdom to me, it'd make a world of difference!


[SOLVED] Reference the controller of a pawn?

10 March 2013 - 10:56 AM

Hey guys,


I've got a player character and NPC in UDK, each with their own pawns and controllers. I want to, within the NPC's controller, trigger a function in the player's controller, but I only have the player's pawn as a reference.

I've tried googling and looking through documentation for an answer, but have been unlucky. I also tried something like this:

MyPawn.Controller.DoFunction();


Since I know we can refer to the Pawn from a controller or an actor, but I got an error:
 

MyPawn.Controller.BeStunned();


Triggers the error: "Unrecognised member 'BeStunned' in class 'Controller'. This happens even though I have a BeStunned function inside MyController.

Any help for a newbie short on luck would be most appreciated!


[UDK] Clarity on the default inventory system, and removing a weapon

05 March 2013 - 06:55 AM

Hey guys, I'm just trying to do a simple test where MyPlayerController has a function that can remove the item in the current user's inventory. I'm not using any specially built system of inventory, I'm using the default Unreal Tournament inventory system. So the idea is that if the player pawn touches some actor (let's call it MyWeaponRemover), then MyWeaponRemover will call this function on MyPlayerController and remove the weapon they have equipped. (i.e If they had only their current weapon, now they would have nothing.) With what little I knowI guess it'd look something like:
function RemoveWeapon()
{
    DefaultInventory(0)=None;
}
How far off would I be if I said that? I've done some searching for the topic of the default inventory system, but I've not seen much info. I've also seen many guides on how to make my own inventory system, but I'm on a tight deadline and don't have the time to make a completely new inventory. Any advice or suggested resources?

Implementing models into UDK - where do I start?

04 March 2013 - 04:59 PM

Hey guys,

 

I have some FBX model files made by a friend which I need to apply for my project in UDK. I'm not a modeller, and models aren't what this project is about, so I just want to put them in and play the animations when they happen. I'm conscientous of time and can only spend a few days at most on this, and I'm also aware of UDK's use of static and skeletal meshes.

I've downloaded Blender to extract them with, and while I've done some googling but I haven't found much anything concise. Where should I look to implement these?

Any help you could give would be amazing.


[Unrealscript] Why isn't PostBeginPlay() appearing?

04 March 2013 - 07:59 AM

EDIT: As a heads-up, this doesn't seem to be an issue anymore, though I'm genuinely not sure why. Ah well, can't complain!

I'm working with unrealscript now, and I have a nice little controller. The PostBeginPlay() function, however, doesn't seem to be as reliable as I want it to be; I'm using it to set up a few things, but I've noticed through use of log messages that PostBeginPlay() doesn't seem to appear when I want it to.

Just take a look at my code. Blue lines are log messages that appear in the launch log file: red lines are ones that don't.

 

 

class MagpieController extends AIController;

var Pawn CrowPawn;

var Actor CrowActor;

var float AttackDistance;
var float ChaseDistance;
var float MovementSpeed;

simulated function PostBeginPlay()
{
  `log("A magpie CONTROLLER has appeared on the map!"); //appears
  if (CrowPawn == none)
  {
    `log("Targeting the crow now!"); //appears, but because the player appears after the magpie does the bottom function call doesn't work
    TargetCrow();
  }
  `log("Just making sure that, yes, the magpie controller is still here!"); //appears
  GoToState('Searching');
}

function Tick(float DeltaTime)
{
  `log("The magpie's just sitting here, twitchin' its talons!"); //doesn't appear because the GoToState('Searching') part works fine!
}

auto state Searching
{
  simulated function PostBeginPlay()
  {
    `log("The magpie is now SEARCHING!"); //never appears
    if (CrowPawn == none)
    {
      TargetCrow();
    }
  }
  function Tick (float DeltaTime)
  {
    `log("I'm still looking for crows!"); //appears
    
    if (CrowPawn == none)
    {
      TargetCrow();
    }
    if (VSize(Location - CrowPawn.Location) < ChaseDistance)
    {
      `log("Right, the magpie now sees the player!"); //appears

      GoToState('ChasingPlayer');
    }
  }
}

state ChasingPlayer
{
  simulated function PostBeginPlay()
  {
    `log("I'm chasing that filthy crow!"); //never appears
  }

  function Tick(float DeltaTime)
  {
    local vector NewLocation;

    `log("I'm still chasing that filthy crow!"); //appears

    if(CrowPawn == none)
    {
        TargetCrow();
    }

    while (CrowPawn != none && VSize(NewLocation - CrowPawn.Location) < AttackDistance)
    {
      `log(Location);
        NewLocation = Location;
        NewLocation += normal(CrowPawn.Location - Location) * MovementSpeed * DeltaTime;
        SetLocation(NewLocation);
    }
  }
}

function TargetCrow()
{
  local CrowPlayerController PC;
  foreach LocalPlayerControllers(class'CrowPlayerController', PC)
  {
    if (PC.Pawn != none)
    {
        CrowPawn = PC.Pawn;
        `log("My enemy is:" @ CrowPawn);
    }
  }
}


Can anyone please offer an explanation for this?


PARTNERS