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

how to test if a tile is wood?

Discussion in 'Modding Help' started by Shadowblitz16, Aug 18, 2017.

Tags:
  1. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158
    does anybody know how to test if a structure is wooden tiles or blobs that do not have IgnoreDamage.as in their cfg file?

    I want to change explosion.as so that it only destroys wooden tiles and blobs without IgnoreDamage.as

    Code:
                                        if (!map.isTileBedrock(tile))
                                        {
                                            if (dist >= rad_thresh ||
                                                   !canExplosionDestroy(map, tpos, tile))
                                            {
                                                //map.server_DestroyTile(tpos, 1.0f, this);
                                            }
                                            else
                                            {
                                                //map.server_DestroyTile(tpos, 100.0f, this);
                                            }
                                        }
    
    Code:
                        if (canExplosionDamage(map, tpos, t))
                        {
                            if (!justhurt)
                                damaged = true;
    
                            justhurt = justhurt || !canExplosionDestroy(map, tpos, t);
                            //map.server_DestroyTile(tpos, justhurt ? 5.0f : 100.0f, this);
                        }
                        else
                        {
                            damaged = true;
                        }
    
     
    Last edited: Aug 18, 2017
  2. Monkey_Feats

    Monkey_Feats Bison Rider Tester

    Messages:
    214
    Code:
    if (!map.isTileBedrock(tile))
    This says 'if the tile is NOT(!) bedrock'. So if you changed the Bedrock to Wood and took out the !(not),
    it would read like this, if tile IS wood then do damage. Therefor only doing damage to wood tiles.
     
    Last edited: Aug 19, 2017
    Osmal likes this.
  3. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Messages:
    158