don't click here

SonicGDK 1.30.000

Discussion in 'Fangaming Discussion' started by Xaklse, Feb 10, 2010.

  1. I just used the old UT3 HUD as a base (which is 100% UnrealScript), hid most of the counters and added the ring icon and the boost counter.

    It isn't so complex, you need to be patient and follow each step. If you use Flash, I'm sure you could get someone to help you.

    Like Candescence said, the Unreal Editor isn't for scripting. You have to find the .uc files; each file is a class that you can open with Notepad. The ones I told you are from the SonicGDK folder.

    Aha, I think I can do something about it, so that you can fix it with Kismet.
     
  2. Azu

    Azu

    I must be stupid. Member
  3. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    Why are PawnSonic.uc's acceleration/etc. values mirrored in three different files if you only have to change one for it to effect anything? Unless I'm mistaken.

    Edit: What variable is Sonic's speed? Like if I wanted to have a stat change in PawnSonic.uc when he was at a certain speed, it would just be

    Code (Text):
    1. if ( something > 100 ) {
    2.     PhysicsData[0].RunningAcceleration = 200.0
    3. } else {
    4.     PhysicsData[0].RunningAcceleration = 600.0
    5. }
    Right?

    I thought it would be ImpulseSpeed, but I keep getting a script compile error:

    Edit 2: Hm. Even testing what I want to do with another, known variable doesn't seem to be doing what I want.
     
  4. Which three different .uc files?

    You have float GroundSpeed (which you can change with SetGroundSpeed()) and vector Velocity (GetVelocity() / SetVelocity()); but I don't recommend to mess with this unless you know where to look and where to change (several places).

    If you just want Sonic to "walk" instead of run, you have bool bMustWalk and float WalkSpeedPct available for that; just change the values in the defaultproperties block and see if it works. If it does, you just have to change bMustWalk value of the pawn with a button press.
     
  5. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    Development\Src\MyGame\Classes\MyPlayerPawn.uc
    Development\Src\MyGame\Classes\MyPawnSonic.uc
    Development\Src\SonicGDK\Classes\PawnSonic.uc

    All have copies of Sonic's physics variables (acceleration, top speed, etc.)

    Anyway, the plan is to give Sonic higher acceleration at lower speeds, but keep it in check so it doesn't break the feeling of momentum. I think it would make the controls feel snappier.

    Unfortunately, it seems function InitializePhysicsData() is only called when specifically modified by something like speed shoes or Super Sonic, so I'm not quite sure how I'd continually adjust Sonic's acceleration based on what speed he's moving at...
     
  6. How do you change the cubes (with physics) from SGDKSimpleDestroyable which spawn if you destroy it (These cubes: [​IMG])?

    I changed the Spawn Phys Mesh in UTSimple Destroyable in SGDKSimpleDestroyable's properties, but it doesn't seem to do anything.
     
  7. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    So the only way to pass an If statement seems to be in a function or an event but I can't seem to find one for the life of me that will let me piggyback constantly checking Sonic's speed so it can modify his acceleration and I know nothing about setting up a new function/event that will let me.
     
  8. The MyGame classes aren't used in SonicGDK, they are examples to teach how to extend SGDK properly.

    event Tick() is what you need; modify the value of DefaultAccelRate.

    If the PhysicsMeshSlots of the SGDKSimpleDestroyable tab are empty, SpawnPhysMesh of the UTSimpleDestroyable tab is used instead.
    So, change the values stored in PhysicsMeshSlots, or empty the PhysicsMeshSlots and change the value of SpawnPhysMesh.
     
  9. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    For some reason

    Only bumps Sonic's acceleration when he's not touching the ground. If he's touching the ground at all, even if he's not moving, his DefaultAccelRate will always be 500. If 15000 seems a bit high for GroundSpeed, that's because I started at 15 and have been adding zeroes trying to figure out why it wasn't working right (I thought maybe 15 was too low).
     
  10. Don't check for GroundSpeed, it stores the maximum allowed on ground speed. Use VSize(GetVelocity()) instead.

    if ( VSize( GetVelocity() ) > 650.0 )
    DefaultAccelRate = 5000.0;
    else
    DefaultAccelRate = 50.0;
     
  11. Azu

    Azu

    I must be stupid. Member
    I'm trying to do a double loop around like in the first part of Tropical Resort.
    [​IMG]

    Sonic won't follow the path, Instead of looping around the circle, he just cuts straight through to the end.
    Sometimes, he'll just loop around the circle.
     
  12. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    It would be great if there was like an index with the important SonicGDK variables because using Windows Search trying to find a variable and what it does is like searching for a needle in a haystack. Either that, or tell me a better program that searches the text within files.

    DefaultAccelRate is a thing, but now I'm looking for something like DefaultTopSpeed and the compiler is telling me to shove it.

    Edit: I'm also looking for a variable that tells me if Sonic is currently boosting or not. I thought bCanMachDash would be it, but it doesn't seem that way.

    Edit 2: Got that much, at least. Just forgot the extra equals sign for "SpecialMoveId == 5", which is why I thought I had it wrong.
     
  13.  
  14. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    I want it so that while Sonic is boosting, he has a higher top speed than he does normally.
     
  15. Thank you, it works now.

    Also, what are the differences between SGDKPlayerStart and PlayerStart? Somehow, in a new stage Sonic always spawns at PlayerStart and not SGDKPlayerStart.
     
  16. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    Let's say I have a sound that I want to play at a certain moment in time, how do I get it so that sound only plays once? I figure the current method I am doing is really hacky in UDK terms:

    Edit: I don't think this is related to the edits I'm making, but I've noticed a couple of weird bugs:

    - When coming up the ramp out of the water at a certain point, the screen will suddenly cut to black. It'll sit there like this for a second before the HUD disappears and the music fades out, and then I restart from a checkpoint. I've tried getting video of it multiple times but it seems to be one of those things that happens only when the game is running very smoothly.

    - When I have speed shoes, Sonic no longer runs along the surface of the water.
     
  17. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    Right, well, I think this is a good enough milestone as any to show my work. Feel free to comb through what I've modified! I tried to comment some of what I changed. I understand it's probably super basic and probably a bit bloated, but it works, and at this point in time I am happy with that.

    http://blaze.letsvideogame.com/TEMP/SonicGDK-BlazeMod.rar (30.6mb)

    Don't hesitate to provide feedback about how to improve crappy code or the way my gameplay tweaks make you feel - some of the stuff in here is things I've wanted to try out in a 3D Sonic game.

    I at least have plans to lower the top speed of Sonic a bit as I bumped up a tad, and that plus the extra speed increase from boosting and Unreal Engine starts to chug a bit when you're tearing through vctf-necropolis at top speed. Just goes to show you why Sonic Unleashed and Sonic Generations seem to have such low-res textures - that's a lot of data to be streaming in.

    Edit: Removed some wording that seemed kind of jerkish to me
     
  18. Always use SGDKPlayerStart; it's adjusted to Sonic's size and it's compatible with the camera system.

    • To play the "ding" sound, I suggest you to set a timer, search for "SetTimer" in Actor.uc (Development/Src/Engine/Classes).
    • I can't reproduce the cut to black bug either.
    • I see, it's a bug, whenever you modify DefaultGroundSpeed you should modify WaterRunAdhesionPct too.
    Nice code; try to use booleans instead of floats (for OnlyDingOnce for instance), and looks like PostBeginPlay() would be really useful for you :v:
    Oh btw, I think it's better if you extend and improve my code with your own classes, otherwise your code won't take advantage of my future updates.
     
  19. TheKazeblade

    TheKazeblade

    "Our Life is More than a Side-Effect" Member
    This part interests me. Would it be conceivable to apply this to more than just rings? I just recalled the video Ritz put in the homing attack thread a while back, the idea of making enemies slightly magnetic so it's easier to bounce.

    http://www.youtube.com/watch?v=TZqVgy3RVI8

    Obviously not as overpowered as it is there, but maybe as an evolution of the hold down "a" to increase your bounce height? That it's only magnetic so long as you hold it down, and only within a very small radius?

    I don't know anything about code, but that's something I thought could be neat :)
     
  20. Ritz

    Ritz

    Subhedgehog Member
    4,086
    110
    43
    To clarify, there isn't actually any magnetism going on in that video, just dry bouncing. It takes skill, but the game controls well enough that no homing functions are really needed, which is a real feat in an engine that isn't even really 3D to begin with. I think that's the way it ought to be, but the whole magnet thing is a nice compromise if everyone else is going to insist on being a pussy about it.

    Wouldn't really be "overpowered" either if the game was structured to take advantage of the mechanic. I really think it should be! Glad the idea is starting to see some support.