• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Beggars

zorglub

Privateer
Storm Modder
Ahoy fellow pirates & privateers!

I finally took the time to upload onto the new ftp server a small mod I had done some weeks ago. It's called beggars.rar' in the PotC section, in the 'a simple virtual sailor' folder. The idea was to give a beg animation to beggars sitting on the floor, like Henry the beggar in Redmond, to give more life to the game. A kind of communication/interaction without the dialog interface.

FOR TESTERS :
- backup the original PROGRAM\Loc_ai\types\Lai_poor.c somewhere,
- extract the 'beggar.rar' into your game directory, and overwrite the existing file. It should be compatible with any game version from stock PotC to the latest build version as it appears that the Lai_poor.c was forgotten by modders...

- if you're using stock PotC to Build 13 : add the following lines in RESOURCE\INI\ALIASES\sound_alias.ini
Code:
[beggar]
minDistance = 5.0
maxDistance = 40.0
name = VOICE\ENGLISH\Beggar_01.wav

[beggar_spa]
minDistance = 5.0
maxDistance = 40.0
name = VOICE\ENGLISH\Beggar_01.wav
name = VOICE\ENGLISH\Beggar_spa.wav

[beggars_eng]
minDistance = 5.0
maxDistance = 40.0
name = VOICE\ENGLISH\Eng_m_b_010.wav
name = VOICE\ENGLISH\Eng_m_b_008.wav

[beggars_fra]
minDistance = 5.0
maxDistance = 40.0
name = VOICE\ENGLISH\Fre_m_b_010.wav
name = VOICE\ENGLISH\Fre_m_b_009.wav
name = VOICE\ENGLISH\Fre_m_b_012.wav

[beggars_spa]
minDistance = 5.0
maxDistance = 40.0
name = VOICE\ENGLISH\Spa_m_b_007.wav
name = VOICE\ENGLISH\Spa_m_b_009.wav
name = VOICE\ENGLISH\Spa_m_b_024.wav
name = VOICE\ENGLISH\Spa_m_b_030.wav
- if you're using a build 14 alpha version, you have to add this into PROGRAM\sound\ALIAS\sounds_english.c
Code:
makeref(tmpref, Sounds_Alias[n]);
tmpref.id = "beggar";
tmpref.minDistance = "5.0";
tmpref.maxDistance = "40.0";
tmpref.files.l1.name = "VOICE\ENGLISH\Beggar_01.wav";
n++;

makeref(tmpref, Sounds_Alias[n]);
tmpref.id = "beggar_spa";
tmpref.minDistance = "5.0";
tmpref.maxDistance = "40.0";
tmpref.files.l1.name = "VOICE\ENGLISH\Beggar_01.wav";
tmpref.files.l2.name = "VOICE\ENGLISH\Beggar_spa.wav";
n++;

makeref(tmpref, Sounds_Alias[n]);
tmpref.id = "beggars_eng";
tmpref.minDistance = "5.0";
tmpref.maxDistance = "40.0";
tmpref.files.l1.name = "VOICE\ENGLISH\Eng_m_b_010.wav";
tmpref.files.l2.name = "VOICE\ENGLISH\Eng_m_b_008.wav";
n++;

makeref(tmpref, Sounds_Alias[n]);
tmpref.id = "beggars_fra";
tmpref.minDistance = "5.0";
tmpref.maxDistance = "40.0";
tmpref.files.l1.name = "VOICE\ENGLISH\Fre_m_b_010.wav";
tmpref.files.l2.name = "VOICE\ENGLISH\Fre_m_b_009.wav";
tmpref.files.l3.name = "VOICE\ENGLISH\Fre_m_b_012.wav";
n++;

