Author Topic: M&B Script Requests  (Read 14918 times)

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
M&B Script Requests
« 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.

Offline Nethros

  • Journeyman
  • ***
  • Posts: 253
    • View Profile
Re: M&B Script Requests
« Reply #1 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 ;)

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: M&B Script Requests
« Reply #2 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.

Offline Nethros

  • Journeyman
  • ***
  • Posts: 253
    • View Profile
Re: M&B Script Requests
« Reply #3 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.

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: M&B Script Requests
« Reply #4 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.

Offline Nethros

  • Journeyman
  • ***
  • Posts: 253
    • View Profile
Re: M&B Script Requests
« Reply #5 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.

atazk

  • Guest
Re: M&B Script Requests
« Reply #6 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.

Yoshiboy

  • Guest
Re: M&B Script Requests
« Reply #7 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?

atazk

  • Guest
Re: M&B Script Requests
« Reply #8 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

Yoshiboy

  • Guest
Re: M&B Script Requests
« Reply #9 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?

atazk

  • Guest
Re: M&B Script Requests
« Reply #10 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

Yoshiboy

  • Guest
Re: M&B Script Requests
« Reply #11 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 :)

atazk

  • Guest
Re: M&B Script Requests
« Reply #12 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

Yoshiboy

  • Guest
Re: M&B Script Requests
« Reply #13 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.

atazk

  • Guest
Re: M&B Script Requests
« Reply #14 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 ?

Yoshiboy

  • Guest
Re: M&B Script Requests
« Reply #15 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.

atazk

  • Guest
Re: M&B Script Requests
« Reply #16 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

Yoshiboy

  • Guest
Re: M&B Script Requests
« Reply #17 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.

Smaug_the_dragon

  • Guest
Re: M&B Script Requests
« Reply #18 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)

Scrat

  • Guest
Re: M&B Script Requests
« Reply #19 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

Offline Cartread

  • Craftsman
  • **
  • Posts: 110
    • View Profile
Re: M&B Script Requests
« Reply #20 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.

Scrat

  • Guest
Re: M&B Script Requests
« Reply #21 on: December 13, 2007, 11:34:31 AM »
Thanks for that!

Offline Cartread

  • Craftsman
  • **
  • Posts: 110
    • View Profile
Re: M&B Script Requests
« Reply #22 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.