Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hey everybody.

Say I want to create a custom NPC with his own dialogue and also make it possible to talk to him later and 'request' something that will follow next in my message from him. I want it to be stationed in a certain tavern. I don't really know how to do this yet, but I know it's possible and know where to look for it.

But most importantly, I want a certain music track to play instantly (or almost instantly) after you finish talking to that NPC and select an affirmative option in the last dialogue line. Is it possible?

P.S. and what I meant above, I want the player to be able to return to the NPC and request that music track again.
 
Ok, have made some models and the textures, now I stuck, what to do now? I know, stupid question
I want make them to brf files and use it in a mod.
I use wings 3D.
 
How do I position a Model so it fits in my hands,
Because right now this is the result

0FB199FCF6C0FC03EE99CBA6E66949FFF9C1F875

6B1222531AB8007BCE42A6002A61C43C9E227307
I have the feeling I am stupid,
but ye
I still ask it.
 
Art of Justice said:
Hey everybody.

Say I want to create a custom NPC with his own dialogue and also make it possible to talk to him later and 'request' something that will follow next in my message from him. I want it to be stationed in a certain tavern. I don't really know how to do this yet, but I know it's possible and know where to look for it.

But most importantly, I want a certain music track to play instantly (or almost instantly) after you finish talking to that NPC and select an affirmative option in the last dialogue line. Is it possible?

P.S. and what I meant above, I want the player to be able to return to the NPC and request that music track again.
If your NPC is always there, you can simply put him the old way on some scene entry point like this:
["unarmed_troop","Unarmed Troop","Unarmed Troops",tf_hero,scn_reyvadin_castle|entry(1),reserved,fac_commoners,[itm_arrows,itm_short_bow],def_attrib|str_14,0,knows_common|knows_power_draw_2,0],
(I hope this still works :smile:)
Of course, it's better to put him there from the appropriate script that sets up the scene with set_visitor. For tavern scene setup, this is in the "town_tavern" menu.

Playing music can be tricky as the game changes the music flags in several places.
It's simplest to make your music track a sound and play it with play_sound in the dialog execution block.
However, if you wish the music to fade out when changing to another scene and not play till it finishes, better make it a music track.
Use play_track and set the flags like this, if you want it to play only while the player is in the tavern, and to be playable only by code, and not randomly used by the game as tavern music.
  ("tavern_rhodok", "tavern_rhodok.ogg", mtf_module_track, mtf_sit_tavern),
 
Is it possible to make an option of becoming a king of existing faction?
I've found a thread with similar question, but I wasn't able to find the actual answer.
I never saw a mod with such feature, maybe it is hard coded and can't be changed?
 
Hello.

