MBX

Mount&Blade Expansion => Mod Graveyard => Discussion => Topic started by: Fisheye on February 04, 2007, 09:59:21 am

Title: M&B Script Requests
Post by: Fisheye on February 04, 2007, 09:59:21 am
If you need a short chunk of code to do something, but don't know how / have no time to do it, post your request here and hopefully someone will contribute the relevant code.
Title: Re: M&B Script Requests
Post by: Nethros on February 09, 2007, 04:17:21 pm
I'm very interested in knowing how Highelfwarrior did reflective water on the world map in Fantasymod. I'd be grateful for anyone who told me. I think it's a cool spice to your mod, which makes people more interested in it. It also looks really professional ;)
Title: Re: M&B Script Requests
Post by: Fisheye on February 09, 2007, 06:16:51 pm
Nethros: Is this it here?

http://mbx.streetofeyes.com/index.php?topic=230.0

Check the tutorial by Leprechaun in that post. Not sure if that's the one or if you want something advanced like a custom skybox reflected on the water.
Title: Re: M&B Script Requests
Post by: Nethros on February 09, 2007, 06:40:11 pm
It's that one! Thank you! I'd kiss you, but that'd be gay. And I ain't.
Title: Re: M&B Script Requests
Post by: Fisheye on February 09, 2007, 07:12:27 pm
Don't kiss me, kiss that Leprechaun guy who wrote the thing. Just don't steal his lucky charms while you're doing it.
Title: Re: M&B Script Requests
Post by: Nethros on February 09, 2007, 07:43:14 pm
It's that one! Thank you! I'd kiss you, but that'd be gay. And I ain't.

Kissing Leprachaun is worse. Even if I liked guys that way, the irish dwarfs...wouldn't be my type.
Title: Re: M&B Script Requests
Post by: atazk on March 13, 2007, 04:50:37 pm
so this would be an extremely noob question, but i cant seem to find the answer in the forums, forgive my idiocy. Anyway, i cant seem to get mods working for my M&B game, just the small ones like weapons packs that have a .brf file in order to work and need the script in module_info.txt, ive placed and replaced .dds in the texture folders of native and the original was as well, and ive tried adding the script myself but i always get an error. If anyonr can explain it to me id really appreciate it, and plz forgive my noobness.
Title: Re: M&B Script Requests
Post by: Yoshiboy on March 14, 2007, 02:24:12 am
so this would be an extremely noob question, but i cant seem to find the answer in the forums, forgive my idiocy. Anyway, i cant seem to get mods working for my M&B game, just the small ones like weapons packs that have a .brf file in order to work and need the script in module_info.txt, ive placed and replaced .dds in the texture folders of native and the original was as well, and ive tried adding the script myself but i always get an error. If anyonr can explain it to me id really appreciate it, and plz forgive my noobness.

What error do you get?
Title: Re: M&B Script Requests
Post by: atazk on March 14, 2007, 04:00:08 am
it never says, it just does that beep/noise sound when you get an error, then it freezes up and it always happen when the game is loading the textures. this only happens if i enter the "code" in the module_info.txt, if the code isnt their i can play fine, but the textures that i want arent there
Title: Re: M&B Script Requests
Post by: Yoshiboy on March 14, 2007, 04:25:19 am
it never says, it just does that beep/noise sound when you get an error, then it freezes up and it always happen when the game is loading the textures. this only happens if i enter the "code" in the module_info.txt, if the code isnt their i can play fine, but the textures that i want arent there

