FOnline Development > General Discussion

[ How to ] SDK - Fixboy - Craft time

(1/1)

muhoooool:
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

Kilgore:
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: ---    uint[] param(1);
    param[0] = crafter.Id;
    CreateTimeEvent(__FullSecond+REAL_SECOND(0), "_CraftingTimeOutPatch", param, false);
--- End code ---

and this outside of void items_crafted:


--- Code: ---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;
}
--- End code ---

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

Skycast:
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); 

muhoooool:
Damn!
This is quite amazing stuff here guys,very interesting!!
Thanks a lot

Navigation

[0] Message Index

Go to full version