Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Bennie94v said:
Im having a little trouble with a mini mod im working on.

i've added a musket type weapon into multiplayer however when i shoot it there is no smoke..any help?
Ok So i got that working but no shooting sound?  :???:
Agent_play_sound in multiplayer_is_server
 
mardam said:
how would i add crouching into multiplayer?
In the OSP section, there is single player code by dunde available for crouching. If you can add it successfully to SP, then refer to the tutorials on MP server/client events and then come back when you have specific questions on doing that or run into trouble.
 
Hey everyone! I'm new to modding, tried it a while back and kinda lost track with it but now I wanna get back into it and I was wondering if anyone has or knows of any tutorials or guides on how to add custom banners to the game that go on shields and armor etc. Any help would be really appreciated!
 
Hey I'll just post this again but can you have bump maps on clothing in mount and blade and if so could you tell me which shader to use. I haven't noticed any other clothing in native that feature bump maps so I hope this doesnt mean I can't use one for this new clothing I did, please someone answer me this time but this is probably a simple question.
 
Hi guys.
I wrote a little rotation script for a windmill fan(Warband).
It works but the fan only rotates once and not endless.

So I have to add some loop or something that the fan rotates "non stop".

(the 360° doesnt work, but less)
Code:
  ("windmill_fan_turning",sokf_moveable,"windmill_fan_turning","bo_windmill_fan_turning", [
    (ti_on_init_scene_prop,
    [
      (try_begin),
        (this_or_next|multiplayer_is_server),
	(neg|game_in_multiplayer_mode),

        (store_trigger_param_1, ":instance_no"),
      
        (prop_instance_get_position, pos1, ":instance_no"),
        (position_rotate_y, pos1, 360),
        (prop_instance_animate_to_position, ":instance_no", pos1, 1000), #animate to position 1 in 10 second
        (play_sound, "snd_windmill_fan"),
      (try_end),
    ]),
  ]),
Could someone help me :?:
 
Affengeil said:
Hi guys.
I wrote a little rotation script for a windmill fan(Warband).
It works but the fan only rotates once and not endless.

So I have to add some loop or something that the fan rotates "non stop".

(the 360° doesnt work, but less)
Code:
  ("windmill_fan_turning",sokf_moveable,"windmill_fan_turning","bo_windmill_fan_turning", [
    (ti_on_init_scene_prop,
    [
      (try_begin),
        (this_or_next|multiplayer_is_server),
	(neg|game_in_multiplayer_mode),

        (store_trigger_param_1, ":instance_no"),
      
        (prop_instance_get_position, pos1, ":instance_no"),
        (position_rotate_y, pos1, 360),
        (prop_instance_animate_to_position, ":instance_no", pos1, 1000), #animate to position 1 in 10 second
        (play_sound, "snd_windmill_fan"),
      (try_end),
    ]),
  ]),
Could someone help me :?:

You are going to need a timed mission template trigger (akin to what you are working with about drowning) to tell that prop to rotate again every few seconds.  OR you could try using:
Code:
ti_on_scene_prop_is_animating = -45.0 #can only be used in module_scene_props triggers
# Trigger Param 1: prop instance number
# Trigger Param 2: remaining animation time

ti_on_scene_prop_animation_finished = -46.0 #can only be used in module_scene_props triggers
# Trigger Param 1: prop instance number
animation_finished, particularly should work well to re-start the animation every time it ends.
 
Affengeil said:
I wrote a little rotation script for a windmill fan(Warband).
The native module already includes a script to rotate windmills, but it is only run from the "tutorial_5" mission template; add something like this to your mission template (this one was used for a MP mode):
Code:
(0, 0, 1, [(neg|multiplayer_is_server)], [(call_script, "script_cf_turn_windmill_fans", 0)]),
 
Thank you.
I just made a new trigger which calls the windmill script
Code:
#windmill fan
windmill_fan = (
   0, 0, 1,
   [
     (call_script, "script_cf_turn_windmill_fans", 0),
   ], [])