Are you sure you are loading all the correct texture and material files as well as the meshes?
Title: Re: M&B Script Requests
Post by: atazk on March 14, 2007, 01:19:48 pm
that i know of all files are there, but maybe i am wrong. What i do from the files i download i put .dds files into the texture folders, and brf files in the resources, im not sure of the code though. All ive been doing is entering this code:
load_mod_resource = horses (example) ive also tried load_module_resource, these codes i enter in the module.txt in the native folder. After i load the game and i get the error, but if i remove the "code" then it works fine
Title: Re: M&B Script Requests
Post by: Yoshiboy on March 14, 2007, 02:35:01 pm
run M&B in windowed mode and when you get the beep sound press alt-tab and go out until you see the error message
then tell me what it says :)
Title: Re: M&B Script Requests
Post by: atazk on March 14, 2007, 06:04:15 pm
one error shows: attempt to reregister texture shields.dds, other mods dont load as far as i know
Title: Re: M&B Script Requests
Post by: Yoshiboy on March 15, 2007, 09:57:59 am
Looks like somewhere you have two references to a texture shields.dds or two textures with that name.
Title: Re: M&B Script Requests
Post by: atazk on March 15, 2007, 02:02:40 pm
ok.. then i see where the problem, ive been putting .dds files in the normal texture folder in mount and blade folder and in the native texture folder. Which folder should i add the textures to? and also is the code im using for the module_info.txt correct: load_mod_resource = horses ?
Title: Re: M&B Script Requests
Post by: Yoshiboy on March 16, 2007, 11:29:22 am
ok.. then i see where the problem, ive been putting .dds files in the normal texture folder in mount and blade folder and in the native texture folder. Which folder should i add the textures to? and also is the code im using for the module_info.txt correct: load_mod_resource = horses ?

You should add them to a modular texture folder. If you still want to load them from the normal texture folder i guess you can set the line to load_resource and it might work.
Title: Re: M&B Script Requests
Post by: atazk on March 16, 2007, 03:52:39 pm
i dont get too many errors now but i still dont see any changes. Maybe you could walk me through real quick, i might be mising something, thx for all your help
Title: Re: M&B Script Requests
Post by: Yoshiboy on March 17, 2007, 05:10:23 am
http://mbx.streetofeyes.com/index.php/topic,17.0.html

this tutorial covers the basics of setting up a mod folder with correct materials and texture references.
Title: Re: M&B Script Requests
Post by: Smaug_the_dragon on May 24, 2007, 06:57:06 pm
I'd love a script to set up a dialoge as soon as a player has been defeated in a scripted battle (like the arena)
Title: Re: M&B Script Requests
Post by: Scrat on December 13, 2007, 05:44:57 am
I would like an example on how to add ambient sound while i'm in town or on the battlefield. So what part of the module system do I need and where should I put the code? (Starting the ambient sound and ending it when leaving the area.)

P.S. Could someone tell me how rain works in m&b?

Thanks
Title: Re: M&B Script Requests
Post by: Cartread on December 13, 2007, 09:43:21 am
Eisenhouwer
Add sounds with module_mission_templates into whichever mts you wish.  The most prominent town mt is town_default and the most prominent battle mt is lead_charge.

So to have a sound activated in town_default, you'd use play_sound in town_default's trigger section:

    [
      (1, 0, ti_once, [], [
          (store_current_scene, ":cur_scene"),
          (scene_set_slot, ":cur_scene", slot_scene_visited, 1),
        ]),
      (ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners")]),
      (ti_inventory_key_pressed, 0, 0, [(set_trigger_result,1)], []),
      (ti_tab_pressed, 0, 0, [(set_trigger_result,1)], []),
 
      (1, 2, 3, [],[(play_sound,"snd_asants_lumber_1")]),

   ],

1 is the check interval, 2 the delay, and 3 the rearm (they can be any time you want, so for instance 0,0,60 would play the sound every minute). (note: the sound will overlap if its play time is longer than the check+delay+rearm times)

play_sound calls a sound from module_sounds
if you're using your own sound you need to add it to module sounds, the M&B/Modules/yourmod/Sounds and do 1 for scan module sounds in module.ini

-----
game_rain is a module_particle_system, but it is part of the M&B weather system which is unmoddable.
Title: Re: M&B Script Requests
Post by: Scrat on December 13, 2007, 11:34:31 am
Thanks for that!
Title: Re: M&B Script Requests
Post by: Cartread on December 15, 2007, 11:00:26 am
Yep.

I just saw this, too, in header_operations:

(set_rain,<rain-type>,<strength>), (rain_type: 1= rain, 2=snow ; strength: 0 - 100)
(set_fog_distance, <distance_in_meters>, [fog_color]),

So these would probably override the weather system.