Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
HokieBT said:
no clue, never used it, but it is used for the players inventory, so I assume it works that way so check it out.

It should work. I've never taken apart a random-scene in edit mode, but I'm pretty sure it just looks at your entry point and places it somewhere near it.
 
1. Is there a short-cut to find which prisoners have been sold through change_screen_trade_prisoners?
I suppose they may be stored in p_temp_party or something like it, but maybe somebody already have found out with it.
Actually change_screen_trade_prisoners clears and puts just sold prisoners into p_temp_party. 
2. I found on the forum usage  (change_screen_trade_prisoners, "p_temp_party") for one of the older versions, but did not catch how it is supposed to work. Is it still usable in 1.01?
3. Is warning in module_items.py that first 95 items are hardcoded actually essential? They number have been changed from 60 since .960 it is very oddly for hardcoded things.
 
Aw, sokf_place_at_origin doesn't seem to work. It seems to just initialize the scene prop to the origin only if an instance of that scene prop has already been placed at the scene. So I guess my question still stands - is there an easy way to place an instance of a particular scene prop in every scene, or to do it dynamically for the current scene?
 
Is there a way to enable rebellions? I mean If a Lord/the player has low relation to a town/village, the farmers may uprise... And either declare as their lord the faction claimant, and the rebellion to start, or to be lordless rebels. Please if anybody knows that just send me a pm or reply here. I want the hand-code if possible, since I do everything manually... Pleaseeeee!!!!!!!!!!  :razz:
 
Is it possible to change the chance of a horse dying or becoming lame when it falls in battle?  And if so which file is it in?
 
Having a problem with adding legs, I've never had to add anything to do with foot_armor from scratch before, tried searching and tried the documentation but can't find out what I'm doing wrong, here's a pic of the problem :-

http://i303.photobucket.com/albums/nn133/Britain1299/Other/mb11.jpg

I'm aware that I may have to rotate the leg but have no idea how to get it so both leg models show up as one. If anyone could enlighten me I'd be very grateful.

The code atm -

Code:
["caligae", "Caligae", [("caligaeL",0)], itp_merchandise| itp_type_foot_armor| itp_attach_armature ,0, 50 ,
   weight(1)|head_armor(0)|body_armor(0)|leg_armor(3)|difficulty(0) ,imodbits_armor ],

Added itp_attach_armature after reading it somewhere in the brf topic, no luck though.
 
How would I fix this error when starting a new game?
Code:
WARNING: UNABLE TO MAP GAME PRESENTATION CODE:  prsnt_game_start 
 WARNING: UNABLE TO MAP GAME PRESENTATION CODE:  prsnt_game_escape 
 WARNING: UNABLE TO MAP GAME SCRIPT CODE:  game_check_party_sees_party 
 WARNING: UNABLE TO MAP GAME SCRIPT CODE:  game_get_party_speed_multiplier
Fixed
 
