Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
got a question, maybe a silly one...

after i commented out some towns, castles and villages (and replaced them with locations still ingame in all the scripts) the module compiles fine, but ingame i get a "division by zero" error message for the script calculate_castle_prosperities_by_using_its_villages.
i still don't understand this script fully, and i just don't find a reason for any "division by zero" error or whatnot...

would be cool if someone could point out at which point i'm stupid once again  :razz:
 
Bolkonsky said:
I have this lying around from somewhere:
Code:
["diseased_corpse", "Diseased Corpse", [("half_cata_lam",0)], itp_type_thrown|itp_primary ,itcf_throw_axe, 500 , weight(4)|difficulty(0)|spd_rtng(85) | shoot_speed(30) | thrust_damage(1 ,  blunt)|max_ammo(6)|weapon_length(8),imodbits_none,
[(ti_on_missile_hit, [ 
   (store_trigger_param_1,":agent"),
        (try_for_agents,":target"),
            (agent_get_position,pos2,":target"),
            (get_distance_between_positions,":dist",pos1,pos2),
       (try_begin),
               (lt,":dist",250),
               (store_agent_hit_points,":hp",":target",1),
      (store_random_in_range,":dmg",60,100),
      (val_sub,":hp",":dmg"),
      (agent_set_hit_points,":target",":hp",1),
      (agent_deliver_damage_to_agent,":agent",":target"),
       (try_end),
            (particle_system_burst,"psys_green_ick",pos1,50),
            (particle_system_burst,"psys_game_blood",pos1,50),
        (try_end)
		])]],

You'd just need to change the psys.

Thanks!
That is basically what I need. :smile:
 
Somebody said:
Rule zum Rabensang said:
got a question, maybe a silly one...
(store_div, ":castle_prosperity", ":total_prosperity", ":total_villages"),
The conditional block should have (gt, ":total_villages", 0), before this line.
Thanks alot!!!
quite simple and makes perfect sense. I just did not recognize that there are now castles without villages who have to get excluded...
 
I have a question. When horse gets wounded it'll change into "lame" horse, is it hardcoded in game or can it be altered? Say change horse modifiers instead of going from anything to lame to go somewhat like this: spirited -> heavy -> normal -> stubborn -> lame -> ~dead~?

I tried looking into module system myself, but could not find places that actually follow when horse goes down in battle and change horse to lame/kill it.
 
It's hardcoded for the player character. You could create a trigger to catch horse death events and degrade item modifiers, but the player can dismount and find another horse which won't match the original horse item in the inventory. There are triggers to catch dis/remounts too, but I can't remember testing them.
 