makeref(tmpref, Sounds_Alias[n]);
tmpref.id = "beggars_fra";
tmpref.minDistance = "5.0";
tmpref.maxDistance = "40.0";
tmpref.files.l1.name = "VOICE\ENGLISH\Spa_m_b_007.wav";
tmpref.files.l2.name = "VOICE\ENGLISH\Spa_m_b_009.wav";
tmpref.files.l3.name = "VOICE\ENGLISH\Spa_m_b_024.wav";
tmpref.files.l4.name = "VOICE\ENGLISH\Spa_m_b_030.wav";	
n++;

- As you know, ingame beggars are not the only ones who sit on the ground. Therefore I've made so that only characters with a 'beggar' attribute will beg. This is easy to check. Run a new game and go to Redmond, look at Henry the Beggar. Nothing happen.
- Now give to Henry a 'beggar' attribute, with this line in Console.c :
Code:
	Characters[GetCharacterIndex("Henry")].beggar = "Henry is now a beggar!";
and get closer to Henry. Surprise!
- If you want a spanish beggar, now use this line in Console.c
Code:
	Characters[GetCharacterIndex("Henry")].nation = SPAIN; [/quote]and listen carefully at Henry a few times. 
- to remove the 'beggar' attribute to Henry, you can use this line : [code]DeleteAttribute(characterFromID("Henry"), "beggar");
Now Henry won't beg anymore.

- If you want to test how two beggars will behave, make sure your main character is a male and get closer to him. Then run this on the console :
Code:
Characters[GetCharacterIndex("Henry")].beggar = "Henry is now a beggar!";
Characters[GetCharacterIndex("blaze")].beggar = "Nathanael is really poor";
LAi_SetPoorType(pchar);
and wait. You can try to change your nation in the Relation interface. When you're tired of this, run those lines on the console :
Code:
DeleteAttribute(Pchar, "beggar");

- you can test extra things, like the afraid animation, the falling corpse animation etc. Tell me if you run into problems or weird issues.


FOR MODPACK COMPILERS, PIETER AND PIRATE_KK :

- Do not try to merge this file with the old one, this one is entirely rewritten and wouldn't be compatible.
- I didn't keep the russian comments ; I don't know if that will bother somebody
- I've used those kind of formulas :
Code:
				BeginChangeCharacterActions(chr);
chr.actions.dead.d1 = "Ground_Afraid_Death";
chr.actions.dead.d2 = "Ground_Afraid_Death";
EndChangeCharacterActions(chr);
in stead of simple new ones like this
Code:
				LAi_SetGroundAfraidDead(chr);
that would require extra coding in PROGRAM\Loc_ai\LAi_utils.c and PROGRAM\Characters\character.c.
But if you think the other way is better, it's fine with me
 
Interesting. I'll check this out for sure. Does this also influence the models of the beggars? I am fed up seeing rich-looking people asking me for money.
Also: What is the best way of adding this mod to Alpha 8? Any additional things I need to know? <img src="style_emoticons/<#EMO_DIR#>/icon_confused.gif" style="vertical-align:middle" emoid=":?" border="0" alt="icon_confused.gif" />
 
No, sorry Pieter, I haven't made any changes to CCC & NK random enconters mod (but I agree that when some pirate ladies with really expensives clothes start asking for 10 gold coin it usually doesn't make it at all)
Lai_poor.c deals with people sitting on the ground, not the random enconters who are just walking around the street. But indeed we could consider doing some changes into CCC & NK code to add random beggars sitting on the ground. At first I wasn't thinking at that, I would have added two or three beggars in Isla Muelle in front of the church (not random). I'd enjoy if some texturer could do new beggars by the way... like using that stock game pirate with hook, pegleg and eyeband - you remove the hook and make him a poor wounded former gunner/sailor who find himself too close of a cannon that exploded for exemple.


Replacing the current Lai_poor.c with my new one in Build 14 alpha 8 shouldn't cause any problem. Just add something like that into PROGRAM\Characters\init\Redmond, in the 'Henry the beggar' section :
Code:
ch.beggar = "Henry will beg for money!";
That for having Henry always behaving like a true beggar.
 
