Shout mod?

正在查看此主题的用户

Hi all,


I would like to know if someone created a Mod where u can shout during battles?

Cause for each end of battleground, i'm looking for a key for shout out at the top of one's voice ALL MY RAGE OF VICTORY  :twisted:


Thanks, & forgive me for my poor english, i'm a froggy french  :mrgreen:
 
do you want the actual sound, or just text on the screen?

Both are possible and not too hard, but in the second case you'll have to record the sound :smile:
 
I just want the hero (us) can shout when he wants to

i'm looking for something like create a key when you use it your character shout , and if possible with animation like he shows his sword in top of his head. (exactly like his soldiers)


I hope you see what i mean  :wink:
 
You can try and add something like this to any mission template you want:

(0, 0, 0, [(key_clicked, key_g)],  #here you set the key (I set it to "g")
  [(get_player_agent_no, ":player"),
  (agent_play_sound, ":player", "snd_man_warcry"),  #here you can set the sound played (if you want a new sound, you must add the sound in "module_sounds.py")
  (agent_set_animation, ":player", "anim_cheer"), #here you can set the animation
  ]),
 
Thanks a lot ! :grin:

It's exactly what i am looking for   :cool:

But i don't really know where i have to write this  :mrgreen:


All right i test i immediately :grin:
 
You have to add this to "module system" (module_mission_templates.py and module_sounds.py). It requires basic knowledge of editing module system, though.

Look here:
http://forums.taleworlds.com/index.php/topic,49267.0.html
http://forums.taleworlds.com/index.php/board,12.0.html
 
It sucks that native doesn't have an "all_battles_triggers" constant defined at the top.  That way, when nice triggers like that you want in all battles could be just added in one place....

I think that's the next thing I will do in my mod.  Add my own jik_battle_triggers constant to each battle.  I will probably put this as the first, since I like the idea of a battle cry, though I may do more with it.
 
all right, i've read all  a lot of the tutorial, and may have understand it  :eek:

but it doesn't work probably cause i made a mistake.


i explain you what i've done

first  python &  buildmodule run ok

so i have add in module_mission_templates.py :



common_player_war_cry =(
  0, 0, 0,
[
    (key_clicked, key_g)], 
  [(get_player_agent_no, ":player"),
  (agent_play_sound, ":player", "snd_man_warcry"), 
  (agent_set_animation, ":player", "anim_cheer"),
])

has u told me, but maybe i have to do something else, but i don't see what.


maybe i wrote it not in good place from the file

(i wrote between  common_siege_defender_reinforcement_check  &  common_siege_defender_reinforcement_archer_reposition

May you show me the way to follow now?  :grin:


 
the common_ thingie means that it can be used by all the templates below. So what you're doing is basically making a constant, which you can then call in any template you want.

So for each template you want to use it in, you have to write common_player_war_cry,

So let's say for the lead_charge template (the normal battle template) you want to add it.

That means you have to put the code somewhere at the top, like you've done and then go to the tuple for the lead_charge (just use 'search') and then put that common_player_war_cry, in there and it should work.

Have a look at how the common_battle_tab_press is used and you'll see what I mean.
 
Jataklamokete, all you need to do is look for "lead_charge", and add somewhere in there the code I quoted earlier. Like for example:

  (
    "lead_charge",mtf_battle_mode,charge,
    "You lead your men to battle.",
    [
    (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
    (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
    (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
    (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
    ],
    [
(ti_on_agent_spawn, 0, 0, [],
      [
        (store_trigger_param_1, ":agent_no"),
        (call_script, "script_agent_reassign_team", ":agent_no"),
        ]),

(0, 0, 0, [(key_clicked, key_g)],
  [(get_player_agent_no, ":player"),
  (agent_play_sound, ":player", "snd_man_warcry"),
  (agent_set_animation, ":player", "anim_cheer"),
  ]),


      common_battle_tab_press,

      (ti_question_answered, 0, 0, [],
      [(store_trigger_param_1,":answer"),
        (eq,":answer",0),
        (assign, "$pin_player_fallen", 0),
        (try_begin),
          (store_mission_timer_a, ":elapsed_time"),
          (gt, ":elapsed_time", 20),
          (str_store_string, s5, "str_retreat"),
          (call_script, "script_simulate_retreat", 10, 20),
        (try_end),
        (call_script, "script_count_mission_casualties_from_agents"),
        (finish_mission,0),]),
 
But that isn't for every battle is it?  What about for tournaments?  sieges?  Is this one always run for every battle? 

I remember reading for things like the shield bash kit, that you have to add it to every mission_template you want it used in.  That's what I posted that there should be a constant that is for every battle... 
 
But that isn't for every battle is it?  What about for tournaments?  sieges?  Is this one always run for every battle? 

No, it's just for standard field battles. If he wants it for every battle and mission, then the best way for him is to add the code at the beginning (like he already has), and the pasting "common_player_war_cry," in all the mission templates.
 
jik 说:
But that isn't for every battle is it?  What about for tournaments?  sieges?  Is this one always run for every battle? 

I remember reading for things like the shield bash kit, that you have to add it to every mission_template you want it used in.  That's what I posted that there should be a constant that is for every battle...

odd, quoting one's self...

Well I tried to make something similar to the common tournament_triggers, but it seems that this entry subs in for all triggers of that mission_template.  So it looks like it has to be put in each one individually...  (I'm sure someone already found this out, but boo-hoo to me...)
 
all right it works for standard battlefields, and i like it ! :cool:

nowi can shout like a bear during battles ! !  :twisted:

but a lil bug appears when i do it from an horse, the player goes down trought the horse like he was at feet, then he goes up back, funny but not really realistic ^^

anyway, i'm really glad for that, thanks a lot all, now the game is perfect for me ! :mrgreen:
 
Jataklamokete 说:
all right it works for standard battlefields, and i like it ! :cool:

nowi can shout like a bear during battles ! !  :twisted:

but a lil bug appears when i do it from an horse, the player goes down trought the horse like he was at feet, then he goes up back, funny but not really realistic ^^

anyway, i'm really glad for that, thanks a lot all, now the game is perfect for me ! :mrgreen:

Yes, I have that same problem in my mod. A week or so ago I added a Warcry script to my mod so that players could do basically what you are aiming to do, but the purpose of my script was to call for reinforcements. Anyway, it did the same basic thing: played the warcry sound (or woman_hit for female players since there is no woman_warcry sounds  :sad:) and then did the cheer animation. I have looked through the module_animations, but found no cheer animation that is (based on names) used for cheering while on a horse, even though I have most definitely seen npcs cheering while on a horse. I had forgotten about that until now.
 
后退
顶部 底部