Author Topic: [ How to ] SDK - Fixboy - Craft time  (Read 3422 times)

[ How to ] SDK - Fixboy - Craft time
« on: June 13, 2012, 05:27:15 pm »
Hello all,
So my thoughts on this and work i have done so far;
- cr.timeout seem to be the global time out - for books skills etc ( if this value is >0 you cant craft )
- _defines file seems to have several time outs defined ( lockpick, doctor, skill )
- fixboy.fos is just about workbenches and machinery [?] ( How do u use this script ? )
- There are several timeout vars ( Changing them to max value 1 ) seems to set the craft timeout to max 1 minute. ( Worked one time, then didnt work again [ maybe need to reload client scripts, or delete clients - server/save ]

thoughts on this would be great.

The problem is I cant find for sure which value to change;
- SET CRAFT TIMEOUT FOR INDIVIDUAL ITEMS?


Thanks

« Last Edit: June 25, 2012, 08:14:58 pm by muhoooool »

Re: SDK - Fixboy - Craft time
« Reply #1 on: June 13, 2012, 10:50:31 pm »
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

Re: SDK - Fixboy - Craft time
« Reply #2 on: June 14, 2012, 09:54:09 am »
Craft timeouts actually hardcoded in engine but you can exclude them from engine preccessing
in fix_boy.fos
change
#define FIX_SUCCESS              ( FIXBOY_DEFAULT )
to
#define FIX_SUCCESS                (FIXBOY_DEFAULT^FIXBOY_CHECK_TIMEOUT^FIXBOY_SET_TIMEOUT)
after this craft timeouts and checking for timeouts will be disabled.
So you must proccess timeouts by yourself, for example:
cr.TimeoutBase[TO_SK_REPAIR] =  REAL_MINUTE (1);
cr.TimeoutBase[TO_SK_SCIENCE] = REAL_MINUTE (1); 

Re: SDK - Fixboy - Craft time
« Reply #3 on: June 14, 2012, 09:50:40 pm »
Damn!
This is quite amazing stuff here guys,very interesting!!
Thanks a lot