Seems to me like this mod should be given some more use.
1) There is only one beggar in the game (Henry) and he is getting a rather important role in the PotC quests
2) I am fed up with inappropriate text for certain models in the random encounters

So I would propose to try and add random beggars to the game in a similar way as CCC's Enc_walkers and add the beggar dialog from that file to them and remove it from the regular Enc_walker file so that a character is either a beggar or not and ensure beggars get appropriate models and the other encounters don't get them. Then your new Lai file can also be used for those.
 
An interessting thread about charactermodels, ecomony, beggars. <a href="http://forum.piratesahoy.net//index.php?showtopic=4987" target="_blank">http://forum.piratesahoy.net//index.php?showtopic=4987</a> Could match this subject.
 
I tried it out in 14.8 WIP 1 CotBP

It worked fine. Nice one S.V.S. <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
I just tried it out as well and it's brilliant. VERY nice touch. But we REALLY need some more beggars then, because this is too good to use just for Henry. <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
I might do some experimenting with splitting the enc_walkers into regular walkers and sitting beggars next week. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
Pieter, just make sure those sitting beggars don't "walk" ..otherwise I would be seeing buddhas sliding around all over the damn ground. <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />
 
that doesn't happen, because a model doesn't WALk if it is sitting. POTC can have some weird bugs or things, but that won't happen. It just is called walkers, because they walk around and talk to people, but it isn't a file to make them move.
 
Enc_walker is just the name of the dialog file. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
Hehe okay. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
I just looked up the code for the enc_walkers. Looks really quite complicated. I think a proper rewrite is on order. But how? <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    case "vagabond":
        isSet = true;
        LAi_CharacterReincarnation(chr, false, true);
        LAi_group_MoveCharacter(chr, GetCurrentCitizenGroup()); //LAI_DEFAULT_GROUP, NK now place in correct group. 05-07-19

/*    // ccc sneakmod ->
        LAi_group_SetAlarm(LAI_DEFAULT_GROUP, LAI_GROUP_PLAYER, 0.0);    //ccc10.2
        LAi_group_SetAlarm(LAI_DEFAULT_GROUP, LAI_GROUP_MONSTERS, 0.0);    //ccc10.2
        LAi_group_SetAlarm(LAI_DEFAULT_GROUP, LAI_GROUP_GUARDS, 0.0);    //ccc10.2
        LAi_group_SetRelation(LAI_GROUP_PLAYER, LAI_DEFAULT_GROUP, LAI_GROUP_NEITRAL); // NK
        LAi_group_SetRelation(LAI_GROUP_GUARDS, LAI_DEFAULT_GROUP, LAI_GROUP_NEITRAL); // NK
*/    // ccc sneakmod
        // NK go back to citizen so we can add addressing only if no hostiles around. 05-07-17
        LAi_type_citizen_Init(chr);
        // --> Swindler 05-10-10: I think, as long vags have rich citizen models, they can also be equipped with good weapons
        gunProb = 0.0;        // Swindler

        // NK -->
        bool restore = CheckAttribute(location,"vag.rich");
        bool save = false;
        if (restore) {save = location.vag.rich == "-1"; }
        restore = restore && !save;
        if (save) {location.vag.rich = false;}
        bool brich = frnd() < VAG_MERCH_CHANCE;
        if(restore) brich = sti(location.vag.rich);
        if(brich)
        {
            if(save) location.vag.rich = true;
            // NK <--
            //cccOA1-> Vagabond changed to rich armed traveller
            gunProb *= 1.5; // Swindler 05-10-10: changed the logic of making vag to a rich armed traveller

            int vagamoney = Rand(1000);            //ccc
            int vagahp = vagamoney/4+ Rand(200);        //ccc
            chr.money = vagamoney;            //ccc
            LAi_SetHP(chr, vagahp, vagahp);        //ccc
            if(vagamoney > 250) chr.perks.list.CriticalHit = "1";    //ccc
            if(vagamoney > 550) chr.perks.list.Gunman = "1";    //ccc
            if(vagamoney > 750) chr.perks.list.SwordplayProfessional = "1";    //ccc
            if(CheckAttribute(mchr, "skill.Fencing"))        //ccc
            {
            chr.skill.Fencing = sti(mchr.skill.Fencing) + Rand(3);    //cccOA1<-        
            }
        } // NK
        chr.dialog.CurrentNode = "First time";
        //chr.dialog.filename = "Enc_Walker.c";
        // ->ccc10.2 vaga dialog according to location for the time being
        if(location.type == "house" && CheckAttribute(location,"lastentermonth"))
        {
            chr.dialog.filename = "Enc_Resident_dialog.c";
            if(CheckAttribute(location,"vag.meeting"))    //ccc10.2 "," was missing
            {
                if(sti(location.vag.meeting))
                {
                    if(CheckAttribute(location,"friendquest")) {chr.dialog.CurrentNode = "friendquest";} // apr05 friend status
                    else {chr.dialog.CurrentNode = "second time";}    // apr05 friend status
                }
            }
        }
        else
        {
            chr.dialog.filename = "Enc_Walker.c";
        }
        
        if(chr.sex == "woman")    //NK was LEnc_MonstersLoginObject.current.sex // cccOA1
        {
            chr.perks.list.CriticalHit = "1";            //cccOA1
            chr.perks.list.SwordplayProfessional = "1";    //cccOA1
            GiveItem2Character(chr, "jewelry"+ makeint(1 + rand(15)) );    // jun05 booty for stealing
        }<!--c2--></div><!--ec2-->
 
