[Mod] Buildings that fire

Discussion in 'Modding' started by BombaRuLz, Oct 4, 2016.

  1. BombaRuLz

    BombaRuLz New Member

    Following the thread below it helped me to make all buildings fire except walls.

    Here is how i achieved that:
    I copied things from block house and pasted on specific places:

    In .\data\scripts\lib\unit.script search for csid+'hou' : begin and add these lines below it
    SetObjBaseWeapon(objprop, objbase, 0, 85, 1, 400 {C1 Was 550}, 950, 550, 50000, gc_obj_weapon_kind_bullet, True);
    objprop.weapon[0].weaponsid := 'SHOTBLOCKHOUSE';
    objprop.weapon[0].cost[gc_resource_type_iron] := 2;
    objprop.weapon[0].cost[gc_resource_type_coal] := 2;
    objprop.weapon[0].fxshot := 'shotmusketpoint';
    SetObjBaseMaterialCanKill(objprop, gc_obj_material_building, gc_obj_material_body, 0, 0, 0, 0);
    objprop.searchradius := _misc_PixelsToTiles(1000);
    objprop.vision := 3;
    objprop.bshowdelay := True;
    objprop.explradius := _misc_PixelsToTiles(1);

    This will make all HOUSES to have ability to fire but they can't just yet. (same thing applies for all buildings if you paste this on right places.

    Next thing is add the points from where the bullets come out + their animations in file .\data\game\var\objcustom.cfg . This part takes a lot of modifying and time so i'll just explain for 1 building. Search for polhou (which is Poland House).

    The code for paste is here:

    You need to add the above code right before the LAST struct.end of
    : struct.begin
    sid = polhou

    The final code just for this poland house is here in case you get confused with the above (check line 139):

    Here is the code in action from the game, as you can see the house works as a blockhouse and killed 1 enemy pikeman:

    I was trying to do the same for walls in 'wallcustom.cfg' but was unsuccessful. As for other buildings, you'll need to copy and paste that code for each one of them in case you want to do a more "balanced" game, since mortars can just clean a whole city without problems.

    Use these codes on your own risk, keep backups all time.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice