Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
WookieWarlord said:
Just use a try block thing.


Like:
Code:
(try_begin),
(eq, ":faction", "fac_kingdom_3"),
(play_sound, "snd_sound1"),
(else_try),
(eq, ":faction", "fac_kingdom_4"),
(play_sound, "snd_sound2"),
(else_try),
etc
(try_end),


@Lumos: I win this round!

That's assuming he only wants the person who pressed the key to hear the sound. You need to send a message to the server to have it bounce a message to all the applicable clients and tell them to play the sound.
 
But it's still the same basic method, just replace 'play_sound' with the 'multiplayer_send_int_to_server' or whatever.


I think he could either get the players faction client side and send a different multiplayer message accordingly, or send the faction id as a parameter in the message (probably the better option).
 
MadocComadrin said:
It was added with the last patch, hopefully it works, because I'm relying on it! Unless I get ninja'd, I'll let you know after I do some testing.
My test was not successful... May be fortune smiled to you?
 
Hmm. Well, would this by any chance work. It only has the key that plays the sound currently though.

Code:
(try_begin),
(key_clicked, some_key),
(eq, ":faction", "fac_kingdom_3"),
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound1"),
(else_try),
(eq, ":faction", "fac_kingdom_4"),
(play_sound, "snd_sound2"),
(else_try),
etc
(try_end),
I probably have to add multiplayer_is_server after try_begin?
 
Have the key press out of the try loop, in the trigger part:


(0, 0, 0, [(key_clicked,key_m),],
      [

Also you cant just send message to server and have it play, follow yoshi's tutorial to get it working. (You probably already know that).


You don't need multiplayer_is_server I think.
 
WookieWarlord said:
Have the key press out of the try loop, in the trigger part:


(0, 0, 0, [(key_clicked,key_m),],
      [

Also you cant just send message to server and have it play, follow yoshi's tutorial to get it working. (You probably already know that).


You don't need multiplayer_is_server I think.
Yeah I know. I have used the tutorial on my guns : P
So, Is it good now?
Code:
(try_begin),
(0, 0, 0, [(key_clicked,key_m),],
[(eq, ":faction", "fac_kingdom_3"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound1"),
(else_try),
  (eq, ":faction", "fac_kingdom_4"),
  (play_sound, "snd_sound2"),
(else_try),
etc
(try_end),],
and add it under #common_battle_init_banner, of some battle template?
 
More like:
Code:
(0, 0, 0, [(key_clicked,key_m),],
[
(try_begin),
(eq, ":faction", "fac_kingdom_3"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound1"),
(else_try),
(eq, ":faction", "fac_kingdom_4"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound2"),
(else_try),
etc
(try_end),]),
It's its own trigger, goes in your mission template but not inside another trigger in the template.
 
WookieWarlord said:
More like:
Code:
(0, 0, 0, [(key_clicked,key_m),],
[
(try_begin),
(eq, ":faction", "fac_kingdom_3"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound1"),
(else_try),
(eq, ":faction", "fac_kingdom_4"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound2"),
(else_try),
etc
(try_end),]),
It's its own trigger, goes in your mission template but not inside another trigger in the template.
Oh, alrighty. Well, Ill test this today and see if it works. Thanks (= Just to ask, since I need to do many keys, will it work if I add the same code under it but with a changed key? Like this
Code:
(0, 0, 0, [(key_clicked,key_m),],
[
(try_begin),
(eq, ":faction", "fac_kingdom_3"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound1"),
(else_try),
(eq, ":faction", "fac_kingdom_4"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound2"),
(else_try),
etc
(try_end),]),

(0, 0, 0, [(key_clicked,key_o),],
[
(try_begin),
(eq, ":faction", "fac_kingdom_3"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound1"),
(else_try),
(eq, ":faction", "fac_kingdom_4"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_sound2"),
(else_try),
etc
(try_end),]),
 
WookieWarlord said:
Yea sure, but I thought you wanted it to be the same key, wasn't that the whole point?
Yes yes but many keys D: like if you have played example, any fps shooter or ww2 fps, you know they have voice commands right? Basically, I want to do the same thing. Thats why I want many keys but unique sounds for each faction + the message for your team which basically just translates the command.
 
Tsubodai said:
How do you make a variable change from e.g. $geoffrey_duel 1 to $geoffrey_duel 2 when you defeat a certain party?
I seem to recall you were learning from JIK's modsys tutorial.
I just opened it up (it's how i learned as well  :razz: ), and in the mission template where you fight geoffrey, (arena_duel_geoffrey), he uses a trigger:
Code:
(2, 3, ti_once,[( all_enemies_defeated, 1),(neg|main_hero_fallen, 0),],
[(quest_set_slot,"qst_mod_trouble",slot_quest_current_state,3),
(remove_troop_from_site,"trp_npc17","scn_town_mod_tavern"), ##Remove Geoffrey from the tavern scene
(finish_mission),
]
),
 
Thanks.
Yeah, just found that tutorial, I was using the older version (as I found it first), the one Winter made (and he made it a normal battle not an arena one).

This is great for an arena fight, but what if instead it was a normal battle in the field? Would the coding be different to make it that when Geoffrey's Party fights you and you defeat it, you get $geoffrey_duel to change to 2?
 
Thats the thing, I've tried putting it (geoffrey's party defeated results in..etc.) into variables and into scripts but that doesn't help.

What I put into module_scripts:
(try_begin),
        (eq, "$geoffrey_duel",1),
        (party_set_flags, ":spawned_party_id", pf_quest_party, 1),
      (else_try),
        (party_set_flags, ":spawned_party_id", pf_quest_party, 0),
      (try_end),
(am i even supposed to do this?)
Dialogs maybe? But not sure.
 
I read somewhere on these forums that if you mess around with the size of a battlefield, it will cause your opponents to get stuck on their spawn point. Now, I played some with my random scenes, and unintentially did this very thing with my steppe bandits, and I assumed it was because I was messing with random steppe scenery.

I went back to the original python files, replaced the entire random scene tuples with the originals and also the random obj files from the native module. Now all my scenery is back to original native ...except my steppe bandits are still stuck on their spawn point. I have no problem with other troops getting stuck (looters, deserters), so I suppose it's something to do with the steppe bandits themselves, but what that *something* is I haven't a clue.

Any ideas? Anybody?
 
Status
Not open for further replies.
Back
Top Bottom