For dialogs this is a must read in my opinion:
http://fodev.net/files/sdk/ArtOfDialogs.pdf (http://fodev.net/files/sdk/ArtOfDialogs.pdf)
Interesting, I'll try coding something :P
This is a fantastic amount of work. Do not let silence effect you - i think everyone here is impressed and appreciative of this. Thanks!
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.
Lack of documentations and tutorials like this one make fonline development hard.
I was wondering why you had put your tutorials in the toxic caves, I see now you were just moving (and pinning) them :)
Can you do a tutorial on adding new items?
# 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 -
########################################
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.
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");
}
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);
}
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;
}
#define EC_TYPE_NONE (0)
#define EC_TYPE_CONTAINER (1)
#define EC_TYPE_GRAVE (2)
#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: 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)
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 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
#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 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 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 :)
Any idea how to add a new sound?
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?