Author Topic: Ask Winter  (Read 51757 times)

Inukshuk

  • Guest
Re: Ask Winter
« Reply #30 on: October 25, 2007, 12:23:28 PM »
I'm afriad you are probobably wrong there. I must stress again that I do not need to alter any files in the module system for the error to arise. There isn't a lot of "Rubbish" on that thread, and by reading it you can gain a much better picture of the trouble we are having.
« Last Edit: October 25, 2007, 12:26:44 PM by Inukshuk »

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Ask Winter
« Reply #31 on: October 25, 2007, 01:13:50 PM »
Sorry, when I said "rubbish" I meant "a large amount of useful information". Didn't mean to be dismissive.

Inukshuk

  • Guest
Re: Ask Winter
« Reply #32 on: October 26, 2007, 02:21:41 AM »
 :lol: I'll give you the benefit of the doubt there.

What I might try and do is look for other people who have this problem, and get them to look at their build_module.bat files. Apparently, even though I'm following the download link for version 0.894, I seem to be getting a previous version of this file. Wierd... ???

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Ask Winter
« Reply #33 on: October 26, 2007, 03:03:03 AM »
:lol: I'll give you the benefit of the doubt there.

What I might try and do is look for other people who have this problem, and get them to look at their build_module.bat files. Apparently, even though I'm following the download link for version 0.894, I seem to be getting a previous version of this file. Wierd... ???

Negative ... my last post on the other thread ... the build_module.bat file was changed between .892 and .894 - the advice I gave you was out of date (or, more specifically, valid for .892 but not for .894).  Your file should be fine if used over a clean install of .894.  (Do not use the .894 module system over any older versions - that will crash, due to changes in the module.ini file.)

The problem must be somewhere else.

Inukshuk

  • Guest
Re: Ask Winter
« Reply #34 on: October 26, 2007, 05:11:13 AM »
Grrr. I'm gonna do waht grail knight says and compile on my bros pc. I think it could well be something to do with my spec, which would explain why not everyone is having the problem. Not getting my hopes up though.

grailknighthero

  • Guest
Re: Ask Winter
« Reply #35 on: December 01, 2007, 04:47:19 PM »
This is going to sound stupid and it is stupid.  Here is my problem:
This problem has been around since .89x.  I was trying to script in village rebellions and I had it so a party of peasants was spawned and traveled to the player to attack the player.  Once I got this in(but I hadnt got them to attack the player yet, they just traveled to the player and the disappeared) I decided to change it so a battle would happen inside the player's village when the player entered it.  So I commented out the previous code that has the party of peasants travel to the player.....But it still happened.  So I deleted the commented out code from the module system.  And it still happened except the party was somehow changed to the village farmer party.  I was hoping when I updated my version to .901 it would stop, except it hasnt, and it now happens more often.  Before it would happen like once a day(game day), now it happens practically every minute and has become very annoying.  In .89x and .901 I have spent hours searching for any code that would cause this and I have found none.  I have searched for every reference for the village farmer  party and every reference is unchanged native code.  The only thing I can think of is the code that spawns the village farmers is treating the player as a village but it is unchanged and the player is not between villages begin and villages end.  What is going on!

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Ask Winter
« Reply #36 on: December 01, 2007, 05:38:08 PM »
This is going to sound stupid and it is stupid.  Here is my problem:
This problem has been around since .89x.  I was trying to script in village rebellions and I had it so a party of peasants was spawned and traveled to the player to attack the player.  Once I got this in(but I hadnt got them to attack the player yet, they just traveled to the player and the disappeared) I decided to change it so a battle would happen inside the player's village when the player entered it.  So I commented out the previous code that has the party of peasants travel to the player.....But it still happened.  So I deleted the commented out code from the module system.  And it still happened except the party was somehow changed to the village farmer party.  I was hoping when I updated my version to .901 it would stop, except it hasnt, and it now happens more often.  Before it would happen like once a day(game day), now it happens practically every minute and has become very annoying.  In .89x and .901 I have spent hours searching for any code that would cause this and I have found none.  I have searched for every reference for the village farmer  party and every reference is unchanged native code.  The only thing I can think of is the code that spawns the village farmers is treating the player as a village but it is unchanged and the player is not between villages begin and villages end.  What is going on!

ERROR: need more input

Something to think about is that operations (such as spawn operations) don't need a direct reference to a module list entry to do something. All they need is an integer. For example, if you're adding items to a local variable containing the value 0, the game will add items to the player troop, because trp_player = 0. This may be what's happening.

What I'd do is disable any script that spawns parties until it stops happening, and then reincorporate the scripts with feedback messages that tell you if one of these parties is spawning and in which script/trigger.

grailknighthero

  • Guest
Re: Ask Winter
« Reply #37 on: December 01, 2007, 06:44:05 PM »
Ok I just commented out this simple trigger and it fixed the problem.  How is the player being set as the target?  I know it is what you said, 0 means it will affect the player so the target is the player, but I dont know how or why, this is native code and I dont see how the target is set to 0.

Edit: When I put this code back in the problem seemed to have fixed itself.  It doesnt happen anymore, although I need to test it some more.  If it comes up again I think I have an idea of how to fix it.  Ill just put in a check for the target party and if it is the player Ill stop it from being the player.

Code: [Select]
  # Spawn village farmer parties
  (24,
   [
       (try_for_range, ":village_no", villages_begin, villages_end),
         (party_slot_eq, ":village_no", slot_village_state, svs_normal),
         (party_get_slot, ":farmer_party", ":village_no", slot_village_farmer_party),
         (this_or_next|eq, ":farmer_party", 0),
         (neg|party_is_active, ":farmer_party"),
         (store_random_in_range, ":random_no", 0, 100),
         (lt, ":random_no", 30),
         (call_script, "script_create_village_farmer_party", ":village_no"),
         (assign, ":party_no", reg0),
         (party_set_slot, ":village_no", slot_village_farmer_party, ":party_no"),
         (str_store_party_name, s1, ":village_no"),
#         (display_message, "@Village farmers created at {s1}."),
       (try_end),
    ]),
