Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
sir Gulos said:
what does get_angle_between_positions do? I originally though that it gives you the angle between the 2 using the origin point as vertex... But that seems to not be true... so how does it measure the angle? as you need at least 3 points to form an angle...

This is my understanding from toying with the command for a goodly amount of time, while trying ot use it in my skirmish code...though I'd happily be corrected as I don't want to be spreading false information.

I believe the angle is measured as follows:
measureangle.gif

I'm not sure if the rotations of the positions are taken into account or if they are automatically normalized relative to the X-Y/the origin as they are in the diagram.

At the very least I am more certain of its functionality: when having an agent in pos1 and the nearest enemy agent at pos2, then calling get_angle_between_positions, pos1, pos2 and taking the returned value and adding 180 degrees to it, you'll have the first agent moving in the opposite direction from the nearest enemy agent.


 
I kinda need some help here. I'm pretty new to the module system when it come to more in-depth things, and I was wondering if it's possible to make a companion hero spawn in a town and stay in that town until you recruit them. It's getting pretty tiresome having to go around the map looking for my new hero npc everytime I have to test some changes.

I'm also wondering if it's possible to have the npc start in your party form the very beginning. Or in some way tie my companion npc into the starting tutorial.
 
Stus67 said:
I was wondering if it's possible to make a companion hero spawn in a town and stay in that town until you recruit them.
I'm also wondering if it's possible to have the npc start in your party form the very beginning.
Or in some way tie my companion npc into the starting tutorial.
All 3 things are possible and less or more easy.
1.
Search script update_companion_candidates_in_taverns in module_scripts and overwrite randomization behavior.
E.g.
after
(store_random_in_range, ":town_no", towns_begin, towns_end),
insert
(try_begin),
    (eq,":troop_no","trp_neo_npc"),
    (assign,":town_no","p_town_1"), #bind to Sargoth
(try_end),
Remember, there are limited amount of spawn points in taverns. So if occasionally a lot of npc visit town at the same time, not all them spawn in a tavern.

