Author Topic: TC Problem  (Read 4490 times)

TC Problem
« on: January 08, 2016, 04:19:33 pm »
Hey
I need help with TC i need change the number of players to take control of town, where i must change to do soo?

Offline Ghosthack

  • Rotator
  • Bytecruncher
Re: TC Problem
« Reply #1 on: January 08, 2016, 10:19:17 pm »

Re: TC Problem
« Reply #2 on: January 09, 2016, 01:50:40 pm »
Hi i have different file i use fonline:Reloaded SDK
I found this line

Quote
ITown@ SetInfluenceMemberRequirement(uint number)
    {
        this.memberInfluenceReq = number;
        return this;
    }

    ITown@ SetTotalMemberRequirement(uint number)
    {
        this.memberTotalReq = number;
        return this;
    }

    ITown@ SetNearbyMemberRequirement(uint number)
    {
        this.memberNearbyReq = number;
        return this;

When i change the uint number to 1 SDK crash i dont know where i go wrong :/


Offline Slowhand

  • Go for the eyes, Boo! Go for the eyes!
Re: TC Problem
« Reply #3 on: January 10, 2016, 09:21:30 am »
Hi i have different file i use fonline:Reloaded SDK
I found this line

When i change the uint number to 1 SDK crash i dont know where i go wrong :/

First:

If you modify something in the scripts, (filename.fos) you should compile it with:
compile.bat "filename.fos" - if it is a server scripts
compile_client.bat "filename.fos" - if it is a client script

In your case compile.bat, (just go to "\server\scripts\" folder, and run there form command line) what this does is it will show possible error, it's faster and you will see the line number where things went wrong easier.

If everything compiles that you have changed or created, then run the server.

Second:

What you did there, was wrong, because you tried to change the prototype of a function. The "uint number" is an argument, variable, that will have a value that is determined when the function is called.

Function prototype/signature/whatever you call it: ITown@ SetInfluenceMemberRequirement(uint number)
Function call: town = SetInfluenceMemeberRequirement(1);

So you have to browse the source file, and change the numeric value from let's say 5, to 1.

I also advise you to learn a bit of C/C++/C#/Java programming (any of those), just do some "Hello world" examples, maybe make a program that calculates the area of a square or a triangle, then read the Basic FOnline tutorials on this site.

To not to let you totally down, here is what you needed to do:

 - Search for SetTotalMemberRequirement in the scripts. (All of the files, you can use TotalCommander, or if you set up some IDE to program in, then using that)
 - Find the "void InitTowns()" function in the file named: "towns.fos", which has a function call to "ADD_TOWN(Modoc, "Modoc", SetMapID(map_modoc.Id)" which has part that looks like this:
Code: [Select]
             #ifndef __DEBUG__
             .SetNearbyMemberRequirement(3)
             .SetTotalMemberRequirement(3)
             .SetInfluenceMemberRequirement(99)
The #ifndef __DEBUG__ means that this executes if you are not in debug mode, which is used for testing. In your case you need to change these values accordingly, maybe to 1?

Other options are to run in test mode, by inserting a line on top of this file: "#define __DEBUG__", and then you do not have to change values, because people tested it with 1 players, see the source:
Code: [Select]
             #ifdef __DEBUG__
             .SetNearbyMemberRequirement(1)
             .SetTotalMemberRequirement(1)
             .SetInfluenceMemberRequirement(1)
             #endif

Gl.

Edit: You can find a tutorial how to setup CodeBlocks project over the SDK here.
« Last Edit: January 10, 2016, 09:24:56 am by Slowhand »

Re: TC Problem
« Reply #4 on: January 11, 2016, 06:06:18 pm »
i change this in town.fos
Quote
ITown@ SetInfluenceMemberRequirement(uint number)
    {
        this.memberInfluenceReq = 0;
        return this;
    }

    ITown@ SetTotalMemberRequirement(uint number)
    {
        this.memberTotalReq = 0;
        return this;
    }

    ITown@ SetNearbyMemberRequirement(uint number)
    {
        this.memberNearbyReq = 0;
        return this;
and this work perfectly;)

And another question:P where is the script responsible for the amount of experience for killing enemies? Can you do experience x2?
« Last Edit: January 12, 2016, 09:24:44 am by DESTRO00PL »

Re: TC Problem
« Reply #5 on: January 17, 2016, 04:09:06 pm »
Any sugestions?

JovankaB

  • Guest
Re: TC Problem
« Reply #6 on: January 17, 2016, 07:42:29 pm »
The amount of experience is defined in critter proto files (param ST_KILL_EXPERIENCE).

The part of the script responsible for giving xp for kills is in combat.fos:
https://github.com/rotators/fo2238/blob/1d2c7c8223bc1724af1b50c022d3600d1ddfb2e3/Server/scripts/combat.fos#L1931

To double it you just have to change
attacker.StatBase[ST_EXPERIENCE] += target.Stat[ST_KILL_EXPERIENCE];
to
attacker.StatBase[ST_EXPERIENCE] += (2 * target.Stat[ST_KILL_EXPERIENCE]);
« Last Edit: January 18, 2016, 01:23:21 am by JovankaB »

Re: TC Problem
« Reply #7 on: January 19, 2016, 11:05:52 am »
thanks its workd.