As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Unreal Development Kit released to everyone

11516171921

Posts

  • Options
    SakeidoSakeido Registered User regular
    edited November 2009
    Super refers to the class whatever class you are looking at is inherited from.
    So in "MyPlayerController extends PlayerController," Super refers to PlayerController. You see it a lot in inherited functions because it lets you run the original function, in addition to your new additions

    Sakeido on
  • Options
    NotASenatorNotASenator Registered User regular
    edited November 2009
    Aumni wrote: »
    Ok, another noob question:

    event Possess(Pawn inPawn, bool bVehicleTransition)
    {
    Super.Possess(inPawn, bVehicleTransition);
    SetBehindView(true);
    }

    Super is referring to the class object, correct? in this case this is located in a demo of someone's MyPlayerController class.

    So it's the same thing as MyPlayerController.Possess?

    I will need to do a lot of reading on this programming stuff. Should just stick to levels :\

    super is like base in other situations (C#)

    It calls the version of the function from the class that the current class is extending. For example

    class ParentClass;

    var int A;

    function SetA()
    {
    A=2;
    }


    class ChildClass extends ParentClass;

    function SetA()
    {
    A=1;
    super.SetA();
    }


    If you run the SetA in ParentClass, A is equal to 2.
    If you run the SetA in ChildClass, it sets A to 1, then runs ParentClass.SetA() which sets A to 2.

    NotASenator on
  • Options
    AumniAumni Registered User regular
    edited November 2009
    NotACrook wrote: »
    Aumni wrote: »
    Ok, another noob question:

    event Possess(Pawn inPawn, bool bVehicleTransition)
    {
    Super.Possess(inPawn, bVehicleTransition);
    SetBehindView(true);
    }

    Super is referring to the class object, correct? in this case this is located in a demo of someone's MyPlayerController class.

    So it's the same thing as MyPlayerController.Possess?

    I will need to do a lot of reading on this programming stuff. Should just stick to levels :\

    super is like base in other situations (C#)

    It calls the version of the function from the class that the current class is extending. For example

    class ParentClass;

    var int A;

    function SetA()
    {
    A=2;
    }


    class ChildClass extends ParentClass;

    function SetA()
    {
    A=1;
    super.SetA();
    }


    If you run the SetA in ParentClass, A is equal to 2.
    If you run the SetA in ChildClass, it sets A to 1, then runs ParentClass.SetA() which sets A to 2.

    Wow, thanks for the replies.

    So then:

    function int SetA()
    {
    A = 1
    Super.SetA()
    return A
    }

    Would return 2? (barring syntax which I probably messed up)

    It makes sense to me as you have it written, I'll have to chew on it for a few before I'll understand how this example is using it. And I'll have to read what an event is and stuff.

    If I pick up my dusty C++ book a lot of this will be in there, right?

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    NotASenatorNotASenator Registered User regular
    edited November 2009
    Aumni wrote: »
    NotACrook wrote: »
    Aumni wrote: »
    Ok, another noob question:

    event Possess(Pawn inPawn, bool bVehicleTransition)
    {
    Super.Possess(inPawn, bVehicleTransition);
    SetBehindView(true);
    }

    Super is referring to the class object, correct? in this case this is located in a demo of someone's MyPlayerController class.

    So it's the same thing as MyPlayerController.Possess?

    I will need to do a lot of reading on this programming stuff. Should just stick to levels :\

    super is like base in other situations (C#)

    It calls the version of the function from the class that the current class is extending. For example

    class ParentClass;

    var int A;

    function SetA()
    {
    A=2;
    }


    class ChildClass extends ParentClass;

    function SetA()
    {
    A=1;
    super.SetA();
    }


    If you run the SetA in ParentClass, A is equal to 2.
    If you run the SetA in ChildClass, it sets A to 1, then runs ParentClass.SetA() which sets A to 2.

    Wow, thanks for the replies.

    So then:

    function int SetA()
    {
    A = 1
    Super.SetA()
    return A
    }

    Would return 2? (barring syntax which I probably messed up)

    It makes sense to me as you have it written, I'll have to chew on it for a few before I'll understand how this example is using it. And I'll have to read what an event is and stuff.

    If I pick up my dusty C++ book a lot of this will be in there, right?

    Yeah, it would return 2.

    How is your example using it?

    NotASenator on
  • Options
    AumniAumni Registered User regular
    edited November 2009
    NotACrook wrote: »
    Aumni wrote: »
    NotACrook wrote: »
    Aumni wrote: »
    Ok, another noob question:

    event Possess(Pawn inPawn, bool bVehicleTransition)
    {
    Super.Possess(inPawn, bVehicleTransition);
    SetBehindView(true);
    }

    Super is referring to the class object, correct? in this case this is located in a demo of someone's MyPlayerController class.

    So it's the same thing as MyPlayerController.Possess?

    I will need to do a lot of reading on this programming stuff. Should just stick to levels :\

    super is like base in other situations (C#)

    It calls the version of the function from the class that the current class is extending. For example

    class ParentClass;

    var int A;

    function SetA()
    {
    A=2;
    }


    class ChildClass extends ParentClass;

    function SetA()
    {
    A=1;
    super.SetA();
    }


    If you run the SetA in ParentClass, A is equal to 2.
    If you run the SetA in ChildClass, it sets A to 1, then runs ParentClass.SetA() which sets A to 2.

    Wow, thanks for the replies.

    So then:

    function int SetA()
    {
    A = 1
    Super.SetA()
    return A
    }

    Would return 2? (barring syntax which I probably messed up)

    It makes sense to me as you have it written, I'll have to chew on it for a few before I'll understand how this example is using it. And I'll have to read what an event is and stuff.

    If I pick up my dusty C++ book a lot of this will be in there, right?

    Yeah, it would return 2.

    How is your example using it?

    Well that's my default PlayerController class (extends UTplayerController). From what I understand it's possessing the spawned Pawn (which is defaulted in the Game class I'm defaulting to), and setting the camera to third person.

    The pawn has this code:
    simulated function bool CalcCamera(float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV)
    {
    	local vector start, end, hl, hn;
    	local actor a;
    	
    	start = Location;
    	
    	if (Controller != none)
    	{
    		end = Location - Vector(Controller.Rotation) * 192.f;
    	}
    	else
    	{
    		end = Location - Vector(Rotation) * 192.f;
    	}
    	
    	a = Trace(hl, hn, end, start, false);
    	
    	if (a != none)
    	{
    		out_CamLoc = hl;
    	}
    	else
    	{
    		out_CamLoc = end;
    	}
    	
    	out_CamRot = Rotator(Location - out_CamLoc);
    	return true;
    }
    

    Which returns true, after it gets the camera vector (i'm assuming) so that the character is always shooting forward? I'm still analyzing this. Still not sure what 192.f is calculating, but must be related to vector. I looked up the Trace actor and that is essentially what weapons use to return a position pointed at.

    I got all the code from :

    http://tutorial.toltecstudios.com/

    Which is a great starting tutorial for you UDK programming newbies, like me!

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    mspencermspencer PAX [ENFORCER] Council Bluffs, IARegistered User regular
    edited November 2009
    Should be.

    I learned one way to think of these statements, but maybe there's a reason they don't teach you this until you've been programming for a while. It's possible reading what's in the spoiler will only confuse you, and I might suck as a teacher. Either way, here goes:
    Every statement you execute has a value and a side-effect.

    Before the statement is executed, the world the program lives in is set in a certain way. Some variables exist, some of them even have values, some may be uninitialized, etc.

    The statement is executed. That statement resolves to a value, and it also has an optional side-effect. That side-effect is a persistent change to the state of the world.

    Let's look at some weird statements.

    1;

    That's a statement. It has a value -- the literal 1. It has no side-effects -- it doesn't change the world in any way.

    false;

    That's also a statement. Same thing.

    a == 4;

    Oops, you just screwed up an assignment statement and used an equality comparison. That's still a valid statement -- it is resolved to a boolean true or false. It also has no side-effects.

    a = 4;

    That's more like it. This statement has both a value and a side-effect. The value is 4, and the side effect is that the variable a now contains the value 4.

    a = b = c = 4;

    Don't code like this -- it confuses people -- but let's map it out. We evaluate this statement and the rules of evaluation (don't ask) say we start at the right. c = 4 is evaluated first, and it has a side-effect. Its value is 4. Next b = (4) is evaluated, and finally a = (4).

    a+++++b;

    This one is evil. Pre-increment and post-increment. In pre-increment, the side-effect (increment) affects the value before it is returned. In post-increment the value is returned and then the side-effect (increment) happens.

    If we only cared about side-effects, we could say this adds one to a and adds one to b and that's it. But there's more.

    When the expression evaluator gets its hands on it, this looks like (a++) + (++b). We need to resolve a++, need to resolve ++b, and then need to resolve addition. a++ is post-increment, so we get the value of a. ++b is pre-increment, so we get b+1. So this statement is equivalent to:
    { a += 1; b += 1; a + b + 1; }

    Thinking in this weird way helps when understanding inheritance and scope -- but I don't want to write THAT particular wall of text unless people are interested.

    mspencer on
    MEMBER OF THE PARANOIA GM GUILD
    XBL Michael Spencer || Wii 6007 6812 1605 7315 || PSN MichaelSpencerJr || Steam Michael_Spencer || Ham NOØK
    QRZ || My last known GPS coordinates: FindU or APRS.fi (Car antenna feed line busted -- no ham radio for me X__X )
  • Options
    AumniAumni Registered User regular
    edited November 2009
    Thank you for that.

    I've been 'programming' at my jorb for over a year now, but it's almost 100% VBA, SQL, PLSQL and a very tiny amount of java. I'm mainly forced to write stuff in VB or SQL queries because of time constraints and poor management (another story for another thread). So I have a tiny amount of programming experience that I think will help me get into this stuff.

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    LaCabraLaCabra MelbourneRegistered User regular
    edited November 2009
    Coders jargoning amoungst themselves is truly a sight to behold

    LaCabra on
  • Options
    mspencermspencer PAX [ENFORCER] Council Bluffs, IARegistered User regular
    edited November 2009
    I was expecting LaCabra to say "you have time to write posts like that but you can't accept my L4D2 invite?" To which I would reply yes I'm really in class, and I probably should be paying attention instead of maek poast.

    mspencer on
    MEMBER OF THE PARANOIA GM GUILD
    XBL Michael Spencer || Wii 6007 6812 1605 7315 || PSN MichaelSpencerJr || Steam Michael_Spencer || Ham NOØK
    QRZ || My last known GPS coordinates: FindU or APRS.fi (Car antenna feed line busted -- no ham radio for me X__X )
  • Options
    NotASenatorNotASenator Registered User regular
    edited November 2009
    LaCabra sends L4D2 invites to me as well, when he is quite aware that I don't have the game.

    NotASenator on
  • Options
    LaCabraLaCabra MelbourneRegistered User regular
    edited November 2009
    When I'm in a lobby and it needs guys, I invite everyone on my list.

    LaCabra on
  • Options
    LaCabraLaCabra MelbourneRegistered User regular
    edited November 2009
    Thanks to Benson and Pierson we have our first velociraptor animation ingame. Now that we know how to do this, we should be controlling a velociraptor in third person with magnificent animations in a matter of days.

    LaCabra on
  • Options
    TaminTamin Registered User regular
    edited November 2009
    I'm getting frustrated. I made a class: 'SuperPlayerController' that extends 'PlayerController'. It's job, right now, is simply to log something when I press the fire key, not unlike GnmomeTank's code from a few pages back.

    When I hit the make button, the logs are saying that it's compiling both of the classes in MyMod\Classes, but I'm not getting a log entry from the
    exec function StartFire(optional byte FireModeNum)
    {
    	`log("Hello, it's Wonderful");
    	Super.StartFire(FireModeNum);
    }
    

    I'm going to bed nowish (work work), but I wanted to organize my thoughts a little bit first and ask for help.

    MyMod\Classes contains SuperPlayerController and SuperFunGame. I'm running make using the UTFrontEnd, and then running 'dm-deck?game=mymod.superfungame' from a cmd prompt.

    I'm sure it's something painfully stupid, but I can't figure out what I'm doing wrong.

    Tamin on
  • Options
    NotASenatorNotASenator Registered User regular
    edited November 2009
    Oddly enough, my model stopped showing up.

    One second, raptor - then I did something and it's gone.

    That's disturbing, to think that he could be out there somewhere.

    NotASenator on
  • Options
    DeathPrawnDeathPrawn Registered User regular
    edited November 2009
    NotACrook wrote: »
    Oddly enough, my model stopped showing up.

    One second, raptor - then I did something and it's gone.

    That's disturbing, to think that he could be out there somewhere.

    You need to jump to a higher level.

    He's clearly doing too good a job at fitting in.

    DeathPrawn on
    Signature not found.
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited November 2009
    Added another blurb on the blog about player input and how it binds to your PlayerController class: http://gnometank.wordpress.com/2009/11/19/16/

    Tamin:

    I had that same issue when sub-classing directly from PlayerController, and specifically on StartFire. I could never figure out why. It was logging some sort of error happening inside Epic's code that I couldn't figure out. Part of why I completely rebound my input to custom functions was because StartFire was tossing exceptions for me. Oddly if you override StopFire, it will probably work.

    Completely custom functions setup in my UTInput.ini did the trick for me on input.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    TaminTamin Registered User regular
    edited November 2009
    GnomeTank wrote: »
    Added another blurb on the blog about player input and how it binds to your PlayerController class: http://gnometank.wordpress.com/2009/11/19/16/

    Tamin:

    I had that same issue when sub-classing directly from PlayerController, and specifically on StartFire. I could never figure out why. It was logging some sort of error happening inside Epic's code that I couldn't figure out. Part of why I completely rebound my input to custom functions was because StartFire was tossing exceptions for me. Oddly if you override StopFire, it will probably work.

    Completely custom functions setup in my UTInput.ini did the trick for me on input.

    Do I need to put the modified UTInput.ini in MyMod\Classes, or MyMod, or can I leave it in the original directory?

    Tamin on
  • Options
    NotASenatorNotASenator Registered User regular
    edited November 2009
    Tamin wrote: »
    GnomeTank wrote: »
    Added another blurb on the blog about player input and how it binds to your PlayerController class: http://gnometank.wordpress.com/2009/11/19/16/

    Tamin:

    I had that same issue when sub-classing directly from PlayerController, and specifically on StartFire. I could never figure out why. It was logging some sort of error happening inside Epic's code that I couldn't figure out. Part of why I completely rebound my input to custom functions was because StartFire was tossing exceptions for me. Oddly if you override StopFire, it will probably work.

    Completely custom functions setup in my UTInput.ini did the trick for me on input.

    Do I need to put the modified UTInput.ini in MyMod\Classes, or MyMod, or can I leave it in the original directory?

    I'm pretty sure it stays in UTGame/Config, although I haven't tested elsewhere.

    NotASenator on
  • Options
    AumniAumni Registered User regular
    edited November 2009
    NotACrook wrote: »
    Tamin wrote: »
    GnomeTank wrote: »
    Added another blurb on the blog about player input and how it binds to your PlayerController class: http://gnometank.wordpress.com/2009/11/19/16/

    Tamin:

    I had that same issue when sub-classing directly from PlayerController, and specifically on StartFire. I could never figure out why. It was logging some sort of error happening inside Epic's code that I couldn't figure out. Part of why I completely rebound my input to custom functions was because StartFire was tossing exceptions for me. Oddly if you override StopFire, it will probably work.

    Completely custom functions setup in my UTInput.ini did the trick for me on input.

    Do I need to put the modified UTInput.ini in MyMod\Classes, or MyMod, or can I leave it in the original directory?

    I'm pretty sure it stays in UTGame/Config, although I haven't tested elsewhere.

    If there is a DefaultInput.ini you could create a new MyGameInput.ini with the
    [config]
    basedon=..\DefaultInput.ini
    


    You don't want to put the .ini files outside the UTGame\Config (or MyGame\Config) directory. The Src\MyMod\Classes directory is soley for .uc files.

    Honestly it would just be easier to expand or modify the existing DefaultInput.ini, delete the UTInput.ini and run the game to have the default create the UTInput.ini with your changes.

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    TaminTamin Registered User regular
    edited November 2009
    NotACrook wrote: »
    Tamin wrote: »
    GnomeTank wrote: »
    Added another blurb on the blog about player input and how it binds to your PlayerController class: http://gnometank.wordpress.com/2009/11/19/16/

    Tamin:

    I had that same issue when sub-classing directly from PlayerController, and specifically on StartFire. I could never figure out why. It was logging some sort of error happening inside Epic's code that I couldn't figure out. Part of why I completely rebound my input to custom functions was because StartFire was tossing exceptions for me. Oddly if you override StopFire, it will probably work.

    Completely custom functions setup in my UTInput.ini did the trick for me on input.

    Do I need to put the modified UTInput.ini in MyMod\Classes, or MyMod, or can I leave it in the original directory?

    I'm pretty sure it stays in UTGame/Config, although I haven't tested elsewhere.


    edit: Aumni - ok, I'll do something like that. Excellent.

    Tamin on
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited November 2009
    I just modified UTInput.ini to make my changes, though eventually I will modify DefaultInput.ini and let the FrontEnd regenerate my UTInput.ini.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    NotASenatorNotASenator Registered User regular
    edited November 2009
    I was unhappy with the documentation of the lifecycle of the gametype, and because of a lack of access to the source for seeing how the game init and loop works, I decided to dissect UTGame.UTGame and see what makes it tick.

    Basically I'm replacing step-by-step debugging with `log calls all over UTGame, UTPlayerController and UTPawn so I can put together a strong understanding of the order that things happen in.

    NotASenator on
  • Options
    AumniAumni Registered User regular
    edited November 2009
    NotACrook wrote: »
    I was unhappy with the documentation of the lifecycle of the gametype, and because of a lack of access to the source for seeing how the game init and loop works, I decided to dissect UTGame.UTGame and see what makes it tick.

    Basically I'm replacing step-by-step debugging with `log calls all over UTGame, UTPlayerController and UTPawn so I can put together a strong understanding of the order that things happen in.

    If you document this you can have my <3.

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    TaminTamin Registered User regular
    edited November 2009
    Aumni wrote: »
    NotACrook wrote: »
    I was unhappy with the documentation of the lifecycle of the gametype, and because of a lack of access to the source for seeing how the game init and loop works, I decided to dissect UTGame.UTGame and see what makes it tick.

    Basically I'm replacing step-by-step debugging with `log calls all over UTGame, UTPlayerController and UTPawn so I can put together a strong understanding of the order that things happen in.

    If you document this you can have my <3.

    And mine. That would be extremely helpful.

    Tamin on
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited November 2009
    NotACrook wrote: »
    I was unhappy with the documentation of the lifecycle of the gametype, and because of a lack of access to the source for seeing how the game init and loop works, I decided to dissect UTGame.UTGame and see what makes it tick.

    Basically I'm replacing step-by-step debugging with `log calls all over UTGame, UTPlayerController and UTPawn so I can put together a strong understanding of the order that things happen in.

    Yah, I've been playing with some of this as well. Mostly with Pawns, in terms of calling PostBeginPlay when the game starts and such.

    The one that is driving me nuts is GetDefaultPlayerClass in GameInfo. This should be where I tell the game engine what my PlayerControllers Pawn class will be, but it never seems to get called in my custom GameInfo. Still working on that one.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    AumniAumni Registered User regular
    edited November 2009
    GnomeTank wrote: »
    NotACrook wrote: »
    I was unhappy with the documentation of the lifecycle of the gametype, and because of a lack of access to the source for seeing how the game init and loop works, I decided to dissect UTGame.UTGame and see what makes it tick.

    Basically I'm replacing step-by-step debugging with `log calls all over UTGame, UTPlayerController and UTPawn so I can put together a strong understanding of the order that things happen in.

    Yah, I've been playing with some of this as well. Mostly with Pawns, in terms of calling PostBeginPlay when the game starts and such.

    The one that is driving me nuts is GetDefaultPlayerClass in GameInfo. This should be where I tell the game engine what my PlayerControllers Pawn class will be, but it never seems to get called in my custom GameInfo. Still working on that one.

    You can set it in the Main class of your game in the defaultproperties

    I think it's defaultPawnClass=class'MyGame.MyPawn'

    Then if you look at the code I copied from the tutorial on the last page you need to throw a possess event.

    I think.

    Totally learning the stuff here.

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    NotASenatorNotASenator Registered User regular
    edited November 2009
    I was absolutely going to put the code I was working with on a thumb drive and bring it to work, but my wife looked really cute this morning and I got distracted.

    Damn her.

    The default property for defaultPawnClass certainly is effective in setting the class used, but the question is when does it get used. That's something I'm looking at as well.

    I will certainly document it all. I'm also thinking about putting some info up on my website.

    NotASenator on
  • Options
    AumniAumni Registered User regular
    edited November 2009
    NotACrook wrote: »
    I was absolutely going to put the code I was working with on a thumb drive and bring it to work, but my wife looked really cute this morning and I got distracted.

    Damn her.

    The default property for defaultPawnClass certainly is effective in setting the class used, but the question is when does it get used. That's something I'm looking at as well.

    I will certainly document it all. I'm also thinking about putting some info up on my website.

    Wouldn't it be when the pawn was spawned?

    Edit: Since any bot, player, or AI is a pawn, I'd figure every time they spawn the pawn class (or one of its subclasses) is called.

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    NotASenatorNotASenator Registered User regular
    edited November 2009
    Aumni wrote: »
    NotACrook wrote: »
    I was absolutely going to put the code I was working with on a thumb drive and bring it to work, but my wife looked really cute this morning and I got distracted.

    Damn her.

    The default property for defaultPawnClass certainly is effective in setting the class used, but the question is when does it get used. That's something I'm looking at as well.

    I will certainly document it all. I'm also thinking about putting some info up on my website.

    Wouldn't it be when the pawn was spawned?

    Edit: Since any bot, player, or AI is a pawn, I'd figure every time they spawn the pawn class (or one of its subclasses) is called.

    That's my assumption. I just haven't dug deep enough to find it.

    NotASenator on
  • Options
    FandyienFandyien But Otto, what about us? Registered User regular
    edited November 2009
    This had better still be about velociraptor interview

    Fandyien on
    reposig.jpg
  • Options
    AumniAumni Registered User regular
    edited November 2009
    Nah, I think they scraped it for the more hip 'Donut Hole Disc Jockey'

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited November 2009
    Aumni wrote: »
    GnomeTank wrote: »
    NotACrook wrote: »
    I was unhappy with the documentation of the lifecycle of the gametype, and because of a lack of access to the source for seeing how the game init and loop works, I decided to dissect UTGame.UTGame and see what makes it tick.

    Basically I'm replacing step-by-step debugging with `log calls all over UTGame, UTPlayerController and UTPawn so I can put together a strong understanding of the order that things happen in.

    Yah, I've been playing with some of this as well. Mostly with Pawns, in terms of calling PostBeginPlay when the game starts and such.

    The one that is driving me nuts is GetDefaultPlayerClass in GameInfo. This should be where I tell the game engine what my PlayerControllers Pawn class will be, but it never seems to get called in my custom GameInfo. Still working on that one.

    You can set it in the Main class of your game in the defaultproperties

    I think it's defaultPawnClass=class'MyGame.MyPawn'

    Then if you look at the code I copied from the tutorial on the last page you need to throw a possess event.

    I think.

    Totally learning the stuff here.

    This would work if NPCs and Players didn't have a different pawn class in RpgToolkit. Which is why I need to override GetPlayerDefaultClass, I just need to figure out why it's not called.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    DeathPrawnDeathPrawn Registered User regular
    edited November 2009
    Aumni wrote: »
    Nah, I think they scraped it for the more hip 'Donut Hole Disc Jockey'

    Yep. It's going to be a 2D platformer starring Dunkin Donuts newest mascot, in the vein of Domino's "Yo! Noid!" for the NES or 7-Up's Genesis "Cool Spot".

    DeathPrawn on
    Signature not found.
  • Options
    TaminTamin Registered User regular
    edited November 2009
    Dear PA,

    I can't find any way to prove that my SuperPlayerController class is ever being used. I've tried writing a number of different exec functions using the information from UTInput (and one from PlayerController); they either do not compile with the log statement, or the log statement is cheerfully ignored.

    What would be the simplest way to prove that it is capturing information about the player?

    Thank you,
    Thoroughly disgruntled, slightly demoralized, generally unhappy. The 3rd.

    Tamin on
  • Options
    GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited November 2009
    I figured out why my GetDefaultPlayerClass wasn't called, and I composed a blog entry about it: http://gnometank.wordpress.com/2009/11/20/ghetto-debugging-at-its-finest/

    I also put a blurb at the end of that function on how to do `log based ghetto debugging and tracing using function overrides. Thus the blog post title...

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Options
    AumniAumni Registered User regular
    edited November 2009
    Nice post Gnome.

    Also I finished my analysis of the camera code I posted last page. I've commented on each part:

    class TDPawn extends UTPawn;
    simulated function bool CalcCamera(float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV)
    {
    	local vector start, end, hl, hn; [COLOR="PaleTurquoise"]/*Establish a variable for the start end points, as well as the normal and hit point. */[/COLOR]
    	local actor a; [COLOR="PaleTurquoise"]// variable for the trace actor[/COLOR]
    
    
    	start = Location;[COLOR="PaleTurquoise"] [COLOR="PaleTurquoise"]/* Takes the location vector (x,y,z position) of the pawn (in my case, the player)*/[/COLOR][/COLOR]
    
    
    	
    	if (Controller != none)[COLOR="PaleTurquoise"]  // If the pawn is controlled do this code.[/COLOR]
    	{ // If controller exists 
    [COLOR="PaleTurquoise"]/* The next line takes the location of the player, then inverts the rotation (direction pawn is facing, setting the end point behind the pawn.*/[/COLOR]
    		end = Location - Vector(Controller.Rotation) * 120.f; // Was 192.f 
    
    	}
    	else
    	{
    		[COLOR="PaleTurquoise"]//If controller doesn't exist get[/COLOR]
    		end = Location - Vector(Rotation) * 192.f; [COLOR="PaleTurquoise"]/*If the pawn isn't being controlled set it to general rotation*/[/COLOR]
    	}
    	
    [COLOR="PaleTurquoise"]/* The trace actor draws a line from the start point (player) to the end point (vector behind the player). If the line hits a wall, you will get a value for Hit location (hl)*/[/COLOR]
    
    	a = Trace(hl, hn, end, start, false);
    	
    [COLOR="PaleTurquoise"]/* If the trace does hit a wall put the camera against the wall. */[/COLOR]
    	if (a != none)
    	{
    
    		out_CamLoc = hl;
    	}
    
    [COLOR="PaleTurquoise"]/* If the vector doesn't hit a wall, it means the camera is clear to stay the amount of units behind the player, in this case I have it 120 units behind the player because 192 is too far away*/[/COLOR]
    	else
    	{
    		out_CamLoc = end;
    	}
    	
    [COLOR="PaleTurquoise"]/* This if statement finds the vector that the camera will rotate around */[/COLOR]
    		if ( bWinnerCam )
    	{
    		// use "hero" cam
    		SetHeroCam(out_CamRot);
    	}
    	else
    [COLOR="PaleTurquoise"]/* This code sets the camera rotation to the difference between the player location and the camera location */[/COLOR]
    	{
    	out_CamRot = Rotator(Location - out_CamLoc);
    	}
    	return true;
    }
    
    

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    AumniAumni Registered User regular
    edited November 2009
    I've offset the start and end point to give me a Gears of War'ish camera that'll work for now. After looking at the UTpawn 3rdPersonCameraCalc function there is a lot of stuff they have in there that will be useful.

    Aumni on
    http://steamcommunity.com/id/aumni/ Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    RaslinRaslin Registered User regular
    edited November 2009
    Coding confuses my brain

    Shiny things are easy :/

    Raslin on
    I cant url good so add me on steam anyways steamcommunity.com/id/Raslin

    3ds friend code: 2981-6032-4118
  • Options
    LaCabraLaCabra MelbourneRegistered User regular
    edited November 2009
    Hey dudes. Impromptu Games might be needing another character modeller in the future.

    Not that the one we have is going anywhere, but we're going to need a fair few humans modelled.

    Accepting applications!

    LaCabra on
  • Options
    SakeidoSakeido Registered User regular
    edited November 2009
    Got my game up and running using the cut down version of UDK, so no UT*.uc files for me :) now the hard and fun part begins...

    Sakeido on
Sign In or Register to comment.