FOnline Development > General Discussion
TC Problem
DESTRO00PL:
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?
Ghosthack:
Hi,
towns.fos, e.g here's for Modoc: https://github.com/rotators/fo2238/blob/master/Server/scripts/towns.fos#L93-L114
DESTRO00PL:
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;
--- End quote ---
When i change the uint number to 1 SDK crash i dont know where i go wrong :/
Slowhand:
--- Quote from: DESTRO00PL on January 09, 2016, 01:50:40 pm ---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 :/
--- End quote ---
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: --- #ifndef __DEBUG__
.SetNearbyMemberRequirement(3)
.SetTotalMemberRequirement(3)
.SetInfluenceMemberRequirement(99)
--- End code ---
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: --- #ifdef __DEBUG__
.SetNearbyMemberRequirement(1)
.SetTotalMemberRequirement(1)
.SetInfluenceMemberRequirement(1)
#endif
--- End code ---
Gl.
Edit: You can find a tutorial how to setup CodeBlocks project over the SDK here.
DESTRO00PL:
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;
--- End quote ---
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?
Navigation
[0] Message Index
[#] Next page
Go to full version