April 18, 2024, 10:30:15 am
Username:

Password:

Topic: Questions/Feedback for the FOnline tutorials.  (Read 6071 times)

Slowhand

  • Posts: 278
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Questions/Feedback for the FOnline tutorials.
« on: December 25, 2015, 01:18:18 pm »
If you have any questions or feedback for the tutorials, please ask them here instead of replying to the tutorial thread.

I moved some of the feedback/questions/links from the original thread that I will clean up soonish..

1.
For dialogs this is a must read in my opinion:
http://fodev.net/files/sdk/ArtOfDialogs.pdf

2.
Interesting, I'll try coding something  :P

3.
This is a fantastic amount of work. Do not let silence effect you - i think everyone here is impressed and appreciative of this. Thanks!

4.
Excellent to have a good guide here. Learning this stuff on your own is torture. And maybe I will learn some of this too so I can add enemies to some map I make in the future.

5.
Lack of documentations and tutorials like this one make fonline development hard.

Ask questions in this thread.
« Last Edit: December 25, 2015, 01:21:43 pm by Slowhand »

Blarney

  • Posts: 317
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #1 on: December 31, 2015, 10:33:25 am »
I was wondering why you had put your tutorials in the toxic caves, I see now you were just moving (and pinning) them :)

@Vehemence, And what exactly have you done? Besides shit on peoples ideas here, what inspired you to talk about your feelings toward his suggestions, none of which I see your comments on in the first place?

Sometimes it better to keep your mouth shut and let people think you a fool, then to open your mouth and remove all doubt.
« Last Edit: December 31, 2015, 10:43:59 am by Blarney »

Slowhand

  • Posts: 278
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #2 on: December 31, 2015, 11:48:21 am »
I was wondering why you had put your tutorials in the toxic caves, I see now you were just moving (and pinning) them :)

I restructured them, split out the ones that were harder to understand to the advanced tutorials. Also the tutorials I make, that include concrete code, and rely on knowing basic stuff, will go to the advanced part. The basics is only for creating a quest of type, kill X at Y location or something, easy. Advanced are and will be, roulette, maybe some other card game with interface if it is possible to make, making perks (Mysterious Stranger), making dungeon/maze with randomized path and content, fix some bugs and show where the problem relied, but all this with time.

You can see the tutorials at Toxic caves, because that is the old thread, which I could not delete bc of sticky? and instead it moved there. Not sure how Toxic caves works, but I believe if you delete a thread, it ends up there.
« Last Edit: December 31, 2015, 11:51:39 am by Slowhand »

Yuno-Gasai

  • Supporter
  • Posts: 216
  • Hi, hehe
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #3 on: January 01, 2016, 09:20:16 am »
Can you do a tutorial on adding new items?
Spoiler: show


Spoiler: show

Slowhand

  • Posts: 278
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #4 on: January 01, 2016, 09:32:33 am »
Can you do a tutorial on adding new items?

Yes, I will add a tutorial about that as well, as soon as I cover it, lol, since I don't know it myself yet.

It would be definitely useful.

Yuno-Gasai

  • Supporter
  • Posts: 216
  • Hi, hehe
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #5 on: January 01, 2016, 09:41:48 am »
Well here's what I managed to do.

I added the FRM files of the new armors I wanted which were my camo'd desert armors I made. Then I made a new PID for it which was PID_CAMO_ARMOR and in CritterTypes.cfg I added

Code: [Select]
# Camouflaged Desert Combat Armor
@  333    hfcmbe     11   0   0    1    1    1    1    1      1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0    400  200   4  8  0  0    -
@  334    hmcmbe     11   0   0    1    1    1    1    1      1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0    400  200   4  8  0  0    -
########################################

It seems to have worked since I'm now able to change the skin of my character to it.

I also made a copy of Combat armor and modified it to this. I added the inventory picture and changed the ground picture to blue CA, but since my client is modded, green CA looks like black CA.

I'm still playing around so I'll keep you posted.

EDIT : I have managed to make it an armor now but can't seem to equip it.

Spoiler: show


