MP Info Module System Warband Modding: Server and Client Events

Users who are viewing this thread

Would this same principle apply to sending messages to all clients or is messaging handled differently?

Ie. When a scene prop spawns an item all clients get a display_message like;
(display_message, "@The awsome super thingy has been found!"),
Since the event is triggered by a scene prop the server is already handling with the server_is_multiplayer do I still need to send to server or can I just use multiplayer_send_string_to_player inside prop parsing like so..

(assign, ":message", "@Mymessage"),
(get_max_players, ":num_players"),   
  (try_for_range, ":cur_player", 0, ":num_players"),
      (multiplayer_send_string_to_player, ":cur_player", ":message"),

Or am I totally whacked, fairly new to this
If the server is already handling it then that should be fine. But be careful with scene props, because clients usually have to "trigger" events on them in some sense.
Does not work for me =(

I've done the tutorial 3 times, I don't get sound when shooting the pistol and no debug message.
I think I know why its not working Yoshiboy. When you initially did this tutorial, I think there was a

        (neq, multiplayer_is_server),

code but now its

        (neq, multiplayer_is_dedicated_server),

And I looked in module_common and there is no such code as

multiplayer_is_server                = 417 # (multiplayer_is_server),

or anything of that nature. Is it possible that this could have something to do with it?
Nord Champion said:
        (neq, multiplayer_is_server),
That line of code is a bug in native (I think fixed in the next version) and doesn't do anything at all: the correct way is (neg|multiplayer_is_server). Both multiplayer_is_server and multiplayer_is_dedicated_server are valid, as you can see in; (module_common doesn't exist) is used for other things like network event numbers.
Sorry for bumping this, but thanks Yoshiboy! I tried this tutorial again and it works perfectly.

My guess as to what people are having problems with, or at least it was for me, is finding the end of the "Client Events" bracket in module_scripts.

To save time, the end is:

          (eq, ":event_type", multiplayer_event_show_server_message),
          (display_message, "str_server_s0", 0xFFFF6666),

Thanks again Yoshi!
Sorry for bumping but this code worked for me when I changed this:
[(ti_on_weapon_attack, [(multiplayer_send_int_to_server,multiplayer_event_sound_made_by_player,"snd_pistol_shot")
to this
[(ti_on_weapon_attack, [(multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_pistol_shot")
Well, for pos-specific things (most complicated once here) - you can send "pos" xyz coords first then do whatever pos related. (show marker/sound etc... )

NB! Please note that pos should not be used in any other place, since it coukd be overwritten.
i`m sorry ive tried this script on napoleanic war

and its just ****ed up my game

can somebody help me
Top Bottom