Here's the script
Code: [Select]
("create_village_farmer_party",
   [(store_script_param, ":village_no", 1),
    (party_get_slot, ":town_no", ":village_no", slot_village_market_town),

    (store_faction_of_party, ":party_faction", ":town_no"),
    (set_spawn_radius, 0),
    (spawn_around_party, ":village_no", "pt_village_farmers"),
    (assign, ":new_party", reg0),
     
    (party_set_faction, ":new_party", ":party_faction"),
    (party_set_slot, ":new_party", slot_party_home_center, ":village_no"),
    (party_set_slot, ":new_party", slot_party_type, spt_village_farmer),
    (party_set_slot, ":new_party", slot_party_ai_state, spai_trading_with_town),
    (party_set_slot, ":new_party", slot_party_ai_object, ":town_no"),
    (party_set_ai_behavior, ":new_party", ai_bhvr_travel_to_party),
    (party_set_ai_object, ":new_party", ":town_no"),
    (party_set_flags, ":new_party", pf_default_behavior, 0),
    (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
    (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
      (store_add, ":cur_good_price_slot", ":cur_goods", ":item_to_price_slot"),
      (party_get_slot, ":cur_village_price", ":village_no", ":cur_good_price_slot"),
      (party_set_slot, ":new_party", ":cur_good_price_slot", ":cur_village_price"),
    (try_end),
    (assign, reg0, ":new_party"),
    ]),
« Last Edit: December 01, 2007, 07:36:33 PM by grailknighthero »

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Ask Winter
« Reply #38 on: December 02, 2007, 08:00:52 AM »
Ok I just commented out this simple trigger and it fixed the problem.  How is the player being set as the target?  I know it is what you said, 0 means it will affect the player so the target is the player, but I dont know how or why, this is native code and I dont see how the target is set to 0.

It happens when the slots it's getting contain 0 in the first place, which is easily done due to fooling around by modders (i.e. the slots in question never get set properly in the gamestart script, or their contents get erased at some point).

grailknighthero

  • Guest
Re: Ask Winter
« Reply #39 on: December 02, 2007, 12:23:58 PM »
K, Ill call it in game start then and perhaps in the script that spawns the farmer just to make sure.

Offline Llew

  • Master
  • *****
  • Posts: 1399
  • TLD dev team
    • View Profile
Re: Ask Winter
« Reply #40 on: December 05, 2007, 09:22:56 PM »
Dumb question: Where are the Lord's party templates? I want to edit how many troops they have etc., but I can't find their parties. They don't seem to be in the Party_Templates.

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Ask Winter
« Reply #41 on: December 06, 2007, 03:10:08 AM »
Dumb question: Where are the Lord's party templates? I want to edit how many troops they have etc., but I can't find their parties. They don't seem to be in the Party_Templates.

They're not made straight from party templates, they're assembled scriptwise. The base template is pt_kingdom_hero_party, but troops, hero, name and icon are all added via script_create_kingdom_hero_party.

Offline Llew

  • Master
  • *****
  • Posts: 1399
  • TLD dev team
    • View Profile
Re: Ask Winter
« Reply #42 on: December 06, 2007, 07:22:55 AM »
Dumb question: Where are the Lord's party templates? I want to edit how many troops they have etc., but I can't find their parties. They don't seem to be in the Party_Templates.

They're not made straight from party templates, they're assembled scriptwise. The base template is pt_kingdom_hero_party, but troops, hero, name and icon are all added via script_create_kingdom_hero_party.

Looked through that whole set of scripts, but I still can't find what I change to give the Lords certain troops.  :-\

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Ask Winter
« Reply #43 on: December 06, 2007, 11:45:37 AM »
In module_party_templates:

 ("kingdom_1_reinforcements_a", "kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_footman,3,7),(trp_swadian_skirmisher,5,10),(trp_swadian_militia,11,26)]),
 ("kingdom_1_reinforcements_b", "kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,5,10),(trp_swadian_infantry,5,10),(trp_swadian_crossbowman,3,8)]),
 ("kingdom_1_reinforcements_c", "kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_inquisitor,3,7),(trp_swadian_knight,3,7),(trp_swadian_sergeant,2,5),(trp_swadian_sharpshooter,2,5)]),

The way it works: each party has a desired size, and it randomly selects one of the three templates to add. Repeat until the desired size is met.

Lord parties randomly select from all three, garrisons only select from the first two.

Offline Llew

  • Master
  • *****
  • Posts: 1399
  • TLD dev team
    • View Profile
Re: Ask Winter
« Reply #44 on: January 07, 2008, 07:38:12 AM »
I am working on porting HYW, and starting with getting the items ingame. I copied the resources (which are two brf files, I put the lines to make the game read them here:        Is that right?
load_resource = food
load_resource = beards
load_resource = armors_b
load_resource = helmets_b
load_resource = village_houses
load_resource = village_houses_a
load_resource = village_houses_b
load_resource = hair
load_resource = deneme
load_module_resource = HYW4
load_module_resource = HYW4b

I also copied the textures and the from the .751 installation into the .903 one, then I opened the module system and added teh code for two pairs of boots, just to see if it worked. When I started HYW though, I get and RDL error that says "attepting to reregister weapons2.dds (the name of one of the texture files that I moved.)

So, can anyone tell me what I'm doing wrong?