EDIT #2 : Success! I couldn't figure out how to make it equipabble but I just made a copy of Brotherhood armor, modified it, and now I got a cool dank Camo'd Desert Armor ingame!  ;D

Spoiler: show



Yes description is crap

Now I just need to make proper inventory and ground pictures and should be good to go. Other than adding spawns, NPCs with it :P

Now to try adding 3D things  :P
« Last Edit: January 01, 2016, 10:09:59 am by Yuno-Gasai »
Spoiler: show


Spoiler: show

Slowhand

  • Posts: 278
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #6 on: January 01, 2016, 10:40:59 am »
Gj, keep exploring. When I start to change/add items, I will probably try silencers for weapons, if that is not solved already.

Slowhand

  • Posts: 278
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #7 on: January 13, 2016, 11:14:34 pm »
Hello, i see you know alot about reloaded source so i hope you can help me, im searching for which items can spawn in graves (golgotha/den/redding/cathedral) but i cant find it anywhere.

Here is what I did:

( you can do this with Total commander search in script folders, but I recommend installing an IDE to browse the scripts, I used Codeblocks, not the best, but at least you can find a tutorial how to install it and use it to browse the code, here.


I searched for "grave" and it gave a lot of results, but I selected something related to definition like this:
#define PID_GRAVESITE_V                     (344)
#define PID_GRAVESITE_H                     (345)

To follow this trail, with CodeBlocks, U just right click on the PID_GRAVESITE_V and select: "Find references of: ..". It will list all the references to this item. I searched around a bit and found some interesting code, which did not link to your request but to some GM events, so I skipped that, and found the following reference in "grave.fos":
Code: [Select]
void GraveRandomPic(Item@ grave)
{
    if(grave.GetProtoId() == PID_GRAVESITE_V)
        grave.PicMap = GetStrHash("art\\items\\grave" + Random(1, 4) + ".frm");
    else
        grave.PicMap = GetStrHash("art\\items\\grave" + Random(5, 7) + ".frm");
}

Now, this does not affect the items directly, bit it gives us a clue, that somewhere where this function is called, we might find more info as well, so finding the references for "GraveRandomPic(..)" leads to the file "grave.fos". It seems about right. Check the following funciton:
Code: [Select]
void _Init(Item& grave, bool firstTime)
{
    grave.SetEvent(ITEM_EVENT_SKILL, "_UseSkill");
    grave.SetEvent(ITEM_EVENT_USE_ON_ME, "_UseItem");
    grave.SetEvent(ITEM_EVENT_FINISH, "_Finish");

    if(firstTime)
    {
        GraveRandomPic(grave);
        MultihexSpawned(grave);
    }

    array<uint> values = { grave.Id };
    CreateTimeEvent(AFTER(0), "e_Init", values, true);
}

There are a lot of events created, checking the e_Init event code:

Code: [Select]
uint e_Init(array<uint>@ values)
{
    Item@ grave = GetItem(values[0]);
    if(valid(grave))
    {
        uint16 x, y;
        Map@   map = grave.GetMapPosition(x, y);
        if(valid(map))
        {
            uint16 p = map.GetProtoId();
            if(p == MAP_DenBusiness || p == MAP_Redding || p == MAP_NewReno_Golgotha || p == MAP_Cathedral_Enter)
            {
                ConnectRecycler(grave, ENCOUNTER_RECYCLER);
            }
        }
    }
    return 0;
}

Since there are no other clues about filling those graves, since the tool in event_utils.fos is never called, we must sniff somewhere around that mysterious recycler. The first comment we find about it that some variables are built into engine, but probably the loot is not., but we do not find anything of usable so the other functions must give some clue, for example the function "void GraveOpen(Item@ grave, Critter@ cr, Item@ shovel)" in the same script file. And yes, it looks like this is the function that will generate the loot for us, for example there is a 1/10,000 chance to find a gold tooth or a decomposed body. Unfortunately the rest of the code contains only Karma related stuff, it looks like you have higher chances of not getting low karma if grave digging at night.

To find the rest of the loot, the clue lies in a comment: "    // Move pickable items lying on the grave into the grave" and checking the code, it seems that this is right, since every item lying on the multihex grave, will be moved to the grave. To find what these items are, well, we have to search around for "grave" word again.

This time we find another definition:
Code: [Select]
#define EC_TYPE_NONE               (0)
#define EC_TYPE_CONTAINER          (1)
#define EC_TYPE_GRAVE              (2)

This gives us the clue (EC = encounter?!) that graves are treated as encounter lockers. Ofc, you as a experienced player, might know a few about the loot, maybe they usually have the same loot, I don't know however..

Reading most of code through from "ecnounter_containers.fos" will show that graves are treated as lockers in random encounters, except their chance to contain item, is less (1/4). The code before used for the 4 maps you mentions, was used by the recycler, it looks like since the graves are on a static map instead on encounters, this recycler is used to refill them from time to time, or dispose of the unlooted stuff.

It looks like the perk treasure hunter works for graves as well :)

