Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Ke said:
I’m new by modding and so, I’ve some Questions:
1. Is there a variable that halted leg, in which faction the player is?
2. Is there a variable that halted leg, in which faction locations (villages) are?
3. How can you create a bigger map (larger than the real deep map)?
4. How can you create a new “Type” like male and female? (a link is quite enough)

Please understand, that I don't speak English very well, because it is not my native language.
1. "$players_kingdom"
2. Towns and villages are parties. Use (store_faction_of_party, ":faction", ":party"),
3. You want world map? Use Map Editor and make yourself a bigger map. Then in module.ini file set map_min/max_x/y values.
4. http://forums.taleworlds.com/index.php/topic,42860.0.html
 
I need to make a presentation for some kind of a chest, where you use the scene prop and then a menu opens where you see some items in a list and when you klick on an item, the stats are shown and you can klick a button to spawn the chosen weapon. So i have two questions: Would something like this be possible in MP and is there any good tutorial for presentations? I never worked with them before, so...
 
Azrooh said:
Is there an operation or a script to set whether or not there is a quarrel ready to fire in the crossbow?
(E: or to check if there is one?)
No

oliver255 said:
Is it possible to convert Warband script to the original Mount and Blade.
Yes, but certain operations only work in Warband. So, you would need to rewrite them to achieve the same effect. Depending on the script, it may be very difficult or impossible to duplicate it in the original Mount & Blade.
 
Toasticuss said:
Anyone know how to change the way items get locked to co-op waves? If they can't be changed is it possible to remove it?
Code:
					(call_script, "script_multiplayer_get_item_value_for_troop", ":item_no", ":player_troop_no"),
					(assign, ":item_price", reg0),
					(try_begin),
						(lt, "$g_multiplayer_ccoop_wave_no", 3),
						(assign, ":max_value", 301),
					(else_try),
						(lt, "$g_multiplayer_ccoop_wave_no", 5),
						(assign, ":max_value", 551),
					(else_try),
						(lt, "$g_multiplayer_ccoop_wave_no", 8),
						(assign, ":max_value", 701),					
					(else_try),
						(lt, "$g_multiplayer_ccoop_wave_no", 11),
						(assign, ":max_value", 1101),					
					(else_try),
						(assign, ":max_value", 999999),			
					(try_end),
 
How do I open the character window from the script?

Operation change_screen_view_character does not work for me for no obvious reason. Neither from presentation, nor from menu, nor from simple trigger.

In Native this operation is only called from module_dialogs, and always for some other character. Is there no way to call it on player apart from building a bogus dialog where player would be talking to himself?
 
Greetings to all,

i'm working on my own mod for a while now and there are some points, where i need help:

1. There are two AI-Lords fighting each other and the player engages to help one of them. Until now, nearby enemy and friendly Lords do not join the fight. I'd like to change that. Therefor i tried to change 'let_nearby_parties_join_current_battle' but without any success so far. Does anyone have an idea?

2. I created a new, larger map, wich contains quite large oceans. The distance between the kingdoms is know greater than in native an the AI does not seem to be willing to do a campaign over such distances. They gather forces and start marching but abort the campaign in the middle of it. Can someone provide a hint wich lines I would have to change for that?

3. And still another thing at the edge, which does not have to do nothing with the AI: Until now blunt weapons always knock out an enemy instead of killing him. I'd like to add a certain chance for death instead of 100% knock-outs. Where can I adjust that?

Many Thanks in advance!
 
[list type=decimal]
[*]Add (call_script, "script_let_nearby_parties_join_current_battle", 0, 0), in the pre_join menu.
[*]Distance checks should be in npc_decision_checklist_party_ai and scripts which call it. It's a bit of a mess, so you should probably shrink your map mesh to Native size or something.
[*]Either make a ti_on_agent_killed_or_wounded or ti_on_agent_hit trigger to modify the killing blow, or adjust script_count_mission_casualties_from_agents to modify the casualties afterward.
[/list]
 
Somebody said:
Toasticuss said:
Anyone know how to change the way items get locked to co-op waves? If they can't be changed is it possible to remove it?
Code:
					(call_script, "script_multiplayer_get_item_value_for_troop", ":item_no", ":player_troop_no"),
					(assign, ":item_price", reg0),
					(try_begin),
						(lt, "$g_multiplayer_ccoop_wave_no", 3),
						(assign, ":max_value", 301),
					(else_try),
						(lt, "$g_multiplayer_ccoop_wave_no", 5),
						(assign, ":max_value", 551),
					(else_try),
						(lt, "$g_multiplayer_ccoop_wave_no", 8),
						(assign, ":max_value", 701),					
					(else_try),
						(lt, "$g_multiplayer_ccoop_wave_no", 11),
						(assign, ":max_value", 1101),					
					(else_try),
						(assign, ":max_value", 999999),			
					(try_end),

