Recent content by CryptoCactus

  1. Modding Q&A [For Quick Questions and Answers]

    Ikaguia said:
    If Im not mistaken, this would fix the problem with the strings:
    Code:
    import sys
    sys.dont_write_bytecode = True
    
    import glob, os
    os.chdir("./")
    for fileName in glob.glob("module_*.py"):
    	file = open(fileName,"r")
    	lines = file.readlines()
    	file.close()
    
    	file = open(fileName,"w")
    
    	level = 0
    	for line in lines:
    		line = line.strip()
    		isString = 0
    		acceptableindex = -1
    		for i in xrange(len(line)):
    			if(line[i]=='\"' or line[i]=='\''):
    				isString = (isString+1)%2
    			if(line[i]=='#' and isString == 0):
    				acceptableindex = i
    				break
    		#acceptableindex = line.find("#")
    		if (acceptableindex == -1):
    			acceptableindex = len(line)
    		level -= line.count("try_end", 0, acceptableindex)
    		level -= line.count("end_try", 0, acceptableindex)
    		level -= line.count("else_try", 0, acceptableindex)
    		newlevel = level
    		level_positive_change = 0
    		newlevel += line.count("else_try", 0, acceptableindex)
    		newlevel += line.count("(", 0, acceptableindex)
    		newlevel += line.count("[", 0, acceptableindex)
    		newlevel += line.count("try_begin", 0, acceptableindex)
    		newlevel += line.count("try_for", 0, acceptableindex)
    		level_positive_change = newlevel - level
    		newlevel -= line.count(")", 0, acceptableindex)
    		newlevel -= line.count("]", 0, acceptableindex)
    		if (level_positive_change == 0):
    			level = newlevel
    		for i in xrange(level):
    			file.write("	")
    		level = newlevel
    		file.write("%s\n"%line)
    	file.close()
    as Im a total noob with python, there are probably a lot of better ways to do this, but to me it seems reasonable

    this wont work for multiline strings such as the credits strings in module_strings, but it should work for pretty much everything else


    also, what do you guys use to make it run for all files??
    just edited the code to work for all the module_*.py files in the directory

    Excellent! I've added another bit to check for the (simple) python bits in module_troops, as well. It won't work if you have defs within defs or anything complex like that, but for any simple python code that starts with a def and ends with a return, it should work fine. Also a nice little "processing..." output to the console, because I like being able to see it do things.

    Code:
    import sys
    sys.dont_write_bytecode = True
    
    def correct_lines (fileName):
      file = open(fileName,"r")
      lines = file.readlines()
      file.close()
    
      file = open(fileName,"w")
      print "Processing " + fileName + "..."
      level = 0
      returnFound = 0
      for line in lines:
        line = line.strip()
        isString = 0
        acceptableindex = -1
        for i in xrange(len(line)):
          if(line[i]=='\"' or line[i]=='\''):
            isString = (isString+1)%2
          if(line[i]=='#' and isString == 0):
            acceptableindex = i
            break
        #acceptableindex = line.find("#")
        if (acceptableindex == -1):
          acceptableindex = len(line)
        if line.startswith("return "):
          returnFound = 1
        level -= line.count("try_end", 0, acceptableindex)
        level -= line.count("end_try", 0, acceptableindex)
        level -= line.count("else_try", 0, acceptableindex)
        newlevel = level
        level_positive_change = 0
        newlevel += line.count("else_try", 0, acceptableindex)
        newlevel += line.count("(", 0, acceptableindex)
        newlevel += line.count("[", 0, acceptableindex)
        newlevel += line.count("try_begin", 0, acceptableindex)
        newlevel += line.count("try_for", 0, acceptableindex)
        newlevel += line.startswith("def ")
        level_positive_change = newlevel - level
        newlevel -= line.count(")", 0, acceptableindex)
        newlevel -= line.count("]", 0, acceptableindex)
        if (level_positive_change == 0):
          level = newlevel
        for i in xrange(level):
          file.write("  ")
        level = newlevel
        if (returnFound == 1):
          level -= 1
        returnFound = 0
        file.write("%s\n"%line)
      file.close()
    
    import glob
    for modfile in glob.glob('module_*.py'):
      correct_lines(modfile)
    
    raw_input("Press Enter to continue...")
  2. Modding Q&A [For Quick Questions and Answers]

    I don't disagree - it's incredibly handy and I use it on all my module_* files as well. In general it seems like it would be a good idea to ignore quoted strings when processing lines (for any purpose, really), is all I'm saying.

    Nonetheless, I cede the point.  :razz:
  3. Modding Q&A [For Quick Questions and Answers]

    It's native code. And yes, that's what I did, just removed the pound signs from the relevant strings. Just thought fixing the actual process file might be a more robust way of doing it.
  4. Modding Q&A [For Quick Questions and Answers]

    Not that it's super-important, but process_line_correction.py doesn't account for #s that are inside of quoted strings. This can bork the indentation in module_scripts.

    For instance, in script_get_relevant_comment_for_log_entry, about 28 lines into the script:

      ("get_relevant_comment_for_log_entry",
          ...
          (try_begin),
            (eq, "$cheat_mode", -1), #temporarily disabled
            (try_begin),
              (assign, reg5, ":log_entry_no"),
              (assign, reg6, ":entry_type"),
              (assign, reg8, ":entry_time"),
             
              (gt, "$players_kingdom", 0),
              (try_begin),
                (gt, ":troop_object_faction", 0),
                (assign, reg7, ":players_kingdom_relation"),
                (display_message, "@{!}Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to troop object = {reg7}"), this line contains a # so process_line_correction ignores the rest of the line
                (else_try),
                  (gt, ":center_object_faction", 0),
                  (assign, reg7, ":players_kingdom_relation"),
                  (display_message, "@{!}Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to center object faction = {reg7}"), and here
                  (else_try),
                    (gt, ":faction_object", 0),
                    (assign, reg7, ":players_kingdom_relation"),
                    (display_message, "@{!}Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to faction object = {reg7}"),and here
                    (else_try),
                      (display_message, "@{!}Event #{reg5}, type {reg6}, time {reg8}. No relevant kingdom relation"),and here
                      (try_end),
                    (else_try),
                      (display_message, "@{!}Event #{reg5}, type {reg6}, time {reg8}. Player unaffiliated"),and here
                      (try_end),
                    (try_end),

    Note the messed up indentation. Anyone have an easy way to account for/ignore #s inside of quoted strings?
  5. Diplomacy for 1.174

    Sorry mate, just trying to help. Thank you for doing this!
  6. Diplomacy for 1.174

    Compiling from source fails:

    *** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
    Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

    Loading module... FAILED.
    MODULE `game_menus` ERROR:
    Traceback (most recent call last):
      File "compile.py", line 89, in <module>
        from module_game_menus import *
      File "C:\Games\Mount&Blade Warband\Modules\Diplomacy\source\module_game_menus.
    py", line 6495, in <module>
        (this_or_next|troop_slot_eq, ":leader", slot_troop_reputation_type, lrep_mar
    tial),
    NameError: name 'slot_troop_reputation_type' is not defined


    COMPILATION FAILED.

    Press any key to continue . . .

    I assume that's  meant to be slot_lord_reputation_type? After correcting that, other notes:

    ---
    Code:
      unassigned local variable <l.center_no[@1224979098644774914]> used by operation party_slot_ge in dialog.spouse_leave(#224).condition on line 2
    I'm guessing "$g_player_court" was meant there, instead of ":center_no".
    ---
    Code:
      duplicate entity found: ip.dplmc_autosell
    This one just looks like a simple copy-paste error.
    ---
    Code:
      duplicate entity found: itm.tutorial_sword
      duplicate entity found: itm.tutorial_axe
      duplicate entity found: itm.tutorial_spear
      duplicate entity found: itm.tutorial_club
      duplicate entity found: itm.tutorial_battle_axe
      duplicate entity found: itm.tutorial_arrows
      duplicate entity found: itm.tutorial_bolts
      duplicate entity found: itm.tutorial_short_bow
      duplicate entity found: itm.tutorial_crossbow
      duplicate entity found: itm.tutorial_throwing_daggers
      duplicate entity found: itm.tutorial_saddle_horse
      duplicate entity found: itm.tutorial_shield
      duplicate entity found: itm.tutorial_staff_no_attack
      duplicate entity found: itm.tutorial_staff
      duplicate entity found: s.npc2_kingsupport_2
      duplicate entity found: s.npc4_turn_against
      duplicate entity found: s.comment_you_were_defeated_allied_unfriendly
      duplicate entity found: s.comment_you_were_defeated_allied
      duplicate entity found: s.score
      duplicate entity found: s.routed
      duplicate entity found: s.wife
      duplicate entity found: s.husband
      duplicate entity found: s.father
      duplicate entity found: s.mother
      duplicate entity found: s.daughter
      duplicate entity found: s.son
      duplicate entity found: s.sister
      duplicate entity found: s.brother
      duplicate entity found: s.s15
      duplicate entity found: s.he
      duplicate entity found: s.she
      duplicate entity found: s.s12
      duplicate entity found: s._family_
      duplicate entity found: s.whereabouts_unknown
      duplicate entity found: s.betrothed
    The above are present in Native and are relatively harmless.
    ---
    Code:
      local l.prisoner declared but never used in dialog.lord_mission_rescue_prisoner_method_ransom(#2138).result
      local l.rand declared but never used in dialog.mercenary_tavern_talk_hire(#3054).condition
      local l.player_agent declared but never used in mt.village_raid(#11).ti_on_agent_killed_or_wounded.body
      local l.player_agent declared but never used in mt.arena_melee_fight(#24).ti_on_agent_killed_or_wounded.body
      local l.unused declared but never used in script.game_get_troop_wage
      local l.villager_count declared but never used in script.process_village_raids
      local l.unused declared but never used in script.debug_variables
      local l.unused_2 declared but never used in script.debug_variables
      local l.unused declared but never used in script.party_inflict_attrition
      local l.center_no declared but never used in script.calculate_improvement_limit
      local l.player_team declared but never used in script.cf_dplmc_battle_continuation
      local l.relation:faction declared but never used in mnu.camp_recruit_prisoners(#28).mno_camp_recruit_prisoners_accept.choice
    I assume at least some of these probably had/have a future use planned.
  7. NE Warband - report bugs here

    @Rastelli

    Believe that's intentional. That's how it was back in 1.011. NE is a lot less forgiving in the beginning than plain ol' Native.

    I'm just downloading now, so I can't say from experience yet, but if it's the same as it was back then, there are still low-level bandits around, they're just harder to find. And lots of mercs to dodge. :smile:
  8. Your Favourite Weapon?

    -Heavy morningstar for general ****-slappery
    OR
    -Military hammer for prisoners

    -Reinforced steel shield
    -Masterwork nomad bow (PD 6, best combo of speed + power imo)
    -Large bag of bodkin/khergit arrows

    That's for maximum effectiveness, anyway (along with heavy heraldic armor of some sort and a heavy charger).

    For sheer joy factor, probably either the bec de corbin or any of the cartoonishly large 2h axes. On foot, in heavy armor, soloing bandits. Whirlwind of death.
  9. Warband has now become like any other fps to me.

    Reapy said:
    O ahoy crypto :smile: I was sort of expecting the same thing but, I guess not the case, really not even as much server variety available now in the US as there was in beta.  Also i'm not 100% sure all melee is the proper 'solution' though I would really love to be able to pull up some sorta 5v5 melee or less situations at whim, or 5 v 1 sometimes.

    Hey Reapy! Good to see you.

    Yeah, I agree that complete removal of ranged weapons isn't the ideal solution, and I'm not opposed to ranged play in and of itself (as evidenced by my avatar, heh). It's just.. too much as it is now, I think. And I know I could just play duel servers if there are still any of those around, but dueling outside of an actual battle/combat situation is pretty one-dimensional and I get bored with it after a while.

    I also expected to see some sort of class-limiting mod or server option shortly after release (as in no more than x% archers, cav, whatever), but maybe that's not possible, I don't know. And of course class-limiting comes with its own set of problems (lol gtfo noob fgt i am master archer, y u go archur if u terrible u make us lose, etc).

    edit:
    Also, I'm surprised there are (I assume) no servers running mods like, ah, Losey's RCM (I think that was the name... realistic combat model?) wherein heavy armor was nigh-impervious to ranged fire but lightly-armored troops could be shredded. I'm not saying that's the ideal solution either, and I can't (and don't care to) speak to how realistic it actually was, but it might make archery and countering archery more interesting.

    Ah well.
  10. Surprisingly effective troops.

    Oh yes. I HATE forest bandits in the early game.

    However, I get immense satisfaction when I can solo whole boatloads of them later in the game.  Stupid forest bandits. :smile:
  11. Warband has now become like any other fps to me.

    Oh hey there Gaunt.

    Maybe I'll pop by PRT on Monday then. I'm sure I'm complete garbage now, but I suppose that's okay. :razz:
  12. Warband has now become like any other fps to me.

    This is largely why I quit playing multiplayer. Over time, as the beta progressed and especially after release, the game started to feel more and more like a medieval FPS. Most pub teams (can't speak to competitive play) started becoming more and more archer-heavy, until merely getting to battle without looking too much like a pincushion became an exercise in annoyance. I still pop into a MP server every three or four months, usually only for a round or two, but I genuinely just don't have fun with it anymore.

    I honestly expected to see a large swath of no-ranged servers crop up after public release/modsys release, but they just... didn't. So I assumed I was in the minority in my desire for a less-ranged experience and went back to SP (which is still ****ing excellent).


    I do worry a bit that part of the reason for the large number of ranged players is not because they actually enjoy it particularly, but only that there's not much reason NOT to take a ranged class. Melee is determined more by personal skill than equipment or stats, so any archer that's decent at melee can stand (more or less) toe-to-toe against decent infantry. Considering that, it might seem silly to remove your capacity for rapid, massive damage over distance just to add a shield and somewhat heavier armor.
  13. NE for Warband Progress Report

    Just a note on HA AI - forum member Caba'drin has written a lot of good pseudo-AI tweaks, one of which is a skirmish mode which causes units to avoid melee at all costs. It's not perfect, but it's a marked improvement on Native Warband's hurrdurr charge headlong into a pile of huscarls HA tactics. There's also a script for smarter lance and polearm usage, which was another huge annoyance for me personally.


    Basically, while you can't really delve into the hardcoded AI stuff, the newest module system does offer a lot of options for tweaking surface-level bot behavior.


    Also, I'm very excited to see NE moving to Warband. It was my favorite mod for 1.011, and I'm sure it'll be a hit in WB as well. Cheers, modders. You guys are awesome.
  14. SP Native Pre-Battle Orders & Deployment (v0.96.3 for Warband 1143+WSE)-patch for 115x

    I've  been quietly stalking this thread all weekend waiting for the new release. :smile:
  15. I love you!!!!!!!!!!!!!!

    I heartily agree with the OP. I can't believe how awesome the PoP team is. I've been impressed with you guys for a long time, but coming back to WB and seeing this released already just has me floored. In a good way. :smile:
Back
Top Bottom