Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Azrooh said:
Lav said:
I got somewhat interested in multiplayer aspects of the MS recently, so I have a theoretical question.

Suppose a player in a single-player campaign starts a battle, however this battle is started with start_multiplayer_mission operation. Other players running this module go into Multiplayer menu, find this game and join as first player's companions (with their skills and equipment) for that battle. All this is managed by the main game server using send_message_to_url operation to track who helped whom and how many times (you can call for help only a limited number of times and then you must earn your "credits" back by helping others).

Now the question: is this all possible? Will multiplayer operations function properly in single-player mode? Has anyone done any testing on this? It's all purely theoretical at the moment (and will probably remain so), but it would be interesting to know the answers.

All this except for the stat tracking is implemented in the Battle Time! mod. Also in Brytenwalda, but that's Battle Time! as well, just merged with Brytenwalda.

Wait, so there's a mod that actually merges the single player campaign map with multiplayer? Or am I misunderstanding you?

Also, MadocComadrin, did you manage to find a good friction number or balance of weapon speed with the variables in the module.ini which would allow you decent damage at long range, but rather intense damage at short range? I'm interested in implementing it with the mod I'm working on, Twilight of the Sun King, but also would like to let other modder's know about it in case they want to recreate the effective "kill range" of Longbows for English/Welsh Longbowmen.

Thanks!

CR
 
Azrooh said:
All this except for the stat tracking is implemented in the Battle Time! mod. Also in Brytenwalda, but that's Battle Time! as well, just merged with Brytenwalda.
Excellent! Thanks a lot for the reference!

P. S. Though after reading their thread carefully, that's not what I meant. They host the game remotely, though apparently user's computer connects to it more or less seamlessly. Anyway, this needs further research.

celestialred said:
Wait, so there's a mod that actually merges the single player campaign map with multiplayer? Or am I misunderstanding you?
Apparently they host the battle on some remote dedicated server. So this is not what I wanted, even though quite close.
 
Somebody can tell me if there are a thrigger which checks if a player do the 'attack' action?

Just like on_agent_hit, but without hurt nothing. I mean, always somebody swing a sword.


Thanks.
 
CTCCoco said:
Somebody can tell me if there are a thrigger which checks if a player do the 'attack' action?

Just like on_agent_hit, but without hurt nothing. I mean, always somebody swing a sword.


Thanks.
(agent_get_attack_action, <destination>, <agent_id>), #returned values: free = 0, readying_attack = 1, releasing_attack = 2, completing_attack_after_hit = 3, attack_parried = 4, reloading = 5, after_release = 6, cancelling_attack = 7