Anyone see what's wrong here:
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 65, in <module>
    write_items(variables,variable_uses,tag_uses,quick_strings)
  File "process_items.py", line 30, in write_items
    ofile.write(" %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\n"%(item[3]
, item[4], item[5], item[7],
IndexError: list index out of range
Exporting scene data...

But the "process_items.py" is completely unchanged. I simply don't know what's wrong, and that really sucks, because I want to give it a test run.

import string

from process_common import *
from module_items import *

def get_item_code(item):
  prefix = "it_"
  code = prefix + item[0]
  return code

def save_python_header():
  file = open("./ID_items.py","w")
  for i_item in xrange(len(items)):
    file.write("itm_%s = %d\n"%(convert_to_identifier(items[i_item][0]),i_item))
  file.close()

def write_items(variable_list,variable_uses,tag_uses,quick_strings):
  itemkinds_file_name = export_dir + "item_kinds1.txt"
  ofile = open(itemkinds_file_name,"w")
  ofile.write("itemsfile version 2\n")
  ofile.write("%d\n"%len(items))
  for item in items:
    if (item[3] & itp_merchandise) > 0:
      id_no = find_object(items,convert_to_identifier(item[0]))
      add_tag_use(tag_uses,tag_item,id_no)
    ofile.write(" itm_%s %s %s %d "%(convert_to_identifier(item[0]),replace_spaces(item[1]),replace_spaces(item[1]),len(item[2])))
    item_variations = item[2]
    for item_variation in item_variations:
      ofile.write(" %s %d "%(item_variation[0],item_variation[1]))
    ofile.write(" %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\n"%(item[3], item[4], item[5], item[7],
                                                  get_weight(item[6]),
                                                  get_abundance(item[6]),                 
                                                  get_head_armor(item[6]),
                                                  get_body_armor(item[6]),
                                                  get_leg_armor(item[6]),
                                                  get_difficulty(item[6]),
                                                  get_hit_points(item[6]),
                                                  get_speed_rating(item[6]),
                                                  get_missile_speed(item[6]),
                                                  get_weapon_length(item[6]),
                                                  get_max_ammo(item[6]),
                                                  get_thrust_damage(item[6]),
                                                  get_swing_damage(item[6]),
                                                              ))
    trigger_list = []
    if (len(item) > :cool::
      trigger_list = item[8]
    save_simple_triggers(ofile,trigger_list, variable_list,variable_uses,tag_uses,quick_strings)


  ofile.close()

print "Exporting item data..."
save_python_header()

from module_info import *

from process_common import *
from process_operations import *

variable_uses = []
variables = load_variables(export_dir,variable_uses)
tag_uses = load_tag_uses(export_dir)
quick_strings = load_quick_strings(export_dir)
write_items(variables,variable_uses,tag_uses,quick_strings)
save_variables(export_dir,variables,variable_uses)
save_tag_uses(export_dir,tag_uses)
save_quick_strings(export_dir,quick_strings)
#print "Finished with Items."
 
@ FrisianDude I had the same problem a few days ago, I just re-done the most recent additions to module_items.py and it was sorted. Double check to make sure none of the recently added codes are incorrect or re-do them and it should be fixed.
 
I'm at a loss, I can't figure out how banners that are used on the world map work...  Some banners are square, some are rectangular, some have forked edges, etc.  The mesh for them all appears to be the same in the BRF file, I can't find them being modified as a scene prop, etc?  If I just wanted to switch it so that all banners on the world map were displayed as the vertical rectangle (ie. banner #3) how would I do that?
 
What did I do wrong in this code?
Code:
"Halberd_4",        "Halberd_4", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear,
 438 , weight(7.5)|difficulty(4)|spd_rtng(94) | weapon_length(99)|swing_damage(24 , cut) | thrust_damage(28 , pierce),imodbits_polearm ],
It's from module_items.py
 
I'm working on a slave market menu and scripts, so you can sell lots of prisoners easily in a town menu.  I am getting this error:
SCRIPT ERROR ON OPCODE -2147482141:  Invalid Troop ID: -1; LINE NO: 3:
At script: party_remove_slaves_some
At script: party_remove_slaves_some
At script: party_remove_slaves_some


Here are some screenshots of the menu.  Before I click, and after I click:
http://img152.imageshack.us/img152/9512/88731224rp5.png

Here is the script to remove slaves, with line 3 bold.
  #script_party_remove_slaves_all:
  # Called at the slave market to remove all prisoners who can be sold as slaves
  ("party_remove_slaves_all",
    [
    (party_get_num_prisoner_stacks, ":num_stacks","p_main_party"),
    (try_for_range, ":stack_no", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id,":slave_troop","p_main_party",":stack_no"),
        (neg|troop_is_hero, ":slave_troop"),
        (party_prisoner_stack_get_size,":stack_size","p_main_party",":stack_no"),
        (party_remove_prisoners, "p_main_party", ":slave_troop", ":stack_size"),
    (try_end),
]),

Here is the menu that triggers the problem:
  (
    "slave_market",0,
    "You visit the slave market.  The current market price of slaves here is {reg1} denars.  {s15}",
    "none",
    [
  (party_get_slot,":cur_slave_price","$current_town",slot_town_slave_price),
  (assign, reg1,":cur_slave_price"),
      (call_script, "script_get_num_slaves_all"),
      (call_script, "script_get_num_slaves_some"),
  (assign, reg2, "$num_slaves_all"),
  (store_sub, reg3, "$num_slaves_all","$num_slaves_some"),
  (try_begin),
  (gt,"$num_slaves_all",0),
  (eq,reg3,0),
  (str_store_string, s15, "@You have {reg2} prisoners total who can be sold."),
  (else_try),
  (gt,"$num_slaves_all",0),
  (eq,reg3,"$num_slaves_all"),
  (str_store_string, s15, "@You have {reg2} prisoners total who can be sold, but all of them would be worth more ransomed."),
  (else_try),
  (gt,"$num_slaves_all",0),
  (gt,"$num_slaves_some",0),
  (str_store_string, s15, "@You have {reg2} prisoners total who can be sold.  {reg3} of them would be worth more ransomed than sold as slaves."),
  (else_try),
  (eq,"$num_slaves_all",0),
  (str_store_string, s15, "@You have no prisoners who could be sold as slaves."),
  (try_end),
],
    [
      ("sell_all_slaves",
  [
(party_get_slot,":cur_slave_price","$current_town",slot_town_slave_price),
(call_script, "script_get_num_slaves_all"),
(store_mul, reg4, "$num_slaves_all", ":cur_slave_price"),
(str_store_string, s17, "@Sell all prisoners for {reg4} denars."),
  ],"{s17}",
      [
(troop_add_gold,"trp_player",reg4),
(call_script, "script_party_remove_slaves_all"),
        ]
      ),

      ("sell_some_slaves",
  [
(party_get_slot,":cur_slave_price","$current_town",slot_town_slave_price),
(call_script, "script_get_num_slaves_some"),
(store_mul, reg5, "$num_slaves_some", ":cur_slave_price"),
(str_store_string, s18, "@Sell only lower class prisoners for a total of {reg5} denars."),
  ],"{s18}",
      [
(troop_add_gold,"trp_player",reg5),
(call_script, "script_party_remove_slaves_some"),
        ]
      ),
      ("back_to_town_menu",[],"Head back.",
      [
          (jump_to_menu,"mnu_town"),
        ]),
      ]),

So I've been trying to find a problem with this code for the past hour or so... and I can't.  I've never worked with "party_prisoner_stack_get_troop_id" before, and that's what's returning the wrong troop id it seems. 

If you have any idea what might be wrong, please speak.  :smile:
 
I added one troop to a new mod, I try to run my mod, start new game, and the computer freezes on Initializing game, i can't get it to respond, so i had to restart it manually via sleep mode.. tried again and same result....

i have an HP computer but i dont think that would really make a difference

Please help  :sad:
 
EDIT:Already found it myself, thanks either way.

I'm actually trying to allow the player to become king, I'm going quite fine.
 
edarsenik, type of faces are defined in module_skins. To get undeads back you should uncomment and fill a undead's skin. After that you'll be able to use tf_undead flag for troops.
To make look undeads nice in game you should fix textures for undeads. I don't remember exactly  but some of them  are wrong or absent.
 
Status
Not open for further replies.
Back
Top Bottom