login

Author Topic: M&B Scripting Q&A  (Read 66823 times)

bungus

  • Guest
Decreasing party limit, increasing affect of leadership
« Reply #210 on: June 26, 2008, 02:12:00 PM »
I want to lower the maximim number of units the player can have in his party. To counteract this affect, then, increase the number of party members the leadership skill gives you.

I don't use python. Any one know what text file and where in it are these variables?

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Decreasing party limit, increasing affect of leadership
« Reply #211 on: June 28, 2008, 12:38:25 AM »
I want to lower the maximim number of units the player can have in his party. To counteract this affect, then, increase the number of party members the leadership skill gives you.

I don't use python. Any one know what text file and where in it are these variables?

I answered this in the other thread.  There's no way in heck.  You would have to calculate the exact offset in a hex .txt file ... which will be different depending on which mod you are using, and each version thereafter.  Even if you could somehow compile Python code in your head, it would take days to find it.  It would be easier to build a nuclear reactor out of a microwave oven and a hot water tank.  (Not "impossible", but certainly unlikely to the point of being ineffective.)

The only way to do that without the source code would be to compile two versions from Python - one with the changes you wanted, one as per Native - and then cut and paste the changes you wanted ... and hope that you didn't miss the hex offset by one space.  And that's not exactly a "don't use Python" solution ... it's just a cut-and-paste for portions of the source code that you don't have.  Even then, it might or might not work, depending on what else that particular mod had changed.

Stick to flapping your arms and trying to fly to Jupiter ... your odds are better.

Some things just can't be effectively done without the source code.  That's just about all there is to it.

bungus

  • Guest
Re: M&B Scripting Q&A
« Reply #212 on: June 28, 2008, 04:20:04 PM »
Oh... Well, thanks for the tip.

I'm used to medieval2, stalker, and a few others where ini editing is possible, and easy. No idea what I'm doing here, though, I was able to edit the text file for items1.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: M&B Scripting Q&A
« Reply #213 on: June 28, 2008, 07:00:08 PM »
Oh... Well, thanks for the tip.

I'm used to medieval2, stalker, and a few others where ini editing is possible, and easy. No idea what I'm doing here, though, I was able to edit the text file for items1.

The item_kinds1.txt file is almost human-readable, if you are extremely patient.  You can edit it some, if you are careful what you change, without screwing up the rest of the game.  (Note that if you add a line, every other piece of equipment in the game will be in the wrong places.)  The troops text file can be similarly edited manually, again if you are extremely patient.  The others become progressively less likely to work.

It's easier to learn Python, at least enough to do whatever you're wanting to do.  That's what I finally had to do.

Offline Shik

  • Craftsman
  • **
  • Posts: 88
    • View Profile
Re: M&B Scripting Q&A
« Reply #214 on: December 06, 2008, 09:07:12 PM »
    if (len(entry[5]) > 8 ):
TypeError: object of type 'int' has no len()

What does this error mean? What should I be looking for to resolve it?

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: M&B Scripting Q&A
« Reply #215 on: December 07, 2008, 11:49:10 AM »
The usual punctuation error, missing or extra commas, mismatched brackets, etc.

Offline Shik

  • Craftsman
  • **
  • Posts: 88
    • View Profile
Re: M&B Scripting Q&A
« Reply #216 on: April 10, 2009, 04:09:52 PM »
http://www.python.org/dev/peps/pep-0263/

I have no idea what I should do about this. How can I resolve this issue?

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: M&B Scripting Q&A
« Reply #217 on: April 10, 2009, 04:57:57 PM »
Well, the obvious answer would be to avoid using characters like that....  ::)

Offline Shik

  • Craftsman
  • **
  • Posts: 88
    • View Profile
Re: M&B Scripting Q&A
« Reply #218 on: April 10, 2009, 07:21:36 PM »
...how did I totally know someone was going to say that? Honestly, if I simply wanted to resolve the issue by removing all accented characters, I would have done so.
The point is, I want to have troops with accented names, but it appears that the module system doesn't like the encoding or whatever. I'm just wondering if it's possible to get around it by typing some definitions somewhere. For now, I'll just use the language files to get around it, but it makes things a hassle.
« Last Edit: April 10, 2009, 07:43:39 PM by shikamaru 1993 »

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: M&B Scripting Q&A
« Reply #219 on: April 10, 2009, 10:47:09 PM »
Honestly, if I simply wanted to resolve the issue by removing all accented characters, I would have done so.

Yes, well, that was implied ... hence the little guy rolling his eyes  ::)

But seriously, that could be a real pain to beat.  I don't think there's anywhere in the header_(whatever) files that defines characters to use in names or script (at least not any that I have seen), so it may be a problem in Python in general, or M&B.  Same way you can't use quotation marks in your text, because Python uses the quotation marks to define what the text is.

So what you "wanted" may not be helpful at the moment ... it might be another item to chalk up in the "M&B Oddities" collection.

Like the classical medical diagnosis:
Patient:  "Doctor, it hurts to breathe when I run."
Doctor: "So don't run."

Offline fujiwara

  • Master
  • *****
  • Posts: 858
    • View Profile
Re: M&B Scripting Q&A
« Reply #220 on: December 05, 2009, 12:45:00 AM »
Python defaults to ASCII when no other encoding is specified (UTF-8 or other). Furthermore, I don't know if M&B itself supports anything other than ASCII. The developers used a number of Turkish place names in Native, and Turkish uses a number of diacritical marks. None showed up in Native, so I have to assume M&B doesn't support them. Any evidence to the contrary would help solve the problem.

The horses tend to get their legs caught in the catapult rather than being properly launched.

wombn8t

  • Guest
Re: M&B Scripting Q&A
« Reply #221 on: December 05, 2009, 09:14:32 PM »
Hello! I'm new to modding.

I'm thinking of a starting a small little mini-mod to learn the basics.

I've cruised the forums and haven't found updated tutorials on using python. I got errors when I tried to go through the one posted in 2006.

Am I going to have to adapt them or are there updated step-by-step ones?

Also, I can't get Thorgrim's map editor to work. It says it can't find the directory of Mount and Blade. I've tried re-installing it. Should I re-install Mount and Blade?

Thanks,

Womb8t

Madmax

  • Guest
Re: M&B Scripting Q&A
« Reply #222 on: July 16, 2010, 01:05:09 PM »
OK, I ll start here then, I guess I am right now :-)

hallo everybody, my first post here! (actually the second, I first posted in the wrong place, I guess)

I would like to tweak one thing. I have the problem, with this game (which I LOVE!!!!), that I advance so slowly, and I have actually so little time to play it.

This brings to the question:
I would like to increase in level, to increase my party capability, to improve my reputation ... in one word: to become king with a certain character in a shorter time than what the Native allows you.

Any idea, how can one make the games "faster" at his own will? Is something already out there, based on native?

A last thing: I am a newby at modding, you ll have to explain me in details what I do have to do  :D

Thank you in advance!

Offline GetAssista

  • Master
  • *****
  • Posts: 1357
  • TLD Dev team
    • View Profile
Re: M&B Scripting Q&A
« Reply #223 on: July 21, 2010, 01:12:50 AM »
Madmax, I think you need to look through the sticky threads in Taleworlds forum. There are tools & directions  for simple text tweaks there, and that's what you need

Madmax

  • Guest
Re: M&B Scripting Q&A
« Reply #224 on: July 29, 2010, 05:16:50 AM »
Ok, Thanks :-)