fodev.net
FOnline Development => General Discussion => Topic started by: Ulrek on April 13, 2011, 01:09:21 am
-
Hey...
Well, i've looked over the files, and i've found settings, but i cant quite figure out how to create mercenaries/followers. can anyone point me in the right direction?
-Ulrek-
-
Pretty sure this is a 2238 only thing, ya know, they made and scripted themselves. Unless you mean like, Followers from fo2?
-
Unless you mean like, Followers from fo2?
I don't think that's part of the FOnline Engine SDK either.
-
/// Mercenary settings
#define MERC_BEGIN (800)
#define MERC_END (809)
#define MERC_COUNT (MERC_END-MERC_BEGIN+1)
#define MERC_MASTER_ID (800) // Id õîçÿèíà ìåðêà
#define MERC_ALWAYS_RUN (801) // Ïðèçíàê, ìåðê ïåðåìåùàåòÿ áåãîì ïðè ñëåäîâàíèè çà õîçÿèíîì
#define MERC_CANCEL_ON_ATTACK (802) // Ïðèçíàê, îòìåíÿåò ëè ìåðê ñëóæáó, åñëè õîçÿèí àòàêóåò ñàìîãî ìåðêà.
#define MERC_LOSE_DIST (803) // Äèñòàíöèÿ, ïðè ïðåâûøåíèè êîòîðîé ìåðê "îòñòàåò" îò õîçÿèíà è îòìåíÿåò ðåæèìå ìåðêà.
#define MERC_MASTER_DIST (804) // Äèñòàíöèÿ, êîòîðîé ïðèäåðæèâàåòñÿ ìåðê â ðåæèìå ñëåäîâàíèÿ çà õîçÿèíîì
#define MERC_TYPE (805) // Òèï ìåðêà. Ñì. merc_h
#define MERC_DEFEND_MASTER (806) // Ïðèçíàê: ìåðê çàùèùàåò õîçÿèíà, åñëè òîò àòàêîâàí
#define MERC_ASSIST_MASTER (807) // Ïðèçíàê: åñëè õîçÿèí àòàêóåò öåëü, ìåðê ïðèñîåäèíÿåòñÿ ê àòàêå
#define MERC_CANCEL_TIME (808) // Âðåìÿ çàâåðøåíèÿ ñëóæáû
#define MERC_CANCEL_ON_GLOBAL (809) // Ïðèçíàê: ìåðê îòìåíÿåò ñëóæáó, åñëè õîçÿèí âûøåë íà ãëîáàëüíóþ êàðòó.
This is from the "_defines" file. so there does seem to be settings made for it. at least for a prototype.
Anyone have any ideas?
-Ulrek-
-
This are only param numbers; check most obvious - merc.fos and q_npc_v13_dclaw.fos as an example of use. Eventually look for "Merc2Player" in other *.fos files.
-
This are only param numbers; check most obvious - merc.fos and q_npc_v13_dclaw.fos as an example of use. Eventually look for "Merc2Player" in other *.fos files.
Alright, thanks.
-Ulrek-
-
I write simple function for you. If you call it from dialog, you will get merc. I dond check any demand, so you can use it for build some more complex function. If you build more code, share with others.
#include "_defines.fos"
#include "_npc_pids.fos"
import bool GetFreeHex(Map& map, uint radius, uint16& hx, uint16& hy) from "caravan";
import void r_AddMerc2Player(Critter & player, Critter @ npc) from "merc";
// Dialog result
void r_AddMercenary(Critter& player, Critter@ npc)
{
Map @mapa = player.GetMap();
if(@mapa!=null)
{
uint16 hX = player.HexX;
uint16 hY = player.HexY;
GetFreeHex(mapa, 1, hX, hY);
Critter@ merc = mapa.AddNpc(NPC_PID_BountyHunter_10, hX, hY, player.Dir,null,null,null);
r_AddMerc2Player(player, merc);
merc.Say(SAY_NORM_ON_HEAD, "I will save your ass Ulrek boy");
}
}
-
Alright, if i manage to create something more complex i'd be happy to share.
And once again thank you.
-Ulrek-
-
No problem. If someone else woudl use this code, I write instruction "just in case":
- make new script, and paste code from post; (file: your_script_file_name.fos)
- add script to scripts.cfg @ server module your_script_file_name
- add to dialog, result function(via dialog editor): your_script_file_name@r_AddMercenary
(http://newfmc.pl/files/obrazki/DialogFunctionResult.png)
-
What mercenaries do I get? How it work? Can I make example in NCR mercenaries Rangers and in Navarro Enclave guys? What about prices?
-
You must implement prices by yourself.
Choose NPC in NCR, and edit his dialog file(Server/Dialogs). To edit dialog you use(/Server/Tools/DialogEditor).
You must add result script, I show it in last post.
-
How to chose an answer?
or dialog node?
-
A good start would be to open the dialogeditor.
-
Heya, i was just wondering.. i need a way to set the AI to the merc. I can spawm him and he follows me only in local map.
Ive found that merc.fos is the main script for him and it includes merc dialog and all.
So there must be a way to link "merc.fos" or the AI to him.
At least a way to include it as a new AI package
Thanks
-
Hello!
Here is the scrip edit for proper mercs!
These guys attck and defend.
#include "_defines.fos"
#include "_npc_pids.fos"
import bool GetFreeHex(Map& map, uint radius, uint16& hx, uint16& hy) from "caravan";
import void r_AddMerc2Player(Critter & player, Critter @ npc) from "merc";
// Dialog result
void r_AddMercenary(Critter& player, Critter@ npc)
{
Map @mapa = player.GetMap();
if(@mapa!=null)
{
uint16 hX = player.HexX;
uint16 hY = player.HexY;
GetFreeHex(mapa, 1, hX, hY);
Critter@ merc = mapa.AddNpc(NPC_PID_MercenaryMale, hX, hY, player.Dir,null,null,null); // NPC_PID IS NPC FROM _npc_pids.fos /server/scripts
r_AddMerc2Player(player, merc);
merc.Say(SAY_NORM_ON_HEAD, "Yessir");
merc.StatBase[ ST_AI_ID ] = 55; // AI OF NPC FROM _ai.fos /server/scripts ( set to vic defensive )
merc.StatBase[ ST_TEAM_ID ] = 0; // TEAM FROM _teams.fos ... set to plyer?
merc.StatBase[ ST_DIALOG_ID ] = 30000; // DIALOG
merc.MercBase[ MERC_DEFEND_MASTER ] = 1;
merc.MercBase[ MERC_ALWAYS_RUN ] = 1;
merc.MercBase[ MERC_ASSIST_MASTER ] = 1;
merc.MercBase[ MERC_CANCEL_ON_ATTACK ] = 1;
merc.SetScript( "merc@_MercInit" );
}
}
-
Nice work! simple too. Easy to understand. I imagine that slavery would be similar and would just need a little more beef in the middle when it comes to using a rope and such.
-
Awesome idea!
Can you post the script when you figure it out!
Also it would be a good idea to STiCKY the figured out things! :)
Thanks
-
Sure, i'll see what i can do. I think there will need to be new critters though. (Copied from certain critters that you want enslavable with a different name and ID and the originals having a pause coded in when knocked unconscious to do a call for the rope.) Would involve editing the rope proto, and the main.fos aswell maybe.
-
please guide for stupid. What I do not understand where attributed. Thank you.
For example: the name of the script -> Add the line "I am a moron" -> open dialog "blah blah" and add the line "I need a mercenary"
-
please guide for stupid. What I do not understand where attributed. Thank you.
For example: the name of the script -> Add the line "I am a moron" -> open dialog "blah blah" and add the line "I need a mercenary"
I don't understand your question. Use full phrases and try to explain the problem more clearly,
not some arrows and "blah blah". If you are too lazy to write a proper question, do not expect
much success with scripting.
-
I do not know how can I add to my Fallout mercenaries. if I have to create / edit the script, or just edit the dialogue ... I did not understand it.
-
I do not know how can I add to my Fallout mercenaries. if I have to create / edit the script, or just edit the dialogue ... I did not understand it.
The function in the script which adds mercenary does not run magically by itself, it must be triggered by something.
So you must for example call the function from a dialog (from dialog node result). So you need the script AND a dialog
which calls the scripts when talking to an NPC. Janusz2238 explained it quite clearly.
-
here (http://fonline.ru/forum/showthread.php?t=21430) u can find a very "crude" merc control
but there is a small trouble about control packets:
How to change it in real time?
How to add new control packets?(better with detailed FAQ)