The code that populates it with items, is the "MakeSpawnerContainer(item, spawner);", jumping to definition, we find out of the scripts located in "spawner_container.fos". First, by exploring a bit, jumping to definitions, we find the "spawner_containers_h.fos" with a lot of definitions about spawner types. Looks likes these definitions are defined, but not used when adding spawn types, so to progress further we might "whole word" search in the "spawner_container.fos" script file for the exact values we want to find, in our case for 13 and 14:
Code: [Select]
#define SPAWNER_CONTAINER_GRAVE_LOW           (13)
#define SPAWNER_CONTAINER_GRAVE_HIGH          (14)
We do not find anything, that leaves us wondering about it, and then check the code more thoroughly, and it seems, that: "array<ItemSpawner@> spawners;" is responsible for spawning stuff and after looking at the "ADD_ITEMSPAWNER" macro that is used a lot in the init function, it seems that we did not find the index usage of 13 and 14, nor their defines, because it was added with .insertLast() to the array, which makes sense now. So, the spawners[13] (or spawners[SPAWNER_CONTAINER_GRAVE_LOW]) would be responsible for spawning our items into the grave, well, near the grave on entires and then putting it into the grave, but that's the same for us. So we have the find the 13th and 14th macro of "ADD_ITEMSPAWNER", which will result in:

Final result:

You have the chance to find the items with the PIDS listed below:

