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

make stone tiles indestructible?

Discussion in 'Modding Help' started by Shadowblitz16, Mar 26, 2017.

Thread Status:
Not open for further replies.
  1. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    does anybody know how to make stone backgrounds and blocks indestructible?

    I tried editing StoneStructureHit.as but it seems that's for blobs and not tiles.
     
  2. makmoud98

    makmoud98 You are already DEAD Forum Moderator Staff Alumni Tester

    Messages:
    586
    i believe that kind of stuff is hard coded, what you can do as a workaround is going into the builder code and trying to disable the builder's ability to break them. this wont stop explosives and bombs from breaking them, maybe look at the bomb code.
    i think there is a way to actually create new tiles, but i have never done it. i think you can give them custom tile flags that will make them invincible. (you can maybe just give them the same texture as stone). @8x might be able to help you.
     
  3. GoldenGuy

    GoldenGuy Haxor Tester

    Messages:
    105
    Code:
    TileType server_onTileHit(CMap@ map, f32 damage, u32 index, TileType oldTileType)
    {
        switch(oldTileType)
        {
            case CMap::tile_castle:
            case CMap::tile_castle_back:
            {
                return oldTileType;
            }
        }
    }
    didnt tested, but this should work, put it in LoaderUtilities.as
     
    makmoud98 likes this.
  4. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    @makmoud98 the bomb thing was the whole point though bombs destroy the stone tiles which I don't want.
    making bombs not destroy tiles is bad because I want them to be able to destroy wood
    @GoldenGuy is TileType a return type?
    I'm getting a "not all paths return a value"
    I suspect its because I'm opt returning anything so I did this..

    Code:
    TileType server_onTileHit(CMap@ map, f32 damage, u32 index, TileType oldTileType)
    {
        switch(oldTileType)
        {
            case CMap::tile_castle:
            {
                return oldTileType;
            }
            case CMap::tile_castle_back:
            {
                return oldTileType;
            }
        }
        return oldTileType;
    }
    
    however when I put that last return statement it allows the map to load but the tiles are still destructable

    @GoldenGuy you there? I need some help with your code it doesn't make these tiles indestructable.
     
    Last edited: Mar 27, 2017
  5. Verrazano

    Verrazano Flat Chested Haggy Old Souless Witchy Witch Witch THD Team Global Moderator Forum Moderator Tester
    1. Practitioners of War Extreme Revolution - POWER

    Messages:
    477
Thread Status:
Not open for further replies.