View Issue Details

IDProjectCategoryView StatusLast Update
0005068Spring engineGeneralpublic2016-02-08 21:41
ReporterJools Assigned Tohokomoko  
PrioritynormalSeverityminorReproducibilityrandom
Status closedResolutionno change required 
Product Version100.0+git 
Summary0005068: Unable to issue repair command via lua
DescriptionI guess this is half bug report, half call for help:

As discussed in #sy a while ago, I mentioned that some units do not get the UnitCmdDone callin, but it's because they do not have the corresponding Repair command description available. This units are the stationary repair pads in xta, but not the mobile ones.

Note that in their unitdefinition files, they do have the corresponding canrepair tags. These tags are also present in the lua version of the unitfdef tags.

It's just that they don't have the command descriptions. So I wonder if something in the engine removes those descriptions? Because previously, the repairing was done internally and it was not the wish that these units could issue the repair command manually.
Steps To ReproduceHere is for example the unitdef for arm_air_repairpad:

https://github.com/xta-springrts/xta-springrts/blob/master/units/arm_air_repair_pad.fbi

[UNITINFO]
{
    //************************************************************
    // Unit Description
    //********************
    side=Arm;
    name=Air Repair Pad;
    description=Automatically repairs aircraft;
    icontype=building;

    //************************************************************
    // Categories
    //**************
    category=ARM PLANT STATIC NOWEAPON STRATEGIC STORAGE NOTAIR NOTSEA NOTSUB;
    tedclass=STRATEGIC;

    //************************************************************
    // External Specs
    //******************
    unitname=arm_air_repair_pad;
    unitnumber=154;
    objectname=arm_air_repair_pad.3do;
    corpse=arm_air_repair_pad_dead;
    buildpic=arm_air_repair_pad.DDS;
    soundcategory=AIRPLANT;

    //************************************************************
    // Health/Cost/Size
    //********************
    maxdamage=680;
    buildcostmetal=106;
    buildcostenergy=2128;
    buildtime=5489;
    footprintx=4;
    footprintz=4;

    //************************************************************
    // Resources
    //*************
    metalstorage=0;
    energymake=5;
    energyuse=0;
    energystorage=100;

    //************************************************************
    // Building
    //************
    buildangle=1024;
    yardmap=oooo oooo oooo oooo;
    activatewhenbuilt=1;
    collisionVolumeType=Box;
    collisionVolumeScales=60 28 60;
    collisionVolumeTest = 1;

    //************************************************************
    // Constructor
    //***************
    builder=1;
    builddistance=48;
    workertime=600; //was 200 inspired by IvoryKing//
    repairSpeed = 1800; //increase from workertime to make repair pads more useful

    //************************************************************
    // Abilities
    //*************
    isairbase=1;
    onoffable=1;
    canMove=0;
    canAttack=0;
    canFight=0;
    canPatrol=0;
    canGuard=0;
    canRepeat=0;
    noAutoFire=1;
    canRepair=1;

    //************************************************************
    // Movement
    //************
    maxslope=10;
    maxwaterdepth=255;

    //************************************************************
    // Sight/Radar/Sonar
    //*********************
    sightdistance=306.25;
    radardistance=0;

    //************************************************************
    // Weapons
    //***********
    explodeas=BIG_UNITEX;
    selfdestructas=BIG_UNIT;

    //************************************************************
    // Orders
    //**********
    noautofire=0;

    //************************************************************
    // Miscellaneous
    //*****************
    bmcode=0;
    designation=ARM-SP1;
    downloadable=1;
    sortbias=0;
    threed=1;
    version=1.2;
    zbuffer=1;
    pieceTrailCEGTag=Debree;//bleh
    pieceTrailCEGRange = 4;

    //************************************************************
    // To be removed
    //*****************
    [SFXTypes]
    {
    explosiongenerator0=custom:Nano;
    }

}
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

hokomoko

2016-02-08 19:11

developer   ~0015673

These are buildings which can't assist, so canRepair is irrelevant.
If you make them into units (like nanos) they'll be able to repair basically everything (maybe possible to fix this in AllowCommand not sure).

Alternatively, use lua to automatically repair landed aircraft.

Jools

2016-02-08 19:33

reporter   ~0015675

Last edited: 2016-02-08 19:34

Hmmm, it's not because of canAssist in unitdef either: I tested with adding that, and no difference. Also, here's the unitdef for arm_colossus, for which the repair does work: https://github.com/xta-springrts/xta-springrts/blob/master/units/arm_colossus.fbi (it has canassist = false)

Could it be that there is still something hardcoded in the engine about these units?

Yes, it's possible to handle those issues with allowcommand, and I haven't tested the repair in lua route yet, I guess that would be an option.

hokomoko

2016-02-08 19:37

developer   ~0015677

Last edited: 2016-02-08 19:38

you didn't read.
Buildings can only produce a unit like a kbot plant does.
You can't assist a kbot plant with another kbot plant.

colossus is a mobile unit! it's like a constructor.

Check nano to see how you make a stationary unit that can assist

hokomoko

2016-02-08 21:41

developer   ~0015689

If you have any questions, invoke me on #moddev

Issue History

Date Modified Username Field Change
2016-02-08 19:07 Jools New Issue
2016-02-08 19:11 hokomoko Note Added: 0015673
2016-02-08 19:33 Jools Note Added: 0015675
2016-02-08 19:34 Jools Note Edited: 0015675
2016-02-08 19:37 hokomoko Note Added: 0015677
2016-02-08 19:38 hokomoko Note Edited: 0015677
2016-02-08 21:41 hokomoko Note Added: 0015689
2016-02-08 21:41 hokomoko Status new => closed
2016-02-08 21:41 hokomoko Assigned To => hokomoko
2016-02-08 21:41 hokomoko Resolution open => no change required