Author Topic: Questions  (Read 4605 times)

Questions
« on: October 25, 2013, 10:43:30 pm »
Does anyone know where I can find tutorials for, or someone who can show me how to do these things:

1. Changing the death penalty from full loot to something else (a custom penalty, not just removing item loss entirely)
2. Adding and editing new towns, NPCs, and items (I know I'll need an artist or artists for this, but I'd like to know how to implement what they create into the game)
3. Changing and adding new dialogue for the game
4. Expanding the world size
5. Making certain areas have different death penalties when you enter them and how to mark them on the map
6. Disable and Enable PVP in certain areas

I'd also like to know:
7. Is this project doable for someone who has no knowledge of AngelScript or C++, but is willing to learn how to change lines of code for this game specifically?
8. Will I definitely need a C++ or AngelScript programmer at some point to complete this project?
9. Do you know of any good places to find programmers and artists, including these forums?

I apologize for the number of questions, but I REALLY want to complete this project. I want to play on a server like this so bad, and I'm willing to read extremely long tutorials to complete this project. I already know how to launch the server and how others can connect to it. I would GREATLY appreciate if you can answer these questions either with a link to a tutorial or a tutorial of your own. I would even put your names in the credits of the game, if you would like. Thank you for at least reading this if you have done so!

-Justin

Re: Questions
« Reply #1 on: October 26, 2013, 02:02:06 am »
Read this if you want to learn about making dialogs http://fodev.net/files/sdk/

You don't need to be an artist to use the fonline mapper. Read the english pdf that comes with the fonline mapper if you want to learn how make new locations. Adding new npc's is also done with the mapper.

Changing the worldmap and it's size is easy. Here is what you need to know http://fodev.net/forum/index.php/topic,25502.msg215494.html#msg215494

Writing scripts with AngelScript can be hard that's why the dev's implemented  MONO. Here http://fodev.net/forum/index.php/topic,26877.0.html
« Last Edit: October 26, 2013, 02:05:44 am by raynor009 »

Re: Questions
« Reply #2 on: October 26, 2013, 02:04:43 am »
Good news and bad news.

Bad news is that if you want to do this yourself, you will have to do some scripting. There are no tutorials as far as I know, the "documentation" is quite limited, and so for this reason, especially if you have zero programming experience from before, the learning curve is steep.

The good news is that what you want to do in itself is very easy. Sounds in fact like quite a good starting project for somebody who wants to learn to work with the SDK. Adding items, changing the world map, making new dialogues and toggling pvp is very easy to do and requires almost no scripting knowledge. Changing the death penalty as per questions 1 and 5 is probably the hardest tasks, but depending on exactly what you have in mind, it should also be pretty easy.


You sound very determined to make it happen. You already have the SDK I assume, so everything is set up. Do you definitely need a C++ / AngelScript programmer? Well, either you learn some very basic stuff for yourself, or you need somebody to do it for you. No way around that. But like I said, the stuff you're aiming for is not exactly rocket science. You just need some patience.



For the rest of the questions...

Quote
Adding and editing new towns
If you mean the maps themselves, you need to work with the mapper. Dunno if there are any good tutorials for that. To get started, you load maps with "~mapname", save maps with "^mapname" and make new maps with "*new". The rest you can probably figure out with google translate and just messing around with the maps.

If your question is refering to adding new locations on the worldmap, look for GenerateWorld.cfg and Locations.cfg in the server/maps folder. You first have to add a location in Locations.cfg, then in GenerateWorld.cfg you add the actual green circle on the worldmap.


Quote
Adding and editing /../ NPCs
To add critters on a map, you use the mapper (or spawn them with a script). If you want to change the statistics of a critter, you can go to server/proto/critters and look at the *.fopro files. Inside you can edit the default parameters such as the SPECIAL, hp, ac, and so on. To add new models with new art is a lot more involved.

Quote
Adding and editing /../ items
To add/alter items, go to server/proto/items. The *.fopro files specify new items, you should be able to figure out roughly what's going on by looking at those files.

Quote
Changing and adding new dialogue for the game
Have a look at this tutorial: http://fodev.net/files/sdk/ArtOfDialogs.pdf

Quote
Expanding the world size
Afaik, all you have to do is replace the image in server/maps. The colour specifies how fast you travel on the map - the brighter the faster. The map you actually see in game is client side, in client/data/art/intrface/wm.