Code: [Select]
    ADD_ITEMSPAWNER(encounter_grave_low_13,
                    SpawnTime(0, 0).SetSeparate(true).
                    AddItem(PID_BLUEPRINT_RANDOM_2, 10).
                    AddItem(PID_SAND_ROBE, 20).
                    AddItem(PID_DICE, 5).
                    AddItem(PID_LOADED_DICE, 2).
                    AddItem(PID_MAGIC_8_BALL, 1).
                    AddItem(PID_LOCKPICKS, 10).
                    AddItem(PID_LIGHTER, 20).
                    AddItem(PID_CIGARETTES, 30).
                    AddItem(PID_BEER, 30, 1, 3).
                    AddItem(PID_BOOZE, 20, 1, 2).
                    AddItem(PID_BOTTLE_CAPS, 80, 30, 70)

High roll:
Code: [Select]
    ADD_ITEMSPAWNER(encounter_grave_high_14,
                    AddItem(PID_BLUEPRINT_RANDOM_3, 10).
                    AddItem(PID_SAND_ROBE, 20).
                    AddItem(PID_DICE, 5).
                    AddItem(PID_LOADED_DICE, 2).
                    AddItem(PID_MIRROR_SHADES, 1).
                    AddItem(PID_MAGIC_8_BALL, 1).
                    AddItem(PID_LOCKPICKS, 10).
                    AddItem(PID_TALISMAN, 1).
                    AddItem(PID_LIGHTER, 20).
                    AddItem(PID_CIGARETTES, 30).
                    AddItem(PID_BEER, 30, 1, 3).
                    AddItem(PID_BOOZE, 20, 1, 2).
    AddItem(PID_ZIP_GUN, 1).
    AddItem(PID_RED_RYDER_LE_BB_GUN, 1).
                    AddItem(PID_BOTTLE_CAPS, 80, 136, 300)
                    );

I never opened any grave, but if you did, you probably can tell if it sounds about right or not.

Edit:

Since we are here, we might be interested in finding out what the containers could contain on encounters, for which we would need to check the previous "few" lines for the low, mid and high encounter rolls.

It looks like I wasn't right, because he had different results playing the game, however the final test I left for him, as I wanted to move on to finishing the gambler.

Quote
i searched grave.fos and spawner_container.fos too earlier but didnt found anything thats why i asked you
sadly, results arent right i have never found any caps or blueprints in graves and i found alot of other stuff, leather jackets, laser rifles, plasma rifles, combat armors for example

Well in this case, what's left to do is to rewrite (remove most of) the data/functions, to minimize it only to one item, for example an eight ball or something rare.

If you do that, and when u dig graves, find only 8 balls, it will mean that the code is right to look at maybe the randomization is such that one would think differently.
« Last Edit: January 14, 2016, 12:03:27 am by Slowhand »

mojuk

  • Posts: 332
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #8 on: January 14, 2016, 12:02:59 am »
Code: [Select]
#define SPAWNER_CONTAINER_GRAVE_LOW           (13)
#define SPAWNER_CONTAINER_GRAVE_HIGH          (14)
Are used (well, are not but can be) to spawn items in grave-type containers in encounters. What Seki asked are graves in public locations

Code: [Select]
            if(p == MAP_DenBusiness || p == MAP_Redding || p == MAP_NewReno_Golgotha || p == MAP_Cathedral_Enter)
            {
                ConnectRecycler(grave, ENCOUNTER_RECYCLER);
            }
Here is your clue where to look -> recycler.fos
Those graves are filled with stuff recycled from deleted encounters (and tents but as I recall this is not used).

So you can find what types of items are taken from encounters:
Code: [Select]
    array<int> itemTypes =
    {
        ITEM_TYPE_ARMOR,
        ITEM_TYPE_DRUG,
        ITEM_TYPE_WEAPON,
        ITEM_TYPE_AMMO,
        ITEM_TYPE_KEY,
        ITEM_TYPE_BLUEPRINT
    };
I think some people might be worried but tent maps lost in encounters will not be collected and spawn in some random grave giving somebody access to your tent :)
« Last Edit: January 14, 2016, 12:32:50 am by mojuk »
:facepalm

Slowhand

  • Posts: 278
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #9 on: January 14, 2016, 12:05:24 am »
Okay then, problem solved, the right answer above.

S.T.A.L.K.E.R

  • Posts: 946
  • S.🅱.A.W.N.E.A.S.T
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #10 on: January 14, 2016, 10:11:51 pm »
Thanks for the modifying map tutorial  :D

I was trying to modify a map but got frustrated when the server didn't start up. So I looked at your tutorial and fixed the problem :P

S.T.A.L.K.E.R

  • Posts: 946
  • S.🅱.A.W.N.E.A.S.T
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #11 on: January 22, 2016, 11:43:14 am »
Any idea how to add a new sound?

Slowhand

  • Posts: 278
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #12 on: January 22, 2016, 01:48:33 pm »
Any idea how to add a new sound?

No, I haven't explored the sound part, but might look into that, maybe it's easy and fast to figure it out.

jarok

  • Posts: 339
  • Howdy, partner.
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #13 on: April 06, 2016, 09:34:44 pm »
Are you goine to continue tutorials? Will you cover topic about gm tools, how to use it, customize commands like lvl up, heal, spawn friendly or hostile npcs in gm menu?
I'm badass and I will kick your asses.

Slowhand

  • Posts: 278
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Re: Questions/Feedback for the FOnline tutorials.
« Reply #14 on: April 30, 2016, 05:04:02 pm »
Are you goine to continue tutorials? Will you cover topic about gm tools, how to use it, customize commands like lvl up, heal, spawn friendly or hostile npcs in gm menu?

Hey.

I'm not active on this or any other FOnline project currently, probably I'll come back and check next winter break, around Christmas.

Laters.