Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Why aren't you checking out the source of Rigale, the mod? Where the codes of "Fog of War" lies...
 
Slots do nothing. You should set the party flag.
Code:
(0,
 [(map_free),
  (try_for_range,":cur_icon","p_sietch_village_tabr_1","p_salt_mine"), #go through my own villages I have added after the Native ones
        (store_distance_to_party_from_party,":cur_dist","p_main_party",":cur_icon"), #get the distance between the player party and the village
        (lt,":cur_dist",50), #I guess this must be an if condition, so if current distance is smaller then the minimum distance it  runs next line
        (party_set_flags,":cur_icon",pf_always_visible,1), #this should put the pf_always_visible flag in my previously undiscovered village making it visible for all eternity
  (try_end),]),
 
So hi, i have a question about something new i spotted in "morghs Wfas" editor, when editing a item, it displays a "hitpoints" for weapons and such,
So what does it mean?

values.png
 
TheLordAidan said:
Is there a way to make an item (in this case ammo) invisible in a scene, but still have an image in your inventory?

m use an invisible mesh for the item and use this to give an inv. mesh ("mesh name", ixmesh_inventory)]
 
dunde said:
Slots do nothing. You should set the party flag.
Code:
(0,
 [(map_free),
  (try_for_range,":cur_icon","p_sietch_village_tabr_1","p_salt_mine"), #go through my own villages I have added after the Native ones
        (store_distance_to_party_from_party,":cur_dist","p_main_party",":cur_icon"), #get the distance between the player party and the village
        (lt,":cur_dist",50), #I guess this must be an if condition, so if current distance is smaller then the minimum distance it  runs next line
        (party_set_flags,":cur_icon",pf_always_visible,1), #this should put the pf_always_visible flag in my previously undiscovered village making it visible for all eternity
  (try_end),]),

Thanks, I'll try it out today after work.

Belendor said:
Why aren't you checking out the source of Rigale, the mod? Where the codes of "Fog of War" lies...

Ikaguia said:
or floris mod pack
I think it's the same code, so nevermind

Thanks guys, I'll look for those mods. Maybe they'll have more goodies I could use.
 
