Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Ah... Apparently the new Module System fails to work out-of-box.

Has anyone else encountered this -- crashes with a 'clean' Module System? This is about as clean as it gets for me -- freshly downloaded, nothing modified, just with the path set to the new directory. This is trouble...

(Also, I've posted this over in Bug Reports. Perhaps that'll be a likelier place to find answers...)

(Edited to remove a rather ugly previous tone.)
 
Janus said:
It crashes.... OK, any further details? What message(s) does it give?

"Assertion Failed!

Program: <Mount and Blade>
File: e:\develop\mb\rgl\rglStream.h
Line: 599

Expression: buffer.has_more_tokens()"

This is the "classic" array-format problem; I'm sorry I didn't go into better detail previously, in terms of what was going on. (I am also beginning to get the feeling that the problem is something I did, as opposed to something with the Module System download. Just a hunch. :smile:)
 
Have you deleted the variables.txt from the target path, and is it using a clean copy of the Native folder as a basis for the extra files not created by the module system?
 
If I put this in header_operations.py:

Code:
try_for_heroes = try_for_range,":this_hero","trp_first_npc","trp_last_npc"

... will I then be able to use it like this:

Code:
(try_for_heroes),
#(try_for_range,":this_hero","trp_first_npc","trp_last_npc"),
    (main_party_has_troop, reg(3)),
    (store_troop_gold, reg(4), reg(3)),        
    (troop_remove_gold, reg(3), reg(4)),
    (val_add, reg(1), reg(4)),
(end_try,0),

I never messed with header_operations.py, so I don't know if there is potential to create a disaster.
 
Yes, with corrections. Look for the red text corrections below.

try_for_heroes = (try_for_range,":this_hero","trp_first_npc","trp_last_npc")

make sure the above is before the "scripts = [ ... " line.

(try_for_heroes),
#(try_for_range,":this_hero","trp_first_npc","trp_last_npc"),
    (main_party_has_troop, reg(3)),
    (store_troop_gold, reg(4), reg(3)),       
    (troop_remove_gold, reg(3), reg(4)),
    (val_add, reg(1), reg(4)),
(end_try,0),

 
So you mean to put the constant try_for_heroes in module_scripts.py instead of header_operations.py?

P.S. I gambled and tried it the way that I had it. It worked. Comes in handy for your Hero dialog expansion. :wink:
 
Janus said:
Have you deleted the variables.txt from the target path, and is it using a clean copy of the Native folder as a basis for the extra files not created by the module system?

No, I hadn't done either... and with your advice, it worked. Thanks a lot (and Fisheye, also, thanks) -- this is my first porting to a new M&B version (apart from the minor .73x to .75x one), and I hadn't known all of what I needed to do. I'll certainly remember this for the future, and I apologize once again for making such a nuisance of myself in the process of all this...

(Is this in a "Modmakers' FAQ" or something, though? It would seem like a question likely to come up often... though it'd also seem like a question people like me wouldn't think to check a FAQ for. :roll:)
 
Well, the variables.txt thing seems to be new (?) with the introduction of local variables, but that will presumably be part of the first post in the modsys docs once it gets updated to reflect that little detail. The rest is all there.

I did the same thing myself, though.  I just figured it out 'cause of always being the kid who actually reads the manual when he gets stuck.
 
Alright, I have searched, I have search in this topic also, please someone respond and tell me how to (using the in-game editor) edit the terrain and texture in the scenes? I can't seem to select anything or change anything.

Please give me a hand, all I want is the to make a flat map.

Edit: Me, being a douche, did not realise that you generate the texture then take the code and change it in the modsys.
 
Is there any way for a script called by an item (either on ti_on_init_item or ti_on_weapon_attack) to know either (a) which troop is wielding the item, or (b) what the position of the item is?

All I want to do is to find out which weapons the player wielded during a fight...
 
Untested possbility: item triggered ti_on_weapon_attack -> get_triggered_object_position -> iterate through all agents to find agent closest to position -> agent_get_troop_type (or get_player_agent).

Does ti_on_weapon_attack work for melee now? As far as I know (v0.7xx), it doesn't. So the above only works for missile weapons. Not a good solution.

Are you trying to improve the power_* skills by practice?

Much easier option: crank weapon master to 10, check if proficiencies increase. If yes, also have some random chance of increasing the relevant skill.
 
Indeed a better option.  Don't even have to crank weapon master skill; I want the power_* skills to increase roughly proportional to the relevant weapon proficiencies.  Thanks.

Hadn't noticed (get_triggered_object_position), though.  That may yet come in handy if we do end up doing potions in combat.
 
Hellequin said:
Hadn't noticed (get_triggered_object_position), though.  That may yet come in handy if we do end up doing potions in combat.

Haven't tested it. There's a chance it might work only for scene props.

In that case using position_translate_to_parent on (0,0,0) might be used to convert item positions to global positions... if that's how it works. Don't know.

EDIT: After some quick tests, here are my findings:

get_triggered_object_position doesn't work for equipped items, it's for scene props.

(position_transform_to_local, dest, reference-position, input-position): Transforms input-position to relative coordinates making reference-position as the origin.

(position_transform_to_parent, dest, reference-position, input-position): Reverse of the above

None of them can be used to figure out the global position of the triggered item.

However you can now specify very detailed relative coordinates to the player (or any agent, scene prop, or entry point). For example, ten feet forward and 5 feet to the left of the player. So very detailed formations are now possible; as are things like area effect spells that affect everything in a certain shape relative to the player.
 
Hmm. You know what? Mods don't show up in my list. I've seen it commented on in the forums, I'm sure of it, but searching yielded no results. Can someone link me to the fix?
 
Got all that working, but I have the problem that I get an error message whenever I try to run the module -

Unable to open file Textures\champion_horse.dds_0.dds


At first glance it looks like a screwed filepath. However, I can't find any problems with any filepaths.
 
You have to make sure all your materials are direct copies of a 080x material.

The 075x materials are messed up when you run it in 0.80x

I had to manually redo all the materials, (import a fresh .80x one, rename the stuff and clone it for the next material) but BRFedit might have been updated to fix it or something. Not to sure though, didn't check.
 
Status
Not open for further replies.
Back
Top Bottom