Author Topic: How to get mercenaries in the FOnline SDK?  (Read 8334 times)

How to get mercenaries in the FOnline SDK?
« 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-

Offline Michaelh139

  • Goin for 900,000...
Re: How to get mercenaries in the FOnline SDK?
« Reply #1 on: April 13, 2011, 01:11:20 am »
Pretty sure this is a 2238 only thing, ya know, they made and scripted themselves.  Unless you mean like, Followers from fo2?
Whenever I say something, imagine \"In my opinion"/ being in the front of every sentence.

Offline Ganado

  • Moderator
  • Dishonest Abe
Re: How to get mercenaries in the FOnline SDK?
« Reply #2 on: April 13, 2011, 01:18:33 am »
Unless you mean like, Followers from fo2?
I don't think that's part of the FOnline Engine SDK either.
Error while opening cfg file: spawnnpc.cfg
Shit! Damn admins! Always ruining my fun! I guess I'll talk to them. WITH MY FISTS!!!! No seriously, I will write them a nice email or make a thread on the forums or something. Thanks!

Re: How to get mercenaries in the FOnline SDK?
« Reply #3 on: April 13, 2011, 01:41:58 am »
Quote
   /// 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-

Offline Wipe

  • Rotator
  • Random is god
Re: How to get mercenaries in the FOnline SDK?
« Reply #4 on: April 13, 2011, 01:57:22 am »
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.
Games are meant to be created, not played...

Re: How to get mercenaries in the FOnline SDK?
« Reply #5 on: April 13, 2011, 01:58:19 am »
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-

Offline Janusz2238

  • forum.newfmc.pl
Re: How to get mercenaries in the FOnline SDK?
« Reply #6 on: April 13, 2011, 01:08:27 pm »
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.

Code: [Select]
#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");
}
}
Polskie Pustkowia http://forum.newfmc.pl/

Re: How to get mercenaries in the FOnline SDK?
« Reply #7 on: April 13, 2011, 03:57:11 pm »
Alright, if i manage to create something more complex i'd be happy to share.

And once again thank you.

-Ulrek-

Offline Janusz2238

  • forum.newfmc.pl
Re: How to get mercenaries in the FOnline SDK?
« Reply #8 on: April 13, 2011, 04:16:28 pm »
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
Quote
@ server module your_script_file_name      
- add to dialog, result function(via dialog editor):
Code: [Select]
your_script_file_name@r_AddMercenary
« Last Edit: April 13, 2011, 04:25:18 pm by Janusz2238 »
Polskie Pustkowia http://forum.newfmc.pl/

Re: How to get mercenaries in the FOnline SDK?
« Reply #9 on: April 19, 2011, 08:06:16 am »
What mercenaries do I get? How it work? Can I make example in NCR mercenaries Rangers and in Navarro Enclave guys? What about prices?

Offline Janusz2238

  • forum.newfmc.pl
Re: How to get mercenaries in the FOnline SDK?
« Reply #10 on: April 19, 2011, 08:29:38 am »
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.
Polskie Pustkowia http://forum.newfmc.pl/

Re: How to get mercenaries in the FOnline SDK?
« Reply #11 on: May 30, 2011, 08:26:21 pm »
How to chose an answer?
or dialog node?
« Last Edit: May 30, 2011, 08:28:16 pm by BlindMaster »

Offline Surf

  • Moderator
  • это моё.
Re: How to get mercenaries in the FOnline SDK?
« Reply #12 on: May 30, 2011, 08:29:14 pm »
A good start would be to open the dialogeditor.

Re: How to get mercenaries in the FOnline SDK?
« Reply #13 on: July 22, 2011, 01:02:43 am »
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

Re: How to get mercenaries in the FOnline SDK?
« Reply #14 on: June 16, 2012, 07:55:41 pm »
Hello!
Here is the scrip edit for proper mercs!
These guys attck and defend.

Code: [Select]
#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" );

}
}
« Last Edit: June 21, 2012, 10:05:44 am by JovankaB »