Code:
      ("camp_trainer",
       [], "Speak with the innkeep.",
       [
         (set_jump_mission, "mt_training_ground_trainer_talk"),
         (modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
         (reset_visitors),
         (set_jump_entry, 5),
         (jump_to_scene, "$g_training_ground_melee_training_scene"),
         (change_screen_mission),
         (music_set_situation, 0),
      (try_begin),
       (check_quest_active, "qst_learn_where_merchant_brother_is"),
      (else_try),
       (check_quest_active, "qst_save_relative_of_merchant"),
       (neg|check_quest_succeeded, "qst_save_relative_of_merchant",)
       (set_visitor, 4, "trp_npc2"),
      (try_end),
         ]),

New question instead.  I can't seem to spawn NPC 2 at the training ground.  What did I do wrong in my code?
 
Lueii said:
New question instead.  I can't seem to spawn NPC 2 at the training ground.  What did I do wrong in my code?
1. try put your try_begin / try_end block before (change_screen_mission)
2. try to comment out all logical conditions in try block and spawn npc no matter what first
 
Somebody said:
It's hardcoded for the player character. You could create a trigger to catch horse death events and degrade item modifiers, but the player can dismount and find another horse which won't match the original horse item in the inventory. There are triggers to catch dis/remounts too, but I can't remember testing them.
I thought I saw in one game if my horse became lame I could leave it in the inventory for a while and it would return to normal. Maybe I was playing a mod that added that or I made a mistake.
 
1. try put your try_begin / try_end block before (change_screen_mission)
2. try to comment out all logical conditions in try block and spawn npc no matter what first
For some reason I can't get NPC2 to spawn.  I can't get it to work.  I did these.  What am I doing wrong?

Code:
    [
      ("camp_trainer",
       [], "Speak with the innkeep.",
       [
         (set_visitor, 8, "trp_npc2"),
         (set_jump_mission, "mt_training_ground_trainer_talk"),
         (modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
         (reset_visitors),
         (set_jump_entry, 5),
         (jump_to_scene, "$g_training_ground_melee_training_scene"),
#      (try_begin),
#        (check_quest_active, "qst_learn_where_merchant_brother_is"),
#      (else_try),
#        (check_quest_active, "qst_save_relative_of_merchant"),
#        (neg|check_quest_succeeded, "qst_save_relative_of_merchant",)
#      (try_end),
         (change_screen_mission),
         (music_set_situation, 0),
         ]),
Edit:
Fixed.  Still doesn't work.  What am I doing wrong?
 
Anyone have any ideas on how to code certain objects in scenes (AKA Tanks, Jets, etc.)?
I need to code two tanks and two flying vehicles.

My second question is this: What is the psys code?
For example, I have exploding grenades, and they basically only burst into flames as of now.
I need to change that to a small explosion or something, but I don't know what psys is.
Is it a mesh? A Variable? A Texture?

Thanks for any help! :grin:
 
A particle system effect displays a bunch of meshes (usually planar) with various (color) blending and rotational effects around a position. It is defined in module_particle_systems.py, and uses a mesh reference (include one in your BRF file).

Lueii said:
Fixed.  Still doesn't work.  What am I doing wrong?
Look at the order of operations. You are trying to set a visitor before resetting the scene and modifying the visitors.
 
Specialist said:
Anyone have any ideas on how to code certain objects in scenes (AKA Tanks, Jets, etc.)?
I need to code two tanks and two flying vehicles.
If you aren't a long time veteran of MaB modding, forget it.
MadocComadrin said:
Could someone go into specifics about particle_system_emit? The search button is disabled at the moment.
particle_system_emit is usually used for particle systems that are emitted at a scene prop or item or something constantly. Copy the code from native stuff, or if you need it for items, I'd post the code, as there isn't a native example. For everything else you should use particle_system_burst.
 
Highlander said:
Specialist said:
Anyone have any ideas on how to code certain objects in scenes (AKA Tanks, Jets, etc.)?
I need to code two tanks and two flying vehicles.
If you aren't a long time veteran of MaB modding, forget it.
MadocComadrin said:
Could someone go into specifics about particle_system_emit? The search button is disabled at the moment.
particle_system_emit is usually used for particle systems that are emitted at a scene prop or item or something constantly. Copy the code from native stuff, or if you need it for items, I'd post the code, as there isn't a native example. For everything else you should use particle_system_burst.

I know, sadly I'm not.
I've heard that it is as hard as h***, but also that it is easier than pie.

I've modded other games (Talking HUGE mods).... But not MB or MB WB. :razz:

Still, is there a simple way to code the scene object? Anything basic would work, but if not I'll earn some xp in modding first.  :wink:

 
Highlander said:
particle_system_emit is usually used for particle systems that are emitted at a scene prop or item or something constantly. Copy the code from native stuff, or if you need it for items, I'd post the code, as there isn't a native example. For everything else you should use particle_system_burst.
What's the difference between particle_system_add_new+particle_system_emit and only particle_system_add_new?
 
Somebody said:
A particle system effect displays a bunch of meshes (usually planar) with various (color) blending and rotational effects around a position. It is defined in module_particle_systems.py, and uses a mesh reference (include one in your BRF file).

Lueii said:
Fixed.  Still doesn't work.  What am I doing wrong?
Look at the order of operations. You are trying to set a visitor before resetting the scene and modifying the visitors.

I wasn't getting results then either.  Are you not supposed to do it in Module_game_menus?
 
Question...
I get an error like this
errordetil.png
Whats wrong? I dont change process_items.py, even with SPACE
 
Status
Not open for further replies.
Back
Top Bottom