Ahoy Pieter. Sorry for the delay (these days I have a lot of work...)
In my opinion just looking at the dialog file won't be enough. If you want to add random beggars sitting on the floor you'll have to change some files in PROGRAM\LandEncounters. LandEnc_init.c or LEnc_monsters.c for exemple. You'll have to give them a 'beggar' attribute and use these formula LAi_SetPoorType(chr);
Looking at those files is really interesting and even if there are some things I'd like to test I hadn't got the time to mess with it... I will post in a few days or maybe next week-end about it.
 
errm, is there a link where i can download this (im new member so i don't know a lot <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" /> )
 
<a href="http://piratesahoy.net/potc/a%20simple%20virtual%20sailor/beggars.rar" target="_blank">http://piratesahoy.net/potc/a%20simple%20v...lor/beggars.rar</a>
 
<!--quoteo(post=240894:date=Feb 24 2008, 08:37 PM:name=a simple virtual sailor)--><div class='quotetop'>QUOTE (a simple virtual sailor @ Feb 24 2008, 08:37 PM) <a href="index.php?act=findpost&pid=240894"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->In my opinion just looking at the dialog file won't be enough. If you want to add random beggars sitting on the floor you'll have to change some files in PROGRAM\LandEncounters. LandEnc_init.c or LEnc_monsters.c for exemple. You'll have to give them a 'beggar' attribute and use these formula LAi_SetPoorType(chr);<!--QuoteEnd--></div><!--QuoteEEnd-->Of course just making a beggar dialog file won't be good enough; we need to add something to the Enc_Monsters.c as well. I tried to figure it out a couple of days ago, but no luck so far. Perhaps I'll try again today. In theory it shouldn't be too hard. Perhaps I can see what was done to add the navy officers to Antigua, Redmond and Falaise de Fleur and try to use that to add beggars. Of course the number of beggars should be limited; just one or two per town location at maximum. Also when we've got beggars, I think we should remove the begging dialog cases from the enc_walkers dialog file and add them to a beggar dialog file. Of course there also need to be a couple of surprises with the beggars, so I think even beggars should have some of the other dialog cases as well, such as the treasure quest case and the teaching case, etc. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
Back
Top