Recent Posts

Pages: [1] 2 3 ... 10
1
Questions and Answers / Companion commands and params
« Last post by Gimper on Today at 06:57:07 am »
So I just recently got into the development side of things, and I'm wondering how to use commands to change the parameters of Companion followers. Not sure if it matters, but I'm using a modified version of reloaded s3 source.
2
Questions and Answers / Re: How do we add effects to items?
« Last post by cthulchu on Today at 01:45:43 am »
oh damn it's in the dlls? What a pain.
3
Questions and Answers / Re: How do we add effects to items?
« Last post by Slowhand on February 04, 2025, 10:32:21 am »
https://fodev.net/forum/index.php/topic,30344.msg263772.html#msg263772

Check that on how to change carry weight from extensions.

Once it works, all you need to do is change the formula based on your idea, an example would be if character has backpack in Slot 1 or Slot 2, they would receive extra carry weight and also this solution would be moderately simple to implement. Keep in mind to write simple changes or you will leave server hanging, crashing etc.

This is your current extension function for it:
Code: [Select]
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);
}

You might want to add your change before where the conversion to gramms is called, for example to make the bag add 50 extra, you could do something like:

Code: [Select]
#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);
}

So here I only change for backpack, but you would need to add the all the defines that your server uses for backpacks and change to code accordingly.

NOTE: I did not test it, as I want to make a more complex version, but should be able to get started from here.
4
Features & Articles / Re: FOClassic tutorials
« Last post by Slowhand on February 04, 2025, 10:19:02 am »
A small answer about extensions, for those who do not know what they are. These are DLL's stored in the script folder of your server that affect certain mechanics like if the critter can see another critter, most of their parameters like Strength, Carry Weight, etc. so when your AS script calls for these parameters, these are right before that, so they take effect. This would not be required since we have the engine source open, but before this, it was not open source and recompilable for devs, only AS script were. To change some crucial things, extensions were invented or something along these lines. So they are staying, note that if you cannot find something working differently than expected and you checked the engine and AS as well, you might want to check extension code if it exists for that specific change.

For those who never did it before - Recompiling extensions

Example how to change max character weight:
  • Follow the step in this guide where you earlier had to install Visual Studio 2017 with compile tools for Visual Studio 2010.
  • Launch the extensions solution via VS2017 found in: ../PReloaded/Server/extensions/extensions.sln
  • The IDE might ask questions about old solution file version, just accept all and let him transform to newer version.
  • Press Ctrl + Shift + F to search in all files in the project and search for weight finding the one of the result in parameters.cpp and do your desires changes
  • Now rebuild the solution and you are done, because the rebuild script will also copy the create DLLs to their respective place, in case it does not, you can find the DLLs in ../PReloaded/Server/extensions/Release/ folder and you need to copy them to your scripts folder ../PReloaded/Server/scripts/
5
General Discussion / Re: .
« Last post by Slowhand on February 04, 2025, 09:57:39 am »
If you had a question that you found answer for, then please do not remove topics like this, instead leave the original question and post your answer/solution.
6
Share Your Work / Discord Status Server
« Last post by kompreSor on February 04, 2025, 09:53:01 am »
Hello everyone, 

Since the FOnline Status from fodev has been down for a while, I decided to create an alternative. I've set up a Discord server where bots display the current number of players on various FOnline servers and log historical player counts for reference. 

If any servers are missing, please send me a private message—preferably on Discord. Your message should include: 
- Server name 
- IP address 
- Port 
- Avatar image for the bot 
- Server website link 
- Server Discord link 

https://discord.gg/7hCvxz2GsH
7
News and Announcements / Dating for Sex.
« Last post by NERAKSEY on February 03, 2025, 05:00:12 pm »
8
General Discussion / Re: [ How to ] SDK - Fixboy - Craft time
« Last post by Vaultpunk on January 30, 2025, 09:44:44 pm »
nice
9
General Discussion / .
« Last post by Vaultpunk on January 27, 2025, 01:18:20 pm »
remove topic because bad question
10
General Discussion / Re: SDK - Fixboy - Craft time
« Last post by Feltzer on January 19, 2025, 12:00:25 am »
ty based 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: [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
Pages: [1] 2 3 ... 10