2.
In module_party add your npc to main_party, that is to change
("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0)]),
onto
("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0),(trp_neo_npc,1,0)]),

3. it depends on which way you want to tie.
 
Rongar said:
Stus67 said:
I was wondering if it's possible to make a companion hero spawn in a town and stay in that town until you recruit them.
I'm also wondering if it's possible to have the npc start in your party form the very beginning.
Or in some way tie my companion npc into the starting tutorial.
All 3 things are possible and less or more easy.
1.
Search script update_companion_candidates_in_taverns in module_scripts and overwrite randomization behavior.
E.g.
after
(store_random_in_range, ":town_no", towns_begin, towns_end),
insert
(try_begin),
    (eq,":troop_no","trp_neo_npc"),
    (assign,":town_no","p_town_1"), #bind to Sargoth
(try_end),
Remember, there are limited amount of spawn points in taverns. So if occasionally a lot of npc visit town at the same time, not all them spawn in a tavern.

2.
In module_party add your npc to main_party, that is to change
("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0)]),
onto
("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0),(trp_neo_npc,1,0)]),

3. it depends on which way you want to tie.

Thanks for the help. I couldn't get the first one to work, but the second one worked like a charm. As for the third one, idunno, I'm not entirely sure yet. I want to make a somewhat story based mod that's centered around this hero npc I'm making, and instead of the normal intro tutorial it'll be a quest that introduces you to the hero npc and puts you and him/her into this big story that you'll play through.
 
Simple question. How can I make custom ammo pouch wich will showup when I carry some ammo? And is it possible to make a custom ammo pouch for any weapon that you would pick?
 
mr.master said:
Simple question. How can I make custom ammo pouch wich will showup when I carry some ammo? And is it possible to make a custom ammo pouch for any weapon that you would pick?

I'm pretty sure it's the same way arrow quivers work. I don't know if you can make it work for weapons though.

I also have a question though if anyone can answer it. Is it possible to have a single major faction in the game rather than multiple ones? If so how stable would it be? I ask this because I don't want to go through all the faction related code and bring down the axe on anything if my single faction is just going to freak out when it has nobody to go to war with.
 
I hate to follow up my own post with another question, but this just struck me. Would it be possible to have a quest NPC that later becomes a NPC that can be recruited? Say you encounter him/her during a quest and after that quest is finished you have the option to recruit them into your party. Would I need to make two NPCs, a quest NPC and then an identical hero NPC, or can it all be tied to a single one?
 
Stus67 said:
I hate to follow up my own post with another question, but this just struck me. Would it be possible to have a quest NPC that later becomes a NPC that can be recruited? Say you encounter him/her during a quest and after that quest is finished you have the option to recruit them into your party. Would I need to make two NPCs, a quest NPC and then an identical hero NPC, or can it all be tied to a single one?
It can be tied to a single one. Just make sure you remove them from whatever scene they're in when you recruit them.
 
Pinkys problem: OpenBRF has started looking for textures in some place with this file path: C:/Users/Kai/AppData/Local/VirtualStore/Program Files/Mount&Blade Warband/CommonRes/textures.brf. How do I set it back to look for textures in C:/Program Files/Mount and Blade Warband/Textures?
 
I'm having some dialog problems. I have my player talking to my new hero and it's been working fine after a couple of lines, but then I tried to add a third party into the conversation. After I added his dialog and tested it out in-game my player's lines and hero's lines work fine but the conversation freezes just when the third character is introduced. Here's the code just before it stops,

[anyone, "treasa_enc_7", [], "Do you think I'm playi- Wait, Shh, Shut up. Did you hear that?", "treasa_enc_8", []],

[anyone|plyr, "treasa_enc_8", [], "Hear what?", "treasa_enc_9", []],
In-game the conversation freezes right here, just before Rio's line.
[trp_assassinrio, "treasa_enc_9", [], "Well, well. You have sharp ears miss. I was hoping to get the upper hand while you argued with your friend over there, but no matter, I brought backup just for this.", "treasa_enc_10", []],

[anyone|plyr, "treasa_enc_10", [], "Oh god dammit things just keep getting worse..", "treasa_enc_11", []],

[trp_treasa, "treasa_enc_11", [], "****! Thanks to your stupid ass I've been spotted! Now don't just stand there, help me!", "close_window", []],

Can anybody help me here? It's probably something obvious to a experienced coder, but for me just doing that was nearly impossible.
 
Queen Pinky said:
Pinkys problem: OpenBRF has started looking for textures in some place with this file path: C:/Users/Kai/AppData/Local/VirtualStore/Program Files/Mount&Blade Warband/CommonRes/textures.brf. How do I set it back to look for textures in C:/Program Files/Mount and Blade Warband/Textures?

Managed to fix it. Just deleted that folder and it reset
 
You could edit the savegame:razz: Well, it clearly can be done, but I don't know single player stuff anymore:grin:
Question of my own: is it possible to make new console commands for the dedicated server? I see that the module system actually has a script, but it gets as input an int (id) not a string with the command itself (probably because it can't compare stings lol)... So where are the commands actually handled? (please don't say hardcoded lol)
 
sir Gulos said:
You could edit the savegame:razz:
how do again and is there a code page or something like that and also how do you create your own pages. like at the bottom of your screen camp inventory etc. or in one of these scripts like a new page in camp with extra buttons :?:
 
Stus67 said:
I'm having some dialog problems. I have my player talking to my new hero and it's been working fine after a couple of lines, but then I tried to add a third party into the conversation. After I added his dialog and tested it out in-game my player's lines and hero's lines work fine but the conversation freezes just when the third character is introduced. Here's the code just before it stops,

[anyone, "treasa_enc_7", [], "Do you think I'm playi- Wait, Shh, Shut up. Did you hear that?", "treasa_enc_8", []],

[anyone|plyr, "treasa_enc_8", [], "Hear what?", "treasa_enc_9", []],
In-game the conversation freezes right here, just before Rio's line.
[trp_assassinrio, "treasa_enc_9", [], "Well, well. You have sharp ears miss. I was hoping to get the upper hand while you argued with your friend over there, but no matter, I brought backup just for this.", "treasa_enc_10", []],

[anyone|plyr, "treasa_enc_10", [], "Oh god dammit things just keep getting worse..", "treasa_enc_11", []],

[trp_treasa, "treasa_enc_11", [], "****! Thanks to your stupid ass I've been spotted! Now don't just stand there, help me!", "close_window", []],

Can anybody help me here? It's probably something obvious to a experienced coder, but for me just doing that was nearly impossible.
you cant use anyone definition together with troop IDs. And you didnt even defined who is that anyone guy
 
Is there a scripting method available to increase(/decrease?) collision between npc troops.
Meaning that they will not "merge" together, but that they each keep realistic distances from each other.


A second question, is it possible to make 1 troop (say Swadian Knight) to count as 2 troops in your party (size) and for morale (penalty)?
 
Wow-im-here said:
sir Gulos said:
You could edit the savegame:razz:
how do again and is there a code page or something like that and also how do you create your own pages. like at the bottom of your screen camp inventory etc. or in one of these scripts like a new page in camp with extra buttons :?:
You can't edit the save games.
To make new "pages", called "menus", look in "module_game_menus.py". Learn the ModuleSystem, make a search for renown, and you'll get it.

sir Gulos said:
Question of my own: is it possible to make new console commands for the dedicated server? I see that the module system actually has a script, but it gets as input an int (id) not a string with the command itself (probably because it can't compare stings lol)... So where are the commands actually handled? (please don't say hardcoded lol)
If it gets an input ID (I haven't modded Warband), then somewhere the strings must be stored. Look around the header_ or ID_ files, or even maybe module_strings. Else it's "hardcoded lol".
 
In need of help here. Basically, I have a automatic fire code for my submachine guns. I want them all to have their own fire rates and the only way to change the fire rates is by changing the trigger call interval. My question is that is possible to set it so that it checks which weapon you have, and if it's a specific weapon which is defined, it will set this fire rate, again, if its something else, it's sets this etc. So, could this be done and how would it be done? Any examples and help would be appreciated since I kinda need to do this : P
 
Alrighty, thanks (: I have encountered a little problem on other stuff. Basically, I made it so that every submachine gun has it's own sounds obviously. Since it's the automatic fire code, it had to be done a bit differently. The problem is that the sound doesn't always play. I mean I shoot, nothing, switch weapons or shoot another weapon and switch back, sound works. But that doesn't always work for it. Any help would be appreciated.

Code:
			(val_add, ":agent_list", 1),
		(try_end),
		(try_begin),
		        (agent_has_item_equipped,":agent","itm_suomikp"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_suomikp_lyhyt"),
		(else_try),
		        (agent_has_item_equipped,":agent","itm_saloranta"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_saloranta_lyhyt"),
		(else_try),
		        (agent_has_item_equipped,":agent","itm_ppsh"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_ppsh_lyhyt"),
		(else_try),
		        (agent_has_item_equipped,":agent","itm_dp27"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_saloranta_lyhyt"),
		(else_try),
		        (agent_has_item_equipped,":agent","itm_peltiheikki"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_peltiheikki_lyhyt"),
		(else_try),
		        (agent_has_item_equipped,":agent","itm_ppsh_42"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_peltiheikki_lyhyt"),
		(else_try),
		        (agent_has_item_equipped,":agent","itm_mp40"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_mp40"),
		(else_try),
		        (agent_has_item_equipped,":agent","itm_stg44"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_peltiheikki_lyhyt"),
		(else_try),
		        (agent_has_item_equipped,":agent","itm_mg42"),
                (multiplayer_send_int_to_server,multiplayer_event_sound_at_player,"snd_mg42"),
		(try_end),
 
Status
Not open for further replies.
Back
Top Bottom