I have one more question.
Is it possible to add just one trigger to a misson template which contains many triggers ?
someting like this :?:
Code:
...
...
trigger_a = (
...
trigger_b = (
...
trigger_c = (
...
#all triggers go in here
common_mod = (trigger_a, trigger_b, trigger_c)
...
...
    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [
... 
    common_mod,
...
Instead of adding each trigger to the mission template?
Code:
...
...
trigger_a = (
...
trigger_b = (
...
trigger_c = (
...
...
    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [
... 
    trigger_a,
    trigger_b,
    trigger_c,
...
 
trigger_a = (...)
trigger_b = (...)
common_trigger = [trigger_a, trigger_b]

    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [
...

  ] + common_trigger,
),

("multiplayer_XX", ....

 
So...

What is the difference between

This:

Code:
    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [

    common_trigger,
... 

   ]),

And this:

Code:
    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [
... 

   ] + common_trigger,
 ),

?
 
xPearse said:
Hey I'll just post this again but can you have bump maps on clothing in mount and blade and if so could you tell me which shader to use. I haven't noticed any other clothing in native that feature bump maps so I hope this doesnt mean I can't use one for this new clothing I did, please someone answer me this time but this is probably a simple question.

If people dont know then at least please say that. I have been waiting for an answer some time but can someone please help me out.
 
xPearse said:
xPearse said:
Hey I'll just post this again but can you have bump maps on clothing in mount and blade and if so could you tell me which shader to use. I haven't noticed any other clothing in native that feature bump maps so I hope this doesnt mean I can't use one for this new clothing I did, please someone answer me this time but this is probably a simple question.

If people dont know then at least please say that. I have been waiting for an answer some time but can someone please help me out.
I don't know, which is why I for one haven't responded. Sorry, haven't dealt all that much with textures.

Gergin Adam said:
So...

What is the difference between

This:

Code:
    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [

    common_trigger,
... 

   ]),

And this:

Code:
    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [
... 

   ] + common_trigger,
 ),

?
Python sytanx. (Not module system syntax, but actual Python syntax)

In Python, something in parentheses () is a 'tuple' an ordered, immutable (unchangeable) list of things with the elements separated by a comma ,
Something in brackets [] is a list, an ordered but changeable list of things with elements separated by a comma.

The compiler, when going through the list of triggers
[
  trigger_name,
  (ti_on_agent_spawn....),
#etc
]
is expecting each element in the list to be a tuple...NOT another list. Nesting a list where it expects a single tuple item will cause errors.

In order to add your list of triggers
trigger_common = [trigger_a, trigger_b]
(which is a list whose elements are two tuples, defined above)
you need to add the list trigger_common to the end of the full list of triggers. In Python, the operation to concatenate lists is +
This makes the full trigger list longer by adding the two elements of the list trigger_common, that is trigger_a and trigger_b, to the end of the list (rather than embedding them as a single item in a list when they are supposed to be two items)
 
Caba`drin said:
Gergin Adam said:
So...

What is the difference between

This:

Code:
    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [

    common_trigger,
... 

   ]),

And this:

Code:
    (
    "multiplayer_dm",mtf_battle_mode,-1, #deathmatch mode
    "You lead your men to battle.",
    [
... 

   ] + common_trigger,
 ),

?
Python sytanx. (Not module system syntax, but actual Python syntax)

In Python, something in parentheses () is a 'tuple' an ordered, immutable (unchangeable) list of things with the elements separated by a comma ,
Something in brackets [] is a list, an ordered but changeable list of things with elements separated by a comma.

The compiler, when going through the list of triggers
[
  trigger_name,
  (ti_on_agent_spawn....),
#etc
]
is expecting each element in the list to be a tuple...NOT another list. Nesting a list where it expects a single tuple item will cause errors.

In order to add your list of triggers
trigger_common = [trigger_a, trigger_b]
(which is a list whose elements are two tuples, defined above)
you need to add the list trigger_common to the end of the full list of triggers. In Python, the operation to concatenate lists is +
This makes the full trigger list longer by adding the two elements of the list trigger_common, that is trigger_a and trigger_b, to the end of the list (rather than embedding them as a single item in a list when they are supposed to be two items)

Thanks, I got it now! My triggers are single, I am not using lists right now but I am curious: What if I have two lists of triggers? Should I use like
Code:
]
+trigger_list_a, +trigger_list_b,
),
?
 
Gergin Adam said:
Thanks, I got it now! My triggers are single, I am not using lists right now but I am curious: What if I have two lists of triggers? Should I use like
Code:
]
+trigger_list_a, +trigger_list_b,
),
?
Drop the comma as you aren't separating elements in a data object, but adding multiple objects (lists in this case)

So
Code:
]
 + trigger_list_a + trigger_list_b,
),
 
That's the easier way. You can also add them inside the specific MT in the form of
trigger_list_a,
trigger_list_b,

but the + method works much better
 
Specialist said:
That's the easier way. You can also add them inside the specific MT in the form of
trigger_list_a,
trigger_list_b,

but the + method works much better
You cannot include a list within the trigger list, which is what we just covered above.
You can do
trigger_a,
trigger_b,

but if the name is a list rather than a single trigger, you need to use the "+ method"
 
Status
Not open for further replies.
Back
Top Bottom