1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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

Small Modder Job (payment for coding)

Discussion in 'Modding [KAG]' started by daskew87, Sep 25, 2016.

  1. Vamist

    Vamist THD Team THD Team Tester

    Messages:
    544
    How can you fix the female head glitch?

    When you edit a female sprite, the head will start to glitch out, is there a way to fix this?
     
  2. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Not sure I understand what you mean, nor that this is the correct place for it. If you want it fixed please make another thread (or bump the existing one if there is one) with an exact way to reproduce it.

    Do you mean support WRT collapses? That's a field of the tile structure that afaict you can modify the same as any other tile; we don't use KAG's support system in TR though so there could be some issue there (I wouldn't be surprised).

    As for buildable - you just need to set the tile index? The builder code might not support tiles >255 out of the box, but it should be able to made to without too much effort.

    As for destructible - you need to attach a callback as part of the map loader to handle this. See TR/Base/Scripts/Maploaders/PNGLoader.as - there's
    Code:
    TileType server_onTileHit(CMap@ this, f32 damage, u32 index, TileType oldTileType) // you return the new tiletype based on the damage hit - you can check tiles nearby based on index
    and
    Code:
    void onSetTile(CMap@ map, u32 index, TileType newtile, TileType oldtile) // this is used for adding sound/particle effects - generally you want to check the tile actually changed though with newtile != oldtile
    This hook will only get called for non-vanilla (id >255) tiles as far as I'm aware.

    If you wanted to add "tile health", server_onTileHit is where you'd want to modify it. Note that it's only called on the server though so you'd have to have some other mechanism for syncing any tile damage to the client if you wanted to show damage frames or whatever. That's why we have set, specific levels of damage as separate tiles in KAG (the tile change is synced directly and it means we dont need to store tile HP anywhere).

    As for mineable - this isn't a function of the tilemap, it's a function of whatever is hitting the tile. It is 100% up to the blob (or rules script or whatever) that does the damage to the tile to decide what to do as a result; see the onHitMap hook.
     
    Kasper123 likes this.
  3. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
  4. JaytleBee

    JaytleBee Ballista Bolt Thrower
    1. [Server] Sandbox Reborn

    Messages:
    117
  5. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Responded there, move the discussion off here please :thumbs_up: