1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

KAG Specific code for wheels

Discussion in 'Help' started by The_Trap_Door_Spider, Apr 7, 2014.

Mods: makmoud98, Mazey
  1. The_Trap_Door_Spider

    The_Trap_Door_Spider Catapult Fodder

    Messages:
    3
    Hi, im trying to make a animation of kag using sprites from the game, i want to use a wheel in the animation and thanks to epnows post i know that wheels are just rotated via code, but iwas wondering if anyone knows how much the wheels are rotated by for each frame?
     
  2. The_Trap_Door_Spider

    The_Trap_Door_Spider Catapult Fodder

    Messages:
    3
    on a side note if anyone knows the code for specific tree generation or ascaled picture of a ingame tree sprite please tell me!
    --- Double Post Merged, Apr 8, 2014, Original Post Date: Apr 7, 2014 ---
    No one knows anything?
     
  3. Skinney

    Skinney THD Team THD Team Forum Moderator Tester

    Messages:
    468
    Just search within your KAG base folder, all of these questions you have can be easily answered with a little self help.
     
  4. The_Trap_Door_Spider

    The_Trap_Door_Spider Catapult Fodder

    Messages:
    3
    I dont know anything about code but ill try, thank you
    --- Double Post Merged, Apr 9, 2014, Original Post Date: Apr 9, 2014 ---
    So in the vehicle code file located in base/entities/vehicles/common there is what i think is the line of code specifying the rotation of wheels (i think)
    // wheels
    if (this.getShape().vellen > 0.07f && !this.isAttached()) {
    UpdateWheels( this );

    I think the 0.007 is how much the wheels rotate each frame

    Can anyone confirm this?
     
    Last edited: Apr 9, 2014
  5. zerd

    zerd Arsonist
    1. SIEGE Clan - SIEGE

    Messages:
    47

    I can deny this. In the code you presented, the "0.07f" is a value used to determine if the wheels should be rotated, not by how much.

    I had a look at the UpdateWheels method that is being used to rotate the wheels, and it is not based on some constant rotation speed, but rather based on the distance the wheel has moved between each frame and other code related stuff.

    For an animation, i suggest that you just experiment with what looks most kaggish to you, rather than trying to perfectly mimic the way kag rotates the wheels, which is cool, but looks quite hacked.

    Looking forward to seeing what you are working on.
     
Mods: makmoud98, Mazey