Wow, awesome, thank you, I assumed it was somewhere in Scripts but here it is in presentations...


Edit: Small problem, after commenting out the code that put the wave requirements on, I'm able to select the item freely but it kept the Wave number on the item, is there a place it puts that on?

This is what I have commented out

Code:
					# (call_script, "script_multiplayer_get_item_value_for_troop", ":item_no", ":player_troop_no"),
					# (assign, ":item_price", reg0),
					# (try_begin),
						# (lt, "$g_multiplayer_ccoop_wave_no", 3),
						# (assign, ":max_value", 1), #Kengeki
					# (else_try),
						# (lt, "$g_multiplayer_ccoop_wave_no", 5),
						# (assign, ":max_value", 1), #Kengeki
					# (else_try),
						# (lt, "$g_multiplayer_ccoop_wave_no", 8),
						# (assign, ":max_value", 1), #Kengeki					
					# (else_try),
						# (lt, "$g_multiplayer_ccoop_wave_no", 11),
						# (assign, ":max_value", 1), #Kengeki					
					# (else_try),
						# (assign, ":max_value", 999999),			
					# (try_end),
				  
					  # (le, ":item_price", ":max_value"),
					  # (store_add, ":player_slot_index", slot_player_selected_item_indices_begin, "$g_presentation_state"),
					  # (val_sub, ":player_slot_index", 1),
					  # (player_set_slot, ":my_player_no", ":player_slot_index", ":item_no"),
					  # (call_script, "script_multiplayer_update_cost_labels"),
					  # (assign, ":end_cond", 0), #break
				  # (try_end),