Quote
Disable and Enable PVP in certain areas
You have to add a script to the maps where PvP is disabled. I haven't tested this, but if you want, you can try the following.

First make a new script (just a regular text file that you put in the scripts folder). Call it whatever you want - for example map_nopvp.fos. To register it, go to scripts.cfg and add somewhere the following line:

Code: [Select]
@ server map_nopvp
Then in your file, copy paste the following:

Code: [Select]
#include "_macros.fos"
#include "mapdata_h.fos"


void map_init(Map& map, bool firstTime)
{
    _MapSetMode(MAP_MODE_NO_PVP);
}

Next you open up the map file where you want to disable pvp, and at the top, you see these two lines:

Code: [Select]
ScriptModule         -
ScriptFunc           -

Replace it with:

Code: [Select]
ScriptModule         map_nopvp
ScriptFunc           map_init


This should disable pvp on that map. Assuming it compiles in the first place. And assuming that you're using the 2238 sdk.


Quote
Changing the death penalty from full loot to something else (a custom penalty, not just removing item loss entirely)

/../

Making certain areas have different death penalties when you enter them and how to mark them on the map
Changing the death penalty is the hardest task. I won't walk you through the process, but if you want to try to figure it out for yourself, a good place to start looking would be replication.fos. In the script main.fos, look also at the function critter_dead - that one is called whenever a critter dies.


Quote
Do you know of any good places to find programmers and artists, including these forums?
How much does it pay? ;)



Good luck with your project.

Re: Questions
« Reply #3 on: October 26, 2013, 02:07:03 am »
Holy s**t Lidae you either had this ready to copy and paste you're a damn fast writer :D

Re: Questions
« Reply #4 on: October 26, 2013, 02:13:00 am »
Holy s**t Lidae you either had this ready to copy and paste you're a damn fast writer :D
My keyboard is burning, and still you beat me! D:

Re: Questions
« Reply #5 on: October 26, 2013, 02:39:28 am »
Ok, fuck it. Apparently I'm really bored/helpful tonight.

In _defines.fos, line 871, add:
Code: [Select]
#define MODE_DISABLE_LOOT                        (545)

In main.fos, function critter_use_skill, around line 1190, replace the following:

Code: [Select]
    case SKILL_LOOT_CRITTER:           // Loot critter, only targetCr is valid
    {
        CritterTrophy(targetCr, cr);   // Critters like brahmins should drop meat, skin etc cr.ShowContainer(targetCr,null,TRANSFER_CRIT_LOOT);
        cr.Action(ACTION_PICK_CRITTER, 0, null);
        cr.ShowContainer(targetCr, null, TRANSFER_CRIT_LOOT);
        if(cr.Mode[MODE_HIDE] != 0 && Random(0, 1) == 1 && cr.GetAccess() < ACCESS_TESTER)
            cr.ModeBase[MODE_HIDE] = 0;
        return true;
    }

With this:

Code: [Select]
    case SKILL_LOOT_CRITTER:           // Loot critter, only targetCr is valid
    {
        if (cr.Mode[MODE_DISABLE_LOOT] != 0) return true;
        CritterTrophy(targetCr, cr);   // Critters like brahmins should drop meat, skin etc cr.ShowContainer(targetCr,null,TRANSFER_CRIT_LOOT);
        cr.Action(ACTION_PICK_CRITTER, 0, null);
        cr.ShowContainer(targetCr, null, TRANSFER_CRIT_LOOT);
        if(cr.Mode[MODE_HIDE] != 0 && Random(0, 1) == 1 && cr.GetAccess() < ACCESS_TESTER)
            cr.ModeBase[MODE_HIDE] = 0;
        return true;
    }


