Need help with New Building types (on the map)

Users who are viewing this thread

princejohn

Veteran
I'm trying to add Churches and ports which pretty much act like Towns but with diffrent menu options.

Here is what have.  (already added the new map Icon) It complies but when I enter the church a Regular village menu pops up.

Module_Parties
("Church","Hobs Church",  icon_church_a|pf_town, "Church", pt_none, fac_neutral,0,ai_bhvr_hold,0,(-167.7, 67.4),[], 40),

"Church",  replaced no_menu with this.


Module_scripts
(else_try),
          (eq, "$g_encountered_party", "p_church"),
          (jump_to_menu, "mnu_church"),
(else_try),

Module_game_menus
(
    "Church",mnf_auto_enter,
    "You enter the Church.",
    "none",
    [(reset_price_rates,0),(set_price_rate_for_item,"itm_salt",55)],
    [
      ("enter",[],"Enter.",[[set_jump_mission,"mt_town_center"],[jump_to_scene,"scn_village_127"],[change_screen_mission]]),
      ("leave",[],"Leave.",[[leave_encounter],[change_screen_return]]),
    ]
  ),

Module_Constants
spt_church              = 22
 
Whenever referencing another thing in the module system, you need to use the proper prefix for the file that "thing" is in before the thing's name.

For instance, if you want to reference a menu, you must use mnu_menuname.
Rather than "Church" in the menu ID spot for the party definition, you should replace it with "mnu_Church".

Also, there is no need to declare a spt_church if you don't set your party's slot_party_type in game_start or use it for the party encounter script.
 
I did that but it just gave me errors compiling it.  However I did get it to work (kind of) by rearranging its order in the Module_parties I had it below Villages so I placed it above the towns (not sure why that matters) and now it gives me a menu that you enter the church....... only prob is now its owned by no one (includes common faction as its labled in parties).  If I ever get this figured out I'll make a Tutorial on it to help out others.
 
Rearranging where it falls in module_parties will determine what spt_ it is given within the game_start script. You may have changed it from being assigned spt_village to not receiving any party type assignment.

If you are messing around with the order of things, I would think that changing where your else_try is in the encounter script would also be important. If it falls below whichever party type your Church is assigned to, the else try for the church would never be reached as it would jump to the appropriate party type's menu.

...so far as the compile error, I guess I'm befuddled by why it would compile correctly without the proper prefix and have a problem with the prefix. In any case, setting the menu like that is likely less important--as that feature isn't used Natively--than getting the encounter script/party type business straightened out.
 
I added it to the very end of Parties and so far its working, I gave it to my new faction in scripts.  Now I just need to figure out the walkers, shops etc.  When you mentioned mnu_  I thought for sure I needed to add that in Game menus but it gave me an error as for parties I know pre-warband you didn't need to add mnu_ to parties (or at least from what I read).

Using the icon from beer war and Teutonic knight mod till I have time to learn how to make them.
map2m.jpg

mapbm.jpg


Edit: sorry for another but I took out pf_is_static since I want the AI to attack it.
 
Alright after some rigging I got the menu working and some troops.  Now I need to figure out how to make it so the AI and Player can conquer/raid it, any ideas?

Village background art was a test, temporary tell I make one with a church
chmen2.jpg

chmen.jpg
 
Put it between the last castle and the first village, so that it's considered to be in the range of walled_center. Then you'll have to manually set spt_church. However, this may affect the ai siege calculations, which check if it's spt_town or spt_castle.
 
Back
Top Bottom