MadVader said:
TheLordAidan said:
I'm trying to make it so certain factions won't declare war on each other. Does anyone know if this is possible, and if so, where is the script that governs it?
In the script "randomly_start_war_peace_new", insert some lines like this (the example is about Swadia and Vaegirs):

    (try_for_range, ":cur_kingdom", "fac_kingdom_1", kingdoms_end),
        (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
 
(try_for_range, ":cur_kingdom_2", kingdoms_begin, kingdoms_end),
(neq, ":cur_kingdom", ":cur_kingdom_2"),
(assign, ":dont_start_wars", 0),
(try_begin),
  (eq, ":cur_kingdom", "fac_kingdom_1"),
  (eq, ":cur_kingdom_2", "fac_kingdom_2"),
  (assign, ":dont_start_wars", 1),
(else_try),
  (eq, ":cur_kingdom", "fac_kingdom_2"),
  (eq, ":cur_kingdom_2", "fac_kingdom_1"),
  (assign, ":dont_start_wars", 1),
(try_end),
(eq, ":dont_start_wars", 0),

(faction_slot_eq, ":cur_kingdom_2", slot_faction_state, sfs_active),

Hey, MadVader, on the module build I get "Error: Usage of Unassigned Local Variable: cur_kingdom_2. I also get some errors in game, which I'm guessing is when one of the factions in the script tries to declare war on the other.

Edit: New problem! I was editing multiplayer troops, and giving them some custom items. However, the build module said none of the custom item_[item]s existed. Is this because it was done in items.txt instead of module_items?
 
I started this thread (linked here) back in August of last year.  I was hoping to get some kind of editor to let me reassign fiefs and strengthen (and maybe weaken) parties or garrisons as a means of balancing factions when one or two just get a lot of bad luck.  The response appeared to be that it's doable via in-game menus and I was encouraged to try and do this myself.  A year later, I'm as lost as ever.  (In my defense, it was an on-again-off-again effort between a full time job and other real life matters.)  I've tried going through some tutorials and explanations, but I can't really make enough sense of it.

Best way I can describe it is like trying to learn a new language without really learning what you're actually saying.  It's as if I need to learn some Spanish and I get told "Where is the library?" translates into "¿Dónde está la biblioteca?"  Okay I know how to say that one thing, but I don't know that "dónde" means "where," or how I use it outside of that context.

I don't know if that's a perfect example, but that's basically it.  I can see what the lines of code mean.  I just can't use the code outside of that, or more specifically to make it do what I need it to do (or say what I need to say).  Ultimately I want to include an option to go back to the camp menu anyway, so I may as well include the current incarnation of what I am attempting to do.

First, I tried to put in an option that would bring up a menu to reassign fiefs:
Code:
      ("action_assign_fief",[],"Reassign fiefs.",
       [(jump_to_menu, "mnu_fief_assignment"),
I don't think there was any issue there, or at least it never told me that an error existed there.

Next I attempted to make that very basic menu, with only the option to go back to the camp menu:
Code:
  ("fief_assignment",0,
   "This is where you will assign fiefs.\
 At least once you know what you're doing....",
   "none",
    [
      ("camp_action_4",[],"Back to camp menu.",
       [(jump_to_menu, "mnu_camp"),
        ]
       ),
    ]
  ),
This is where I constantly run into problems.  First time I did it I had an extra parenthesis, so that was easy to fix.  Ever since then I got an "Error in game menu" message.  Specifically:
Code:
Error in game menu:
('fief_assignment', 0, "This is where you will assign fiefs. At least once you k
now what you're doing....", 'none', [('camp_action_4', [], 'Back to camp menu.',
 [(2060, 'mnu_camp')])])
I added that "none" because I saw it in most other menus and thought maybe I needed it.  I have no idea what the "2060" means.  All the advice on the forums seems to say check for superfluous punctuation.  I tried checking for any more lone parentheses, brackets, or quotes and didn't notice any.  I wondered if I were missing a comma or had too many but it seems to fit in the format with the other menus.  Hopefully someone can help me see the error that I clearly cannot.  If I can't recognize what the problem is then I figure I'm likely not going to succeed at making a menu that does what I want it to do.
 
I've added quite a few custom weapons, and they work fine, my only problem is that they only VERY rarely show up in shops, some don't show up at all.  They have abundance set at 100 and I can't think of any other reason for this.  The custom armor are showing up fine but the weapons are very rare.
 
RobSmith176 said:
Next I attempted to make that very basic menu, with only the option to go back to the camp menu:
The menu itself has a code execution block, followed by the list of menu options. Insert an extra [], after "none",
Artyem said:
I've added quite a few custom weapons, and they work fine, my only problem is that they only VERY rarely show up in shops, some don't show up at all.  They have abundance set at 100 and I can't think of any other reason for this.  The custom armor are showing up fine but the weapons are very rare.
Maybe because there are way more weapons of that type with high abundance? You should restrict factions to make them more likely to appear when you're looking for them. Otherwise you can manually add them from within the merchant restock script.
 
Hello there,
I've been looking everywhere for help on this. I even PM'd Vincenzo himself.
I'm okay at coding, but this area is completely new to me, so you'll have to go right back to basics.
I want to know how I can make a class selection menu, for a multiplayer mod.
Any help on the subject will be really appreciated, I'm losing the will to live on this.
 
Dawiduh said:
In order to do that I need to compare distances, and the only distance-comparing piece of code I know is the one in module_scripts assigning villages to the nearest town.
This gets called only once at game_start, so you're better off using something else. You could use it for the things I say below, but why stick it into some random code blck when you can put it at the start of game_start? :smile:
Just remove the pf_always_visible from your party's flags at game_start, or from its party definition. I'd use game_start though.
That way you will be able to automatically "discover" the party when you get near it, and dunde's code will make it stay visible.
Of course, in order for his code to work properly, set the party to pf_disabled too at game_start.
 
A question.

Does anyone know how to extract player's party target position on world map?

When player is moving to another party, it's simple and can be retrieved with get_party_ai_current_behavior / get_party_ai_current_object. However party_get_ai_target_position operation does not seem to work on player's party at all (unless I'm doing something wrong).

Code:
	(0,
		[
			(map_free),
			(key_clicked, key_m),
			(set_fixed_point_multiplier, 1000),
			(party_get_ai_target_position, pos60, "p_main_party"),
			(position_get_x, reg10, pos60),
			(position_get_y, reg11, pos60),
			(get_party_ai_current_behavior, reg2, "p_main_party"),
			(get_party_ai_current_object, reg3, "p_main_party"),
			(set_fixed_point_multiplier, 1),
			(display_message, "@{!}Cur bhvr {reg2}, cur obj {reg3}, target pos ({reg10},{reg11})"),
		]
	),

To put it short, I want to retrieve the world coordinates where player has clicked his mouse before player's party gets there.

UPD: apparently position_get_screen_projection does not work on global map, so it's impossible to locate the position even through triangulation.
 
Jarvisimo said:
Hello there,
I've been looking everywhere for help on this. I even PM'd Vincenzo himself.
I'm okay at coding, but this area is completely new to me, so you'll have to go right back to basics.
I want to know how I can make a class selection menu, for a multiplayer mod.
Any help on the subject will be really appreciated, I'm losing the will to live on this.
It's a presentation. See how the Native presentations are set up, or look at other presentations from mods that you enjoy...and make a presentation.

Presentations, the supporting scripts, etc, can be some of the most complex systems to create, however, getting things to display correctly and then accept and record input from the player.
 
xPearse said:
Has anyone ever got glass to work properly because I have tried everything and it never turns out the way I want it to be, it may be because the face that I don't know but it could be that it's not possible in mount and blade. It always turns out like this.



See it doesn't appear properly ingame so can anyone help me out on this.

I know im probably not going to get an answer for this but can anyone help me out, if this isn't possible then people tell me so and then I'll just work with what I can do for it.
 
Status
Not open for further replies.
Back
Top Bottom