That should make it so that you can't loot the critter when it's dead, if the parameter MODE_DISABLE_LOOT is non-zero. Since 0 is the default value for all parameters, you have to set it to for example 1 for all players (if that's what you want). To do this, go to main.fos, function critter_init. At around line 1600, you have this:

Code: [Select]
    if(cr.IsPlayer())
    {
        cr.ParamBase[TO_SLEEPY_STOPPED] = 0;

Replace with this:

Code: [Select]
    if(cr.IsPlayer())
    {
        cr.ParamBase[TO_SLEEPY_STOPPED] = 0;
        cr.ModeBase[MODE_DISABLE_LOOT] = 1;


Now you want to make it so that you actually keep your items when you respawn, rather than having them moved to the ground where you died. In replication.fos, at line 452, replace the following:

Code: [Select]
        if(_CritCanDropItemsOnDead(cr))
        {
            if(!(map.GetLocation().GetProtoId() == LOCATION_Hinkley && IsInsideArena(cr)))
                DropItems(cr);
        }

with this:

Code: [Select]
        if(_CritCanDropItemsOnDead(cr) && cr.Mode[MODE_DISABLE_LOOT] == 0)
        {
            if(!(map.GetLocation().GetProtoId() == LOCATION_Hinkley && IsInsideArena(cr)))
                DropItems(cr);
        }


I think that should do the trick. I don't know what penalty you want for dying instead of losing your items, but this obviously only disables the looting for players. If you want partial loot, it will be a bit more complicated.

I also didn't test this at all, so don't sue me if there's a mistake somewhere.

Re: Questions
« Reply #6 on: October 26, 2013, 02:43:58 am »
Lidae, I could kiss you right now. Come here, seriously. I'm going to kiss you.

Re: Questions
« Reply #7 on: October 26, 2013, 03:15:17 am »
Nevermind, it was my fault sorry!
« Last Edit: October 26, 2013, 03:34:47 am by Aralvar »

Re: Questions
« Reply #8 on: October 26, 2013, 03:34:13 am »
Hm, well ok. Are you using the 2238 SDK?

Anyway, for the critter_init part, the important thing is this:

Code: [Select]
if (cr.IsPlayer()) cr.ModeBase[MODE_DISABLE_LOOT] = 1;Just add that line for example at the first line of critter_init, or the last one. So it looks like this:

Code: [Select]
void critter_init(Critter& cr, bool firstTime)
{
    if (cr.IsPlayer()) cr.ModeBase[MODE_DISABLE_LOOT] = 1;
    /../
}

For the replication.fos, the key line is "DropItems(cr)" - that's what causing the items to be moved to the ground. Search the document for that line, you should find something that at least resembles what I wrote (otherwise it's a little strange). The important thing here is to make sure that DropItems(cr) is not called if the critter's parameter MODE_DISABLE_LOOT is not equal to zero.


Come to think of it, what program are you using to view the file? If you're using notepad, the linebreaks might be screwed up. Try notepad++.

Re: Questions
« Reply #9 on: October 26, 2013, 03:35:55 am »
I'm using the only SDK I can find, from http://svn2.xp-dev.com/svn/fonline_sdk/

Is that not the correct one? I tried googling "FOnline 2238 SDK" and only that turned up.

Agh, I'm an idiot. Just found it I think.

Re: Questions
« Reply #10 on: October 26, 2013, 03:50:55 am »
Yeah, that's the TLA sdk. Check here for 2238: http://fodev.net/forum/index.php/topic,29387.0.html

The explicit solutions I explained above assumes the 2238 sdk, though it would be quite similar for the tla sdk. Which one to use is up to you, you should take whatever is closer to the type of server you want to make.

Re: Questions
« Reply #11 on: October 26, 2013, 03:58:57 am »
Alright, I've got the server running and I'm about to test it. Hopefully it works!

Re: Questions
« Reply #12 on: October 26, 2013, 04:14:56 am »
It worked! I can't thank you enough!

EDIT: Might as well include more questions here

In GenerateWorld.cfg, I get what the numbers on the left mean, but what do the numbers on the right represent? For example:

"@ 50 1512 1965"

Is the "1512 1965" a coordinate perhaps?
« Last Edit: October 26, 2013, 08:43:38 pm by Aralvar »

Offline Ghosthack

  • Rotator
  • Bytecruncher
Re: Questions
« Reply #13 on: October 26, 2013, 09:31:04 am »
In GenerateWorld.cfg, I get what the numbers on the left mean, but what do the numbers on the right represent? For example:

"@ 50 1512 1965"

Is the "1512 1965" a coordinate perhaps?

[@ means active] location_pid x y

Additionally use the WorldEditor in the tools directory if you easily want to modify worldmap locations (or various other things).

Re: Questions
« Reply #14 on: October 26, 2013, 07:44:01 pm »
Thanks!