Questions about XS

I seen some newly added features like configuring resource, deduct type. Since there is no official documentation, i’m trying to figure out how it works through testing. I’m trying to configure an empty technology, but it’s not working in xs script! I simply can’t configure the resource, even though this option is supposed to be available! Here’s a sample code snippet:

int tech = 1180; // Blank Technology 00

for(playerId = 1; < xsGetNumPlayers()) {
    // Resource manipulations does not work for me
    xsEffectAmount(cModifyTech, tech, cAttrTypeFirstCost, cAttributeFood, playerId);
    xsEffectAmount(cModifyTech, tech, cAttrAmountFirstCost, 50, playerId);
    xsEffectAmount(cModifyTech, tech, cAttrDeductFlagFirstCost, 1, playerId); // 1 = deduct


    xsEffectAmount(cModifyTech, tech, cAttrSetTime, 10, playerId);
    xsEffectAmount(cModifyTech, tech, cAttrSetLocation, 109, playerId);
    xsEffectAmount(cModifyTech, tech, cAttrSetButton, 2, playerId);
    xsEffectAmount(cModifyTech, tech, cAttrSetState, 2, playerId); // Enable tech
}

This code should assign 50 food units to the first resource and deduct the cost but technology is still free. Am i doing something wrong or is this feature not works in xs?

I can’t see anything wrong with what you have there. All I can suggest is just messing around and seeing if anything changes.