21
Questions and Answers / Re: Crash Win 10
« Last post by KingR on February 25, 2025, 08:33:23 pm »Thank you very much Slowhand ! This will be very useful to me.
EXPORT int getParam_MaxWeight(CritterMutual& cr, uint)
{
int val = max(cr.Params[ST_CARRY_WEIGHT] + cr.Params[ST_CARRY_WEIGHT_EXT], 0);
val += CONVERT_GRAMM(25 + getParam_Strength(cr, 0) * 25);
if(cr.Params[PE_PACK_RAT])
{
val*=4;
val/=3;
}
val+=20000;
const Item* armor=cr.ItemSlotArmor;
val+=checkBonus(armor, BONUS_ARMOR_CARRY_WEIGHT)*1000;
return CLAMP(val, 0, 2000000000);
}#define PID_BAG (46)
#define PID_BACKPACK (90)
#define PID_BROWN_BAG (93)
EXPORT int getParam_MaxWeight(CritterMutual& cr, uint)
{
int val = max(cr.Params[ST_CARRY_WEIGHT] + cr.Params[ST_CARRY_WEIGHT_EXT], 0);
int extra = 0;
if (cr.ItemSlotExt->Proto->ProtoId == PID_BACKPACK || cr.ItemSlotMain->Proto->ProtoId == PID_BACKPACK) {
extra += 50;
}
val += CONVERT_GRAMM(25 + getParam_Strength(cr, 0) * 25 + extra);
if(cr.Params[PE_PACK_RAT])
{
val*=4;
val/=3;
}
val+=20000;
const Item* armor=cr.ItemSlotArmor;
val+=checkBonus(armor, BONUS_ARMOR_CARRY_WEIGHT)*1000;
return CLAMP(val, 0, 2000000000);
}You probably need a small workaround for that in main.fos
for example, to remove the cooldown completely, put this inside void items_crafted:Code: [Select]uint[] param(1);
param[0] = crafter.Id;
CreateTimeEvent(__FullSecond+REAL_SECOND(0), "_CraftingTimeOutPatch", param, false);
and this outside of void items_crafted:Code: [Select]uint _CraftingTimeOutPatch(uint[]@ Id)
{
Critter@ crafter = GetCritter(Id[0]);
crafter.TimeoutBase[TO_SK_REPAIR] = __FullSecond+REAL_SECOND(0);
crafter.TimeoutBase[TO_SK_SCIENCE] = __FullSecond+REAL_SECOND(0);
return 0;
}
Took it from Xenom long ago.
To set craft timeout you'd need to identify the type of item crafted and set appropriate cd.
hope it helps, cheers