Code:
attack_check = (0,0,0, 
  [(get_player_agent_no, ":player_agent"),  #SP version, you should use another agent check for MP, I don't know. Never mod MP
   (agent_get_attack_action, ":attack_action", ":player_agent"),
   (gt, ":attack_action, 0),
   #your code here
   ],
  []),
 
here's a thought....
instead of allocating weapons and other gear in module troops, how about doing it via game menus or triggers?

what f'ing use is that?

well, picture this:  Game-start screen 1 - what year is your character born: choose 750 // 1150 // 1350
depending on your choice, the only thing that changes is the troop-items load.  But that changes the game hugely -
750 load-out is leather, 1-hander, roundshield:
1150 load-out is mail, 1-hander, kiteshield, helmet, horse: 
1350 load-out is plate, two-hander, helmet, horse.

instantly one mod becomes 3.  You can of course expand it to any amount of timeframes, but all would be tied to the same map, character-names, locations and architecture. 
Although, architecture could be changed with scene prop replace....

Anyway...

the other possibility is to have a trigger replace troop items with troop-better-items.  Example:  merchandise (normal/original) sabre has c26, speed 101, reach 96.
you reach level 25, and the trigger is activated.
All troops with this weapon have it replaced by non-merchandise (better) sabre, c29, speed 112, reach 96. (adds 10% to stats).
If you take it all the way, then all troops suddenly have 10% better weapons, better shields, better weapons,
You the player can still only buy the crappy originals.  This is to increase the challenge of the game at higher levels.

I think it would be an huge amount of code repetition, but the game would only need to call it once, or potentially a few times but never during combat or map-movement as it would be called via menus...

the last thing that occurred to me would be a Dynasty progression mod where you start eg as a sea raider in 900, then after you have captured your first city the menu option appears to skip forward 250 years and observe your family's fortunes.  These are of course crap and you start again in 1150 with all the different kit available but you have no territory and maybe just three farmers as your loyal retainers.  If you can conquer a city again then you can skip forward another 250 years, and land in 1400 when eg your lands have been confiscated by the King of Nords on trumped-up charges and you start with decent stats but again no land, no troops, and not much money.  And the equipment is all changed again.

the dynasty progression version would need you to add items individually or in some sort of era-grouping to the merchants in module-triggers.  We can't have the c14 weapons being merchandise when you are playing the c9 or c12 parts of the game....

anyway, just some thoughts...
 
Amman de Stazia said:
here's a thought....
instead of allocating weapons and other gear in module troops, how about doing it via game menus or triggers?

what f'ing use is that?

well, picture this:  Game-start screen 1 - what year is your character born: choose 750 // 1150 // 1350
depending on your choice, the only thing that changes is the troop-items load.  But that changes the game hugely -
750 load-out is leather, 1-hander, roundshield:
1150 load-out is mail, 1-hander, kiteshield, helmet, horse: 
1350 load-out is plate, two-hander, helmet, horse.

instantly one mod becomes 3.  You can of course expand it to any amount of timeframes, but all would be tied to the same map, character-names, locations and architecture. 
Although, architecture could be changed with scene prop replace....

Anyway...

the other possibility is to have a trigger replace troop items with troop-better-items.  Example:  merchandise (normal/original) sabre has c26, speed 101, reach 96.
you reach level 25, and the trigger is activated.
All troops with this weapon have it replaced by non-merchandise (better) sabre, c29, speed 112, reach 96. (adds 10% to stats).
If you take it all the way, then all troops suddenly have 10% better weapons, better shields, better weapons,
You the player can still only buy the crappy originals.  This is to increase the challenge of the game at higher levels.

I think it would be an huge amount of code repetition, but the game would only need to call it once, or potentially a few times but never during combat or map-movement as it would be called via menus...

the last thing that occurred to me would be a Dynasty progression mod where you start eg as a sea raider in 900, then after you have captured your first city the menu option appears to skip forward 250 years and observe your family's fortunes.  These are of course crap and you start again in 1150 with all the different kit available but you have no territory and maybe just three farmers as your loyal retainers.  If you can conquer a city again then you can skip forward another 250 years, and land in 1400 when eg your lands have been confiscated by the King of Nords on trumped-up charges and you start with decent stats but again no land, no troops, and not much money.  And the equipment is all changed again.

the dynasty progression version would need you to add items individually or in some sort of era-grouping to the merchants in module-triggers.  We can't have the c14 weapons being merchandise when you are playing the c9 or c12 parts of the game....

anyway, just some thoughts...

Very good ideas. I found 1 of them can be done with simpler way. It's about giving non merchandise item with the same name for troops. Instead of doing that, we can simply giving the troops with positive imods.
You can do it via Module System by doing this : http://forums.taleworlds.com/index.php/topic,6575.msg4980547.html#msg4980547
 
Lav said:
Azrooh said:
All this except for the stat tracking is implemented in the Battle Time! mod. Also in Brytenwalda, but that's Battle Time! as well, just merged with Brytenwalda.
Excellent! Thanks a lot for the reference!

P. S. Though after reading their thread carefully, that's not what I meant. They host the game remotely, though apparently user's computer connects to it more or less seamlessly. Anyway, this needs further research.
Not necessarily remote, no. One can host the battle on their own machine once they do the setup, as described either in the Battle Time thread itself or in various threads of mods that use Battle Time, like Brytenwalda.

celestialred said:
Wait, so there's a mod that actually merges the single player campaign map with multiplayer? Or am I misunderstanding you?
Battle Time allows 1 player to play the SP campaign and the host a MP battle whenever their party is in battle, fight that battle MP, and then import the results back into their SP campaign.
 
dunde said:
CTCCoco said:
Somebody can tell me if there are a thrigger which checks if a player do the 'attack' action?

Just like on_agent_hit, but without hurt nothing. I mean, always somebody swing a sword.


Thanks.
(agent_get_attack_action, <destination>, <agent_id>), #returned values: free = 0, readying_attack = 1, releasing_attack = 2, completing_attack_after_hit = 3, attack_parried = 4, reloading = 5, after_release = 6, cancelling_attack = 7

Code:
attack_check = (0,0,0, 
  [(get_player_agent_no, ":player_agent"),  #SP version, you should use another agent check for MP, I don't know. Never mod MP
   (agent_get_attack_action, ":attack_action", ":player_agent"),
   (gt, ":attack_action, 0),
   #your code here
   ],
  []),

Well, thanks, very nice.
 
Hey ! :smile:

I have added the crouch animation and the low walk animation.

Everything is right in mission_templates and scripts, and i have this in animation.py:

Code:
["walk_forward_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
   # DUNDE :
   #[1.7, "low_walk", 0, 48, arf_use_walk_progress,pack2f(0.4,0.9)],
   [1.7, "low_walk", 0, 48, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]],
 ["stand_to_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_client_prediction|amf_keep,
   [1.0, "crouch_down", 0, 81,  arf_blend_in_1, 0, (0.0,0,0.0)]],
 ["crouch_to_stand", acf_enforce_lowerbody, amf_priority_continue|amf_client_prediction|amf_play,
   [1.0, "crouch_down", 154, 185, arf_blend_in_1, 0, (0.0,0,0.0)]],

and this (can't be used without the permission of Barabas):

Code:
["walk_forward_crouch", acf_displace_position|acf_enforce_lowerbody, amf_play|amf_priority_kick|amf_continue_to_next|amf_use_inertia,
   [1.0, "low_walk_cifre", 0,  48, arf_use_walk_progress|blend_in_walk, 0, (0, 1.0, 0)],
   #[2.0, "low_walk", 0,  48,  arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 2, 0), 0.0],
 ],
 ["walk_forward_crouch_2", acf_displace_position|acf_enforce_lowerbody, amf_play|amf_priority_kick|amf_use_inertia,
   [1.0, "low_walk_cifre", 0,  48, arf_use_walk_progress|blend_in_walk|arf_cyclic, 0, (0, 1.0, 0)],
 ],
 ["walk_backward_crouch", acf_displace_position|acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_continue_to_next|amf_use_inertia,
   [1.4, "low_walk_cifre", 48,  0,  blend_in_walk|arf_use_walk_progress, 0, (0, -1.0, 0)],
  # [2.0, "low_walk", 0,  48,  arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 2, 0), 0.0],
 ],
 ["walk_backward_crouch_2", acf_displace_position|acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_use_inertia,
   [1.4, "low_walk_cifre", 48,  0,  blend_in_walk|arf_use_walk_progress|arf_cyclic, 0, (0, -1.0, 0)],
  # [2.0, "low_walk", 0,  48,  arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 2, 0), 0.0],
 ],
 ["crouched", acf_enforce_lowerbody, amf_priority_kick|amf_keep|amf_accurate_body,
   [3.0, "crouch_down", 70, 80,  arf_cyclic|arf_blend_in_10],
 ],

But it makes this on the server, the low_walk aimation doesn't work:

http://www.wegame.com/watch/crouch-bug/

Do you have an idea where it comes from?
 
Tomy44 said:
Hey ! :smile:

I have added the crouch animation and the low walk animation.

Everything is right in mission_templates and scripts, and i have this in animation.py:

Code:
["walk_forward_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
   # DUNDE :
   #[1.7, "low_walk", 0, 48, arf_use_walk_progress,pack2f(0.4,0.9)],
   [1.7, "low_walk", 0, 48, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]],
 ["stand_to_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_client_prediction|amf_keep,
   [1.0, "crouch_down", 0, 81,  arf_blend_in_1, 0, (0.0,0,0.0)]],
 ["crouch_to_stand", acf_enforce_lowerbody, amf_priority_continue|amf_client_prediction|amf_play,
   [1.0, "crouch_down", 154, 185, arf_blend_in_1, 0, (0.0,0,0.0)]],

and this (can't be used without the permission of Barabas):

Code:
["walk_forward_crouch", acf_displace_position|acf_enforce_lowerbody, amf_play|amf_priority_kick|amf_continue_to_next|amf_use_inertia,
   [1.0, "low_walk_cifre", 0,  48, arf_use_walk_progress|blend_in_walk, 0, (0, 1.0, 0)],
   #[2.0, "low_walk", 0,  48,  arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 2, 0), 0.0],
 ],
 ["walk_forward_crouch_2", acf_displace_position|acf_enforce_lowerbody, amf_play|amf_priority_kick|amf_use_inertia,
   [1.0, "low_walk_cifre", 0,  48, arf_use_walk_progress|blend_in_walk|arf_cyclic, 0, (0, 1.0, 0)],
 ],
 ["walk_backward_crouch", acf_displace_position|acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_continue_to_next|amf_use_inertia,
   [1.4, "low_walk_cifre", 48,  0,  blend_in_walk|arf_use_walk_progress, 0, (0, -1.0, 0)],
  # [2.0, "low_walk", 0,  48,  arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 2, 0), 0.0],
 ],
 ["walk_backward_crouch_2", acf_displace_position|acf_enforce_lowerbody, amf_priority_kick|amf_play|amf_use_inertia,
   [1.4, "low_walk_cifre", 48,  0,  blend_in_walk|arf_use_walk_progress|arf_cyclic, 0, (0, -1.0, 0)],
  # [2.0, "low_walk", 0,  48,  arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 2, 0), 0.0],
 ],
 ["crouched", acf_enforce_lowerbody, amf_priority_kick|amf_keep|amf_accurate_body,
   [3.0, "crouch_down", 70, 80,  arf_cyclic|arf_blend_in_10],
 ],

But it makes this on the server, the low_walk aimation doesn't work:

http://www.wegame.com/watch/crouch-bug/

Do you have an idea where it comes from?

Heya,

Did you get the animations from The Vision, which Dunde stipulates you need for it to work?

Because my code looks like this
["walk_backward_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
  [1.7, "low_walk", 48, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]],
["walk_left_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
  [1.7, "crouch_side", 58, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]],
["walk_right_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
  [1.7, "crouch_side", 0, 58, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]], 
["crouch_to_low", acf_enforce_lowerbody, amf_priority_kick|amf_client_prediction|amf_play,
  [0.7, "crouch_down_new", 0, 100, arf_blend_in_1, 0, (0.0,0,0.0)]],


CR
 
Tomy44 said:
And is it possible to just add the crouching animations without the low_walk?

When I remove the low_walk lines in module_animations, the other fighting animations does'nt work.

Yep. Though you can't remove the low walk. It's a hardcoded animation. All you can do is modify Dunde's script to not use that animation, but that might require asking him specifically about it. That's where I'd start, anyway. :smile:

CR
 
Ok.

I  just add this but it's making "skateboard". I think, it comes from module_animations.py but everything seems good:

Code:
["walk_forward_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
   # DUNDE :
   #[1.7, "low_walk", 0, 48, arf_use_walk_progress,pack2f(0.4,0.9)],
   [1.7, "low_walk", 0, 48, arf_use_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]],
 ["stand_to_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_client_prediction|amf_keep,
   [1.0, "crouch_down", 0, 81,  arf_blend_in_1, 0, (0.0,0,0.0)]],
 ["crouch_to_stand", acf_enforce_lowerbody, amf_priority_continue|amf_client_prediction|amf_play,
   [1.0, "crouch_down", 154, 185, arf_blend_in_1, 0, (0.0,0,0.0)]],
 ["walk_backward_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
  [1.7, "low_walk", 48, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]],
 ["walk_left_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
  [1.7, "crouch_side", 58, 0, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]],
 ["walk_right_crouch", acf_enforce_lowerbody, amf_priority_continue|amf_use_cycle_period|amf_client_prediction,
  [1.7, "crouch_side", 0, 58, arf_use_inv_walk_progress|arf_cyclic|blend_in_walk|arf_make_walk_sound,pack2f(0.4,0.9), (0, 0, 0), 0.0]],  
 ["crouch_to_low", acf_enforce_lowerbody, amf_priority_kick|amf_client_prediction|amf_play,
  [0.7, "crouch_down", 154, 180, arf_blend_in_1, 0, (0.0,0,0.0)]],

Anyone got this problem too?
 
Hi,

Some operation in  module_scripts get more params when mentioned in header_operations
How does game handle this? Just ignore params or use it?

examples:
cur_tableau_add_horse = 1996  # (cur_tableau_add_horse, <item_id>, <position_no>, <animation_id>),
(cur_tableau_add_horse, ":horse_item", pos2, "anim_horse_stand", 0),


start_quest = 1280 # (start_quest,<quest_id>),
(start_quest, ":quest_no", ":giver_troop_no"),

val_mul = 2107    #dest, operand ::      dest = dest * operand # (val_mul,<destination>,<value>),
(val_mul, ":quest_gold_reward", ":quest_gold_reward", 7),

val_div = 2108    #dest, operand ::      dest = dest / operand # (val_div,<destination>,<value>),
(val_div, ":quest_gold_reward", ":quest_gold_reward", 4),
 
You want this thread.
To answer your question, header_operations isn't a definitive documentation but it is correct on most counts. There are hidden, optional parameters (and undocumented operations as well), but the game only takes in a certain amount of parameters for its hardcoded operations.
 
Can anyone tell me what went wrong here? I pulled this script off of an old post of Zarathas' and the code is by HokieBT. When I add this to a MT (lead charge) I get a build error saying "Error in Mission Template - Lead Charge" followed by the entire template


Code:
common_kill_beast_rider = (
	 5, 0, 0,            #check every 5 seconds
      [
        (try_for_agents, ":cur_agent"),
            (agent_is_alive, ":cur_agent"),  	   # so we don't try dead agents
            (agent_is_human,":cur_agent"),	      #agent is a human
            (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
            (eq, ":cur_agent_troop", "trp_wolf_rider"),
            (agent_get_horse,":agent_horse",":cur_agent"),
            (le, "agent_horse", 0),           # agent doesn't have a horse
            (agent_set_hit_points,":cur_agent",0,0),
            (agent_deliver_damage_to_agent,":cur_agent",":cur_agent"),
        (try_end),
     ])
 
Harry_ said:
can we change how much different terrain types slow us down on the overland map?
I looked into this earlier, and from what I read, I don't think there is a built in feature like that. So it requires a script that checks the terrain type the party is on, and changes their speed accordingly. I did read this awhile ago, though, so I could be off the mark.

Hopefully someone that knows better weights in, because I'd like to do this, as well.
 
Status
Not open for further replies.
Back
Top Bottom