I would like to know if it is possible to have destructible scene props (like training dummies) that after being destroyed would show that way, next time character will enter the scene? (so that those dummies wouldn't regenerate)
 
duck83 said:
Hello.

I would like to know if it is possible to have destructible scene props (like training dummies) that after being destroyed would show that way, next time character will enter the scene? (so that those dummies wouldn't regenerate)
http://forums.taleworlds.com/index.php/topic,229342.0.html
Maybe this will help you.
 
Hey modding community!

I was wondering if someone could tell me if it is at all possible to attach a value to a multiplayer character profile?

For example; Lets say when you create a profile you are given the chance to choose a special skill (represented by a number value). I want it so that the profile remembers that value every time you select that character. So basically like selecting a banner, but rather its a value.

I'm out of ideas, by the way, so anything will help.
 
Thanks for your reply Dion/Folcwar, but that's not actually what I'm looking for.

I still need to get my destroyable scene props remain destroyed after entering the scene next time. I have tried to make a code, which I would like you guys help polishing it.

ti_on_scene_prop_init
(try_begin),
(scene_prop_slot_eq, "$current_scene_prop", slot_scene_prop_chopped", 1),
(destroy current scene prop),
(spawn trunk)
(try_end),

ti_on_scene_prop_destroyed
(try_begin),
(scene_prop_set_slot, "$current_scene_prop", slot_scene_prop_chopped", 1),
(try_end),

So after a while of searching on the forum I came up with the thing above. The problem is I'm totally new to coding in python and I don't know if "$current_scene_prop" is a proper instance_id and if the second part of the code isn't too short? I mean that part with setting the slot in "ti_on_scene_prop_destroyed". Shouldn't there be something else added, like assign slot to that scene_prop id?

I want to achieve the effect of having scene props swap for destroyed scene props every time I re-enter the scene, after their destruction. Please guys help, any clue would be priceless.
 
    (ti_on_init_scene_prop,
      [
      (store_trigger_param_1, ":instance_no"),
      (scene_prop_slot_eq, ":instance_no", slot_scene_prop_chopped, 1),
      (replace_prop_instance, ":instance_no", "spr_dummy_destroyed"),
    ]),

      (ti_on_scene_prop_destroy,
      [
        (store_trigger_param_1, ":instance_no"),
        (scene_prop_set_slot, ":instance_no", slot_scene_prop_chopped, 1),
        (replace_prop_instance, ":instance_no", "spr_dummy_destroyed"),
    ]),

Define slot_scene_prop_chopped and create spr_dummy_destroyed. You can also add sounds and effects like original dummies have.
 
I get error while processing, that "slot_scene_prop_chopped" is not defined.

Here is all the code for that scene prop:
###aspen_C

("tree_aspen_c",sokf_destructible,"chopable_aspen_c","bo_chopable_aspen_c",
  [
    (ti_on_init_scene_prop,
      [
        (store_trigger_param_1, ":instance_no"),
####code by Dusk Voyager
        (scene_prop_slot_eq, ":instance_no", slot_scene_prop_chopped, 1),
        (replace_prop_instance, ":instance_no", "spr_trunk_aspen_c"),
####ends here
        (scene_prop_set_hit_points, ":instance_no", 199),
        ]),

(ti_on_scene_prop_destroy,
    [
      (this_or_next|multiplayer_is_server),#only serverside
      (neg|game_in_multiplayer_mode),

####another part of code by Dusk Voyager
        (store_trigger_param_1, ":instance_no"),
        (scene_prop_set_slot, ":instance_no", slot_scene_prop_chopped, 1),
####ends here

      (store_trigger_param_2, ":instance_id"),

      (prop_instance_get_position, pos1, ":instance_id"),
      (set_spawn_position, pos1),
      (spawn_scene_prop, "spr_preitem_aspen_c"),
      (spawn_scene_prop, "spr_trunk_aspen_c"),

      (position_set_z, pos1, -10000),
      (prop_instance_set_position, ":instance_id", pos1, 0),
        (play_sound, "snd_dummy_hit"),
        (particle_system_burst, "psys_dummy_smoke", pos1, 3),
        (particle_system_burst, "psys_dummy_straw", pos1, 10),
    ]),
    (ti_on_scene_prop_hit,
      [

        (play_sound, "snd_dummy_hit"),
        (particle_system_burst, "psys_dummy_straw", pos1, 10),
    ]),
  ]),

I'm totally new to coding and dunno what should I do to solve that. Is that because of some messing with trigger params? Any help, please guys.
 
Nord Champion said:
I was wondering if someone could tell me if it is at all possible to attach a value to a multiplayer character profile?
I don't know of any other way than storing in the banner id itself: since that value is 32 bits (I think), and there would probably never be a banner id above 1023, you could store the appropriate values in the unused bits above: tweak any existing access of the banner id to add (val_and, ":banner_id", (1 << 10) - 1), and before setting the banner id anywhere add the appropriate numbers together. The player would need to select the extra data in a presentation called after the game banner selection one. It will cause script errors if your players use that profile for any module (except PW, which uses this technique and checks for a valid banner id before displaying), but making a new profile just for your mod might be workable.
 
Vornne said:
Nord Champion said:
I was wondering if someone could tell me if it is at all possible to attach a value to a multiplayer character profile?
I don't know of any other way than storing in the banner id itself: since that value is 32 bits (I think), and there would probably never be a banner id above 1023, you could store the appropriate values in the unused bits above: tweak any existing access of the banner id to add (val_and, ":banner_id", (1 << 10) - 1), and before setting the banner id anywhere add the appropriate numbers together. The player would need to select the extra data in a presentation called after the game banner selection one. It will cause script errors if your players use that profile for any module (except PW, which uses this technique and checks for a valid banner id before displaying), but making a new profile just for your mod might be workable.

Ah, thank you! I'll try it asap
 
MadVader said:
Art of Justice said:
Hey everybody.

Say I want to create a custom NPC with his own dialogue and also make it possible to talk to him later and 'request' something that will follow next in my message from him. I want it to be stationed in a certain tavern. I don't really know how to do this yet, but I know it's possible and know where to look for it.

But most importantly, I want a certain music track to play instantly (or almost instantly) after you finish talking to that NPC and select an affirmative option in the last dialogue line. Is it possible?

P.S. and what I meant above, I want the player to be able to return to the NPC and request that music track again.
If your NPC is always there, you can simply put him the old way on some scene entry point like this:
["unarmed_troop","Unarmed Troop","Unarmed Troops",tf_hero,scn_reyvadin_castle|entry(1),reserved,fac_commoners,[itm_arrows,itm_short_bow],def_attrib|str_14,0,knows_common|knows_power_draw_2,0],
(I hope this still works :smile:)
Of course, it's better to put him there from the appropriate script that sets up the scene with set_visitor. For tavern scene setup, this is in the "town_tavern" menu.

Playing music can be tricky as the game changes the music flags in several places.
It's simplest to make your music track a sound and play it with play_sound in the dialog execution block.
However, if you wish the music to fade out when changing to another scene and not play till it finishes, better make it a music track.
Use play_track and set the flags like this, if you want it to play only while the player is in the tavern, and to be playable only by code, and not randomly used by the game as tavern music.
  ("tavern_rhodok", "tavern_rhodok.ogg", mtf_module_track, mtf_sit_tavern),

Thanks!


New question.
How does one bind the music tracks to regions/factions? E.g. I want one set of tracks to play when player rides the lands of one faction and another set for the other faction and so on.
 
MadVader said:
("travel_rhodok",  "travel_rhodok.ogg",  mtf_module_track|mtf_culture_5|mtf_sit_travel, mtf_sit_night|mtf_culture_all),

Do I understand right that "culture_5" binds it to rhodoks but "culture all" also lets this track play allover the map?

What if I have a custom map and factions, how do I set "borders"? Or will it understand culture tag even on custom map?
 
Status
Not open for further replies.
Back
Top Bottom