Author Topic: Ask Winter  (Read 65276 times)

Offline KON_Air

  • Craftsman
  • **
  • Posts: 110
    • View Profile
Re: Ask Winter
« Reply #120 on: August 19, 2008, 08:45:18 PM »
A troop(or troops) have a skill that is too high for his level. Increase his level or decrease his skill.

Tamuli

  • Guest
Re: Ask Winter
« Reply #121 on: August 20, 2008, 03:18:18 PM »
I haven't edited troops and despite being an exact copy, native works fine.
I even reinstalled the whole game and mod system...

grailknighthero

  • Guest
Re: Ask Winter
« Reply #122 on: November 17, 2008, 12:24:43 AM »
Me again.

Anyone know what is wrong with this?

Im getting TypeError: list indices must be integers for the line in purple

Quote
  ("gkh_shield_item_set_banner",
    [
       (store_script_param, ":tableau_no",1),
       (store_script_param, ":agent", 2),
       #(store_script_param, ":troop_no", 3),
       (store_script_param, ":heraldry_value", 3),
       
       (val_sub, ":heraldry_value", 1),

       (store_add, ":banner_spr", ":heraldry_value", banner_scene_props_begin),
       (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
       (try_begin),
           (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
       (else_try),
           (store_add, ":banner_spr", 0, banner_scene_props_begin),
           (item_set_slot,"itm_global_heraldry_slot",slot_item_global_heraldry_slot,0),
           (agent_set_slot,":agent",slot_agent_heraldry,0),
       (try_end),
       (val_sub, ":banner_spr", banner_scene_props_begin),
       (store_add, ":banner_mesh", ":banner_spr", arms_meshes_begin),

      (cur_item_set_tableau_material, ":tableau_no", ":banner_mesh"),
     ]),

Ive looked for missing comas and extra brackets, but I can't find any.

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 #123 on: November 17, 2008, 07:32:39 AM »
Me again.

Anyone know what is wrong with this?

Im getting TypeError: list indices must be integers for the line in purple

Quote
  ("gkh_shield_item_set_banner",
    [
       (store_script_param, ":tableau_no",1),
       (store_script_param, ":agent", 2),
       #(store_script_param, ":troop_no", 3),
       (store_script_param, ":heraldry_value", 3),
       
       (val_sub, ":heraldry_value", 1),

       (store_add, ":banner_spr", ":heraldry_value", banner_scene_props_begin),
       (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1),
       (try_begin),
           (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"),
       (else_try),
           (store_add, ":banner_spr", 0, banner_scene_props_begin),
           (item_set_slot,"itm_global_heraldry_slot",slot_item_global_heraldry_slot,0),
           (agent_set_slot,":agent",slot_agent_heraldry,0),
       (try_end),
       (val_sub, ":banner_spr", banner_scene_props_begin),
       (store_add, ":banner_mesh", ":banner_spr", arms_meshes_begin),

      (cur_item_set_tableau_material, ":tableau_no", ":banner_mesh"),
     ]),

Ive looked for missing comas and extra brackets, but I can't find any.

Comment everything out, then uncomment one line at a time to see which line is the offending one.

Regards,
Winter

grailknighthero

  • Guest
Re: Ask Winter
« Reply #124 on: November 17, 2008, 09:22:02 AM »
Well Obviously something is wrong, because I just commented out the entire script and now its pointing to the script above it (so it started at the bottom and it is flagging each line above as I comment out lines).

Probably missing a bracket or parentheses or comma at the top lol.  I wonder how I am going to find the problem in 20000 lines of code.

Edit:  nm, found the problem.  Like I thought, the problem was at the very top, forgot this plus

scripts = formation_scripts + tactical_ui_scripts + multiple_formations_scripts + [

Thanks for the help, it would have taken me to find that because I was thinking it was something in the script and more specifically how I was handling the tableau system.
« Last Edit: November 17, 2008, 09:26:55 AM by grailknighthero »

tercero

  • Guest
Re: Ask Winter
« Reply #125 on: November 22, 2008, 03:27:31 PM »

grailknighthero

  • Guest
Re: Ask Winter
« Reply #126 on: November 22, 2008, 04:20:03 PM »

tercero

  • Guest
Re: Ask Winter
« Reply #127 on: November 22, 2008, 04:26:10 PM »
grailknighthero I LOVE YOU that was the post I was looking for!!!!  :green: :green: thanks thanks thanks thanks!!!!!!!!!!!!

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Ask Winter
« Reply #128 on: January 30, 2009, 12:51:07 AM »
I got one that will keep you programming geniuses busy for a while...

Building destructible scene props.  Easy enough to do, in general:

Code: [Select]
("earth_gate_a",sokf_destructible|sokf_moveable|spr_hit_points(3500),"earth_gate_a","bo_earth_gate_a",   [
   (ti_on_scene_prop_destroy,
    [
        (store_trigger_param_1, ":instance_no"),
        (prop_instance_get_starting_position, pos1, ":instance_no"),
        (get_player_agent_no, ":player_agent"),
        (agent_get_position, 2, ":player_agent"),
        (assign, ":rotate_side", 80),
        (try_begin),
          (position_is_behind_position, 2, 1),
          (val_mul, ":rotate_side", -1),
        (try_end),
        (position_rotate_x, 1, ":rotate_side"),
        (position_set_z_to_ground_level, pos1),(prop_instance_animate_to_position, ":instance_no", 1, 70), #animate to position 1 in 0.7 second
        (play_sound, "snd_dummy_destroyed"),
    ]),
(ti_on_scene_prop_hit,
    [
        (play_sound, "snd_dummy_hit"),
        (particle_system_burst, "psys_dummy_smoke", pos1, 3),
     ]),
  ]),

Problem is, no matter what I set spr_hit_points to, the fool things never seem to get more than a hundred or so hit points.
Now, that's just not going to work with castle gates.  The gate needs to take several minutes to knock it down (while under fire), or some exceptionally large weapon, to get the proper effect.

So, how can we armor these gates in some way?  Damage reduction of some sort?  Or at least get it to read the bloody hit point data?  I've looked everywhere, and several other people have asked the same question at various times, but so far, zero solutions have been presented.

And a LOT of mods could use this, if it would work properly.

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 #129 on: January 30, 2009, 01:33:35 PM »
Nope, sorry. There's no way to do that with the current version of the module system.

Regards,
Winter

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Ask Winter
« Reply #130 on: January 30, 2009, 11:46:39 PM »
Crud ....

Well, can we go at this the other direction?  Use the "on hit" function, have the door move just a little each time it is hit (preferably relative to damage taken)?  Such that the player has to beat on the door until there is an opening large enough to pass through?

(Note: I tried this, but I couldn't get it to work right, because I don't know what the heck I'm doing.  I'm trying to teach myself to read Python, but I need examples to work from.)

Any ideas on how to approach that?

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 #131 on: January 31, 2009, 02:43:18 AM »
Crud ....

Well, can we go at this the other direction?  Use the "on hit" function, have the door move just a little each time it is hit (preferably relative to damage taken)?  Such that the player has to beat on the door until there is an opening large enough to pass through?

(Note: I tried this, but I couldn't get it to work right, because I don't know what the heck I'm doing.  I'm trying to teach myself to read Python, but I need examples to work from.)

Any ideas on how to approach that?


That's easy -- I did the same in the last version of Craftmod with chopping down trees. Getting the positions right is the only difficult bit.

I haven't got the code here to show you but it was an adaptation of the target dummies in module_scene_props.

Regards,
Winter

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Ask Winter
« Reply #132 on: January 31, 2009, 03:58:46 AM »
Roger that ... I'll check out the craftmod code.

But I got as far as the part about adapting the target dummy code, before my plan fell apart ... Everything rotated the wrong way at the wrong time, or some such.  I couldn't get anything to zero at ground level, so the doors all would pivot in the middle or some dumb thing.

I mean, the concept I have ... the details, forget it.

-------------------------

Edit:
OK, the last released version of the craftmod code didn't have that in there.  So I still need help of a more direct variety.
« Last Edit: January 31, 2009, 04:23:31 AM by Ron Losey »

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 #133 on: January 31, 2009, 02:58:29 PM »
Everything rotated the wrong way at the wrong time, or some such.  I couldn't get anything to zero at ground level, so the doors all would pivot in the middle or some dumb thing.

Well they would, wouldn't they? The position of the scene prop is the geometric middle of the model, so you need to either enlarge the model to offset the central point to the location of the hinges or modify the position you're rotating for the same reason.

Regards,
Winter

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Ask Winter
« Reply #134 on: March 05, 2009, 07:27:25 AM »
Just for the record ... on the destructable scene props:

http://forums.taleworlds.net/index.php/topic,58596.msg1515619.html#msg1515619

Fisheye comes through again.  Hit point code for scene props that can be destroyed correctly.

So it was possible - it just took a skill level a darn sight higher than I could really comprehend.

Anyway, I'll certainly be making use of those in any number of projects, I'm sure a lot of other people will be happy to have this one too.  It does work ... just finished initial testing on DoL (the proposed fantasy mod in the discussions thread ... we're hoping for an alpha release soon, so it can be moved down to "new mods").