I also tried switching all the values around, above all the prices are set to 1 but that didnt help, I also tried switching the wave numbers to 0 but that didn't do anything either.... I'm at another loss =(

I just want to remove the Wave number image above the item....
 
Code:
	   (try_begin),
		(eq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop),
		(call_script, "script_multiplayer_get_item_value_for_troop", ":item_no", ":troop_no"),
		(assign, ":item_price", reg0),
		(try_begin),
			(is_between, ":item_price", 0, 301),
			(assign, ":border_wave", 0),
		(else_try),
			(is_between, ":item_price", 301, 551),
			(assign, ":border_wave", 3),
		(else_try),
			(is_between, ":item_price", 351, 701),
			(assign, ":border_wave", 5),
		(else_try),
			(is_between, ":item_price", 701, 1101),
			(assign, ":border_wave", 8),
		(else_try),
			(gt, ":item_price", 1001),
			(assign, ":border_wave", 11),
		(try_end),
		(lt, "$g_multiplayer_ccoop_wave_no", ":border_wave"),
		(gt, ":border_wave", 1),
 
Somebody said:
Code:
	   (try_begin),
		(eq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop),
		(call_script, "script_multiplayer_get_item_value_for_troop", ":item_no", ":troop_no"),
		(assign, ":item_price", reg0),
		(try_begin),
			(is_between, ":item_price", 0, 301),
			(assign, ":border_wave", 0),
		(else_try),
			(is_between, ":item_price", 301, 551),
			(assign, ":border_wave", 3),
		(else_try),
			(is_between, ":item_price", 351, 701),
			(assign, ":border_wave", 5),
		(else_try),
			(is_between, ":item_price", 701, 1101),
			(assign, ":border_wave", 8),
		(else_try),
			(gt, ":item_price", 1001),
			(assign, ":border_wave", 11),
		(try_end),
		(lt, "$g_multiplayer_ccoop_wave_no", ":border_wave"),
		(gt, ":border_wave", 1),


Edit: What code should that all replace?


This is my code now

Code:
			  (try_begin),
				(eq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop),
				  (try_begin),
					  #check if item is free for troop
					  (player_get_troop_id, ":player_troop_no", ":my_player_no"),
					  (call_script, "script_cf_multiplayer_is_item_default_for_troop", ":item_no", ":player_troop_no"),
					  
					  (store_add, ":player_slot_index", slot_player_selected_item_indices_begin, "$g_presentation_state"),
					  (val_sub, ":player_slot_index", 1),
					  (player_set_slot, ":my_player_no", ":player_slot_index", ":item_no"),
					  (call_script, "script_multiplayer_update_cost_labels"),
					  (assign, ":end_cond", 0), #break
				  (else_try),
					  # can player buy item
								
				   (try_begin),
					(eq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop),
					(call_script, "script_multiplayer_get_item_value_for_troop", ":item_no", ":troop_no"),
					(assign, ":item_price", reg0),
					(try_begin),
						(is_between, ":item_price", 0, 301),
						(assign, ":border_wave", 0),
					(else_try),
						(is_between, ":item_price", 301, 551),
						(assign, ":border_wave", 3),
					(else_try),
						(is_between, ":item_price", 351, 701),
						(assign, ":border_wave", 5),
					(else_try),
						(is_between, ":item_price", 701, 1101),
						(assign, ":border_wave", 8),
					(else_try),
						(gt, ":item_price", 1001),
						(assign, ":border_wave", 11),
					(try_end),
					(lt, "$g_multiplayer_ccoop_wave_no", ":border_wave"),
					(gt, ":border_wave", 1),		
					(try_end),
				  
					  (le, ":item_price", ":max_value"),
					  (store_add, ":player_slot_index", slot_player_selected_item_indices_begin, "$g_presentation_state"),
					  (val_sub, ":player_slot_index", 1),
					  (player_set_slot, ":my_player_no", ":player_slot_index", ":item_no"),
					  (call_script, "script_multiplayer_update_cost_labels"),
					  (assign, ":end_cond", 0), #break

Gives lots of errors when selecting the items
 
Ikaguia said:
you can use the auto_proceed option in module_dialogs
Lav said:
That's what I'm currently doing. Liddell Hart would be so proud of me. :smile:
Unfortunately, I can't get what I want with this approach. This is my dialogue code currently (it is in the very beginning of the module_dialogs and I use "$g_lco_operation" variable as the semaphor):

Code:
  [anyone, "start", [(eq,"$g_lco_operation",lco_view_character),(assign,"$g_lco_operation",lco_inside_dialog)],"Here you are.","lco_conversation_end",[(change_screen_view_character)]],
  [anyone, "lco_conversation_end", [(eq,"$g_lco_operation",lco_inside_dialog),(assign,"$g_lco_operation",0),(change_screen_return)], "Aren't you imressed with your uber-stats?", "close_window", [(assign,"$g_lco_operation",0),(change_screen_return)]],
First line works fine - as soon as the game switches to dialog mode, character screen appears. Sometimes you can catch a glimpse of the text, but that's acceptable.

However I cannot get rid of the second line no matter what I do. Setting it to auto_proceed simply breaks the dialog, it seems one cannot auto-proceed to "close_window". I tried inserting (change_screen_return) into preconditional block, but without any success. So no matter what I do, it looks like follows:

1. My code generates the event, prepares the dialog scene and runs it.
2. Dialog scene loads, user is immediately presented with character screen.
3. When he closes character screen, a normal dialog window is displayed, where the user can see his character talking to him and must click mouse to finally close the dialog and exit.

I tried making second dialog entry auto_proceed to yet another one, which would in turn close the dialog, but again without success. User will not see the second dialog, but he will still see the third.

Is there really no way to exit the dialog without saying at least something?
 
Now I've got a problem with the modul systhem:

This is my new code:
(the first part is only a menü option from the village menü)
Code:
("recruit_zombies",
      [
       ]
       ,"Sprecht mit dem Nekromanten dieses Dorfes",
       [
         (jump_to_menu, "mnu_recruite_zombies"),
        ]),
and:
Code:
  (
  "recruite_zombies"
  "Ihnen werden zwanzig Zombies beschworen",
    "none",
    [
      ("beschwoeren_lassen",
	  [
	  ],
	  "beschwoeren lassen",
       [
         (party_add_members, "p_main_party", "trp_zombie", 20),
		 (jump_to_menu,"mnu_village"),
        ]),

     
      ("continue_not_enough_gold",
      [
      ],
      "I don't have enough money...",
      [
        (jump_to_menu,"mnu_village"),
      ]),
	 ]
   ),
Here is the error:
u1impfg4vlbn.jpg

s1jdlo54wobx.jpg

P.S. Could somebody tell me, what is this of a kind of error

Please understand, that I don't speak english very well, because it is not my native language.
 
Incorrect syntax in the second quote. You missed a comma and menu flags after "recruite_zombies".

Fixed code:
Code:
  ("recruite_zombies", 0, "Ihnen werden zwanzig Zombies beschworen", "none",
    [
      ("beschwoeren_lassen", [], "beschwoeren lassen",
        [
          (party_add_members, "p_main_party", "trp_zombie", 20),
          (jump_to_menu,"mnu_village"),
        ]
      ),
      ("continue_not_enough_gold", [], "I don't have enough money...",
        [
          (jump_to_menu,"mnu_village"),
        ]
      ),
    ]
  ),
 
Status
Not open for further replies.
Back
Top Bottom