Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
That's the problem, the horse works as one unit in the module, it's part from the MoreHorses OSP pack by wanderer. It also show fine in the brf, but when combined with the chariots(and it's on different sub-meshes), it does that.  :???:

I'm at a loss.

EDIT: Ok, did some tests and here are some more details:

When in the 'native' place, the horse animations are fine. When moved forward in the z dimension, so that the chariot can be in the place of the horse and the horse moves forward, then its animations become messed up. Any help with this extra information? I would really appreciate it.
 
Question: Can someone explain why the code below does not work?

I added the code below to the end of the 'Team Deathmatch' section in modules_mission_templates.py. I hoped this code would spawn in two peasant women on the side of team 2 who are friendly to players on team 1.

The build_module.bat runs fine, the women spawn in fine, but the women still attack you when you are on team 1.
Code:
      (1, 0, ti_once, [],
	   [
		  (multiplayer_is_server),
		  (store_current_scene, ":cur_scene"),
	          (modify_visitors_at_site, ":cur_scene"),
		  (add_visitors_to_current_scene, 36, "trp_peasant_woman", 1, 1, 0),
		  (add_visitors_to_current_scene, 37, "trp_peasant_woman", 1, 1, 0),
		  ]),	
      (ti_server_player_joined, 0, 0, [],
	   [
		  (multiplayer_is_server),
		  (store_current_scene, ":cur_scene"),
	          (modify_visitors_at_site, ":cur_scene"),
		  (try_for_agents, ":cur_agent"),
		    (agent_get_troop_id, ":troop_id", ":cur_agent"),
		    (eq, ":troop_id", "trp_peasant_woman"),
		    (get_player_agent_no, ":players_agent_no"),
		    (agent_add_relation_with_agent, ":players_agent_no", ":cur_agent", 1),
		  (try_end),
		  ]),

Thank you for your time.

 
Lex Hugs Pandas said:
      (1, 0, ti_once, [],
      [
        (multiplayer_is_server),
        (store_current_scene, ":cur_scene"),
            (modify_visitors_at_site, ":cur_scene"),
        (add_visitors_to_current_scene, 36, "trp_peasant_woman", 1, 1, 0),
        (add_visitors_to_current_scene, 37, "trp_peasant_woman", 1, 1, 0),
        ]), 
      (ti_server_player_joined, 0, 0, [],
      [
        (multiplayer_is_server),
        (store_current_scene, ":cur_scene"),
            (modify_visitors_at_site, ":cur_scene"),
        (try_for_agents, ":cur_agent"),
          (agent_get_troop_id, ":troop_id", ":cur_agent"),
          (eq, ":troop_id", "trp_peasant_woman"),
          (get_player_agent_no, ":players_agent_no"),
          (agent_add_relation_with_agent, ":players_agent_no", ":cur_agent", 1),
        (try_end),
        ]),       

[quote author=Lav's header_operation expanded]
get_player_agent_no                      = 1700  # (get_player_agent_no, <destination>),
                                                # Retrieves the reference to the player-controlled agent. Apparently only makes sense in singleplayer mode.
player_get_agent_id                          =  406  # (player_get_agent_id, <destination>, <player_id>),
[/quote]

So, I think replacing the operations(and getting the player_id to insert it, of course) should fix it.
 
@Lex Hugs Pandas  are you sure that you are on team 1? (team 0 is the First team, team 1 is the Second team)

Some little notes:
1. in the second trigger (ti_server_player_joined), the 'store_current_scene' and 'modify_visitors_at_site' are useless.
2. (get_player_agent_no, ":players_agent_no"), is a SP operation (or maybe it is MP too, but it is client side), so it will not work in multiplayer server side. Instead use (store_trigger_param_1, ":players_agent_no"), at the beginning of the trigger.
3. when the player joins the server, he does not have an agent, so your second trigger is useless too (maybe you want ti_on_agent_spawn? check header_triggers for available special triggers).
 
@The_dragon
@Namakan

Wow thank you guys for your quick responses. Your advice worked! Everything works exactly as I hoped now the bots won't attack me. If you're wondering what code I used to get this to work here it is:
Code:
      (1, 0, ti_once, [],
	   [
		  (multiplayer_is_server),
		  (store_current_scene, ":cur_scene"),
	          (modify_visitors_at_site, ":cur_scene"),
		  (add_visitors_to_current_scene, 36, "trp_peasant_woman", 1, 1, 0),
		  (add_visitors_to_current_scene, 37, "trp_peasant_woman", 1, 1, 0),
		  ]),	
      (ti_on_agent_spawn, 0, 0, [],
	   [
		  (multiplayer_is_server),
		  (try_for_agents, ":cur_agent1"),
		    (try_begin),
	          (agent_is_non_player, ":cur_agent1"),
		      (assign, "$g_agent_is_a_player", 0),
			(else_try),
			  (neg|agent_is_non_player, ":cur_agent1"),
			  (assign, "$g_agent_is_a_player", 1),
			  (assign, "$g_cur_player_agent_id", ":cur_agent1"),
			(try_end),
			(eq, "$g_agent_is_a_player", 1),
		    (try_for_agents, ":cur_agent2"),
			  (agent_get_troop_id, ":troop_id", ":cur_agent2"),
			  (eq, ":troop_id", "trp_peasant_woman"),
			  (agent_add_relation_with_agent, ":cur_agent2", "$g_cur_player_agent_id", 1),
		    (try_end),
		  (try_end),
		  ]),,
 
Hi.
Im really bad at modding, dont really get the codes or anything.
I just look up stuff and put it in my mod.
However, there is one thing that i cannot find...

How to make the looting screen appear after siege battles? Like when you defend and win in a siege battle, i would very much like to be able to do some looting afterwards, even though the siege is still ongoing.
And it annoys the heck out of me that you dont get to loot stuff.
and also unsure, but dont think you get any "party" money or experience for it either.

Anyhow, anyone knows how to make the looting screen appear after defending in siege battles ? :smile:
 
Drugs, this is what I was told when I asked that before:
JuJu70 said:
In mission templates you need to compare village_attack_bandits and village_raid to lead_charge and make changes, also need to edit in game_menu attack_bandits and village_raid (or whatever it's called).

Sadly I wasn't able to figure it out.
 
Hi, I've added 3 villages and 1 town (as 1 faction) into my game but the town seems to take in another 2 villages (Fisdnar & Uslum) and add them into the faction (I don't want this to happen). Is there a way to remove them from the town's influence? Also, when I enter my custom villages, there are no buildings at all. It is just a flat piece of land with villagers spawning in and walking around (I followed Porshy's Village tutorial except the last step, which they say is not needed). How do I add in buildings to my villages? Thanks in advance.

Edit:My town has buildings in it but they are extremely random and weird.(Buildings floating in the air and sinking in the ground. No proper pathways, just buildings randomly placed and blocking each other.
 
KILL IT WITH FIRE!!!

8d9f2030a5.jpg


Though more seriously, does anyone know how to properly animate it? I just took my ostrich .obj and put a horse animation on it, though it seems to have rather disastrous results. Is there a better way to custom animate a horse alternative?
 
Hi, I have not found an answer so far. Is there an easy way to extend some diplomatic events like truces ect.?
I have Floris installed and just want to change some things... Thank you for your help.
 
litdum said:
I am looking for this Options menu's texture(dds) file but I can't find it in textures folder. Is there anyone who know which one this is?

ui_options.dds
 
Ok, I've started to get into the reruit town/castle tut in the forums, and managed to implement in my game painstaking enough......(tutorial was filled with so many deliberate errors). Managed to recruit Volunteers and Nobles in towns and castles respectively, and I'm proud of smoothing the process.

Then........ I go into the tavern, instead of the usual "door to the centre", it says "."

Happens in all doors from interior scenes, and there aren't any issues with the code, but I foresee problematic circumstances when you're in a quest in an interior

So, from a full day of mindbreaking problem solving I've managed to come up with a proper code that allows me to recruit nobles and volunteers, with explanations on how these codes work

Code:
---This tutorial allows you to implement a code that lets you recruit troops from both 
castles and towns, however you can recruit nobles from castles, and regulars from towns.

first off is module scripts.py-------

-----My take is that this is to set the condition whether or not the player can recruit in this 
town/castle. An example might be if negative relation(even if not in war), player
cannot recruit.-----

################################################################################################################

---------IMPORTANT CODE to start it immediately rather than wait for 3 days--------
(try_for_range, ":village_no", villages_begin, villages_end),
        (call_script, "script_update_volunteer_troops_in_village", ":village_no"),
(try_end),

----Find this inside module_scripts "game_start" and change the range tocenters_begin, centers_end.----

################################################################################################################



#script_cf_town_recruit_volunteers_cond
  # INPUT: none
  # OUTPUT: none
  ("cf_town_recruit_volunteers_cond",  #renamed
    [(store_faction_of_party, ":town_faction", "$current_town"),
     (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
     (store_relation, ":town_faction_relation", ":town_faction", "fac_player_faction"),
     (ge, ":center_relation", 0),
     (this_or_next|ge, ":center_relation", 5),
     (this_or_next|eq, ":town_faction", "$players_kingdom"),
     (this_or_next|ge, ":town_faction_relation", 0),
     (this_or_next|eq, ":town_faction", "$supported_pretender_old_faction"),
     (             eq, "$players_kingdom", 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (ge, ":free_capacity", 1),
     ]),
	 
################################################################################################################
	 
	 
	 -----below this----
	 
	   #script_cf_village_recruit_volunteers_cond
  # INPUT: none
  # OUTPUT: none
  ("cf_village_recruit_volunteers_cond",
    [
   
    (try_begin),
      (eq, "$cheat_mode", 1),
      (display_message, "str_checking_volunteer_availability_script"),
    (try_end),
   
    (neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
     (neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
     (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
     (store_faction_of_party, ":village_faction", "$current_town"),
     (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
     (store_relation, ":village_faction_relation", ":village_faction", "fac_player_faction"),
   
     (ge, ":center_relation", 0),
    (try_begin),
      (eq, "$cheat_mode", 1),
      (display_message, "str_center_relation_at_least_zero"),
    (try_end),
   
   
   
   
     (this_or_next|ge, ":center_relation", 5),
     (this_or_next|eq, ":village_faction", "$players_kingdom"),
     (this_or_next|ge, ":village_faction_relation", 0),
     (this_or_next|eq, ":village_faction", "$supported_pretender_old_faction"),
      (eq, "$players_kingdom", 0),

    (try_begin),
      (eq, "$cheat_mode", 1),
      (display_message, "str_relationfaction_conditions_met"),
    (try_end),

      
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
   
    (try_begin),
      (eq, "$cheat_mode", 1),
      (display_message, "str_troops_available"),
    (try_end),
   
   
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (ge, ":free_capacity", 1),
   
    (try_begin),
      (eq, "$cheat_mode", 1),
      (display_message, "str_party_has_capacity"),
    (try_end),
   
   
     ]),
	 
	 ################################################################################################################

	 --- scripts 2;
place this code ---

You need to place each code for both nobles and volunteers

     (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_1_troop),  This indicate the tier of troop being hired.
	 It's in the scripts so you can edit the troops to be recruited in there


    #script_castle_recruit_nobles_recruit
  # INPUT: none
  # OUTPUT: none
  ("castle_recruit_nobles_recruit", #link from menu
    [(store_faction_of_party, ":cur_faction", "$current_town"),
     (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_1_troop),  #changed tier so it wouldnt recruit nobles.
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (val_min, ":volunteer_amount", ":free_capacity"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", 200),#200 denars per man
     (val_min, ":volunteer_amount", ":gold_capacity"),
     (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
     (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
     (store_mul, ":cost", ":volunteer_amount", 200),#200 denars per man
     (troop_remove_gold, "trp_player", ":cost"),
     ]),
	 
	 ################################################################################################################

	 
	 ---below this---
	 
	 #script_village_recruit_volunteers_recruit
  # INPUT: none
  # OUTPUT: none
  ("village_recruit_volunteers_recruit",
    [(store_faction_of_party, ":cur_faction", "$current_town"),
     (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_2_troop),
     (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (val_min, ":volunteer_amount", ":free_capacity"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
     (val_min, ":volunteer_amount", ":gold_capacity"),
     (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
     (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
     (store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
     (troop_remove_gold, "trp_player", ":cost"),
     ]),
	 
	 
	 ################################################################################################################

	 
-----Now for module game menus, we are going to change it so each tree is specifically 
recruited from castle or town.-----

------This is the dialog to recruit troops in town/castle------

################################################################################################################


("recruit_nobles",[(is_between, "$current_town",
        castles_begin, castles_end),      (call_script,                                           
       "script_cf_town_recruit_volunteers_cond"),]
       ,"Recruit Nobles.",
       [
         (try_begin),
           (call_script, "script_cf_enter_center_location_bandit_check"),
         (else_try),
           (jump_to_menu, "mnu_recruit_nobles"),
         (try_end),
        ]),
		
		
		
		
		("recruit_normals",[(is_between, "$current_town",
        towns_begin, towns_end),      (call_script,
       "script_cf_town_recruit_volunteers_cond"),]
       ,"Recruit Volunteers.",
       [
         (try_begin),
           (call_script, "script_cf_enter_center_location_bandit_check"),
         (else_try),
           (jump_to_menu, "mnu_recruit_normales"),
         (try_end),
        ]),
		
		
		----Place this below door to the castle from castle_castle-----
		
		
		
		----Put at the the last game menu, before the last ] Remember that this code is only
		for normales. To include nobles too you'll need to add the same code that recruits
		nobles----
		
		
		----This is the code for the dialog during recruitment, and conditions whether the player
		can recruit or not.-----
		
		       ---- (call_script, "script_town_recruit_nobles_recruit"),Link to script----
		
		################################################################################################################

		
		(
		   "recruit_normales",0,
    "{s18}",
    "none",
    [(store_faction_of_party, ":cur_faction", "$current_town"),
     (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_3_troop), 
     (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", 40),#40 denars per man
     (assign, ":party_capacity", ":free_capacity"),
     (val_min, ":party_capacity", ":gold_capacity"),
     (try_begin),
       (gt, ":party_capacity", 0),
       (val_min, ":volunteer_amount", ":party_capacity"),
     (try_end),
     (assign, reg5, ":volunteer_amount"),
     (assign, reg7, 0),
     (try_begin),
       (gt, ":volunteer_amount", ":gold_capacity"),
       (assign, reg7, 1), #not enough money
     (try_end),
     (try_begin),
       (eq, ":volunteer_amount", 0),
       (str_store_string, s18, "@No one here seems to be willing to join your party."),
     (else_try),
       (store_mul, reg6, ":volunteer_amount", 40),#40 denars per man
       (str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
       (try_begin),
         (eq, reg5, 1),
         (str_store_string, s18, "@One {s3} volunteers to follow you."),
       (else_try),
         (str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
       (try_end),
       (set_background_mesh, "mesh_pic_recruits"),
     (try_end),
    ],
    [
      ("continue_not_enough_gold",
      [
        (eq, reg7, 1),
      ],
      "I don't have enough money...",
      [
  (jump_to_menu, "mnu_town"),
      ]),
       
      ("continue",
      [
        (eq, reg7, 0),
        (eq, reg5, 0),
      ], #noone willing to join                   
      "Continue...",
      [
        (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
  (jump_to_menu, "mnu_town"),
      ]),
       
      ("recruit_them",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Recruit them ({reg6} denars).",
      [
        (call_script, "script_castle_recruit_nobles_recruit"),
                       
  (jump_to_menu, "mnu_town"),
      ]),
     
      ("forget_it",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Forget it.",
      [
  (jump_to_menu, "mnu_town"),
      ]),
    ],
  ),
		
		################################################################################################################

Is there something that the code has altered on the module that causes this problem?
 
Status
Not open for further replies.
Back
Top Bottom