Author Topic: More Python Troubles  (Read 1040 times)

0 Members and 1 Guest are viewing this topic.

Riven

  • Sergeant at Arms
  • *
  • I know 37 ways to mutilate a kumquat.
    • View Profile
More Python Troubles
« on: January 10, 2007, 05:08:40 PM »
Who would have thought that there'd be more difficulties with Python?

Anyway, as some of you may know, I'm working on a mod for .751 for a friend who only plays .751. However, I've added a troop to the renamed Reyvadin (and the renamed Wercheg, but we'll focus on Reyvadin despite the fact that Wercheg gets the same problems). When I load up the game, everything works great. Then, I use cheats to get my character to have ungodly amounts of gold (for testing purposes, of course :P) and I go hire all the units in the renamed Reyvadin (renamed to Nightside). That works great. I've now got five Shadowpass Peasants in my army. Then I get into a battle, send my men forward to see how they measure up against river pirates, to check out balance. Perfect--a victory. But some of my men were killed, and it's dangerous wandering around without cannon fodder, so I went back to Nightside to pick up more peasants....

But there weren't Shadowpass Peasants there. Instead, I was faced with three Vaegir Peasants and one Footman. Any idea why, and what I can do to get Python to produce my units instead of Native's?

And one other thing, which I asked in the strangely-dead 'Modmakers Q&A' thread, but, because I created a thread for the above, I figure I might as well post it here, too. Whenever I build_module, I get an error in module_dialogs. I go to check, press Alt+X, and get this statement, as well as Python highlighting the last line in the document: 'EOF in multi-line statement'. How can I fix this? Thank you for your time.
Spam, Spam, Spam, Spam the Taleworlds forums!

Thog get jiggy with it!

(He doesn't say that, but he should.)

svaucher

  • Veteran
  • *
    • View Profile
    • http://www-etud.iro.umontreal.ca/~vauchers
  • M&B
Re: More Python Troubles
« Reply #1 on: January 10, 2007, 06:45:43 PM »
But there weren't Shadowpass Peasants there. Instead, I was faced with three Vaegir Peasants and one Footman. Any idea why, and what I can do to get Python to produce my units instead of Native's?

Unless much has changed, tavern troop creation is done in module_triggers.py. It iterates through all the merc party cities of the factions and creates a random amount of troops for it. Make sure you modify the triggers to create the type of troops you want.

Quote
And one other thing, which I asked in the strangely-dead 'Modmakers Q&A' thread, but, because I created a thread for the above, I figure I might as well post it here, too. Whenever I build_module, I get an error in module_dialogs. I go to check, press Alt+X, and get this statement, as well as Python highlighting the last line in the document: 'EOF in multi-line statement'. How can I fix this? Thank you for your time.

Haven't modded in a while, but EOF -> end of file. I assume that means you haven't closed a statement.
« Last Edit: January 11, 2007, 05:00:37 AM by svaucher »

Riven

  • Sergeant at Arms
  • *
  • I know 37 ways to mutilate a kumquat.
    • View Profile
Re: More Python Troubles
« Reply #2 on: January 10, 2007, 08:04:28 PM »
...

 :shock:

You've got to be kidding me. I missed End of File? Thanks a bunch for both, though ... now I can stop coddling the Peasants I have :D
Spam, Spam, Spam, Spam the Taleworlds forums!

Thog get jiggy with it!

(He doesn't say that, but he should.)

Riven

  • Sergeant at Arms
  • *
  • I know 37 ways to mutilate a kumquat.
    • View Profile
Re: More Python Troubles
« Reply #3 on: January 10, 2007, 08:27:35 PM »
Sorry for the double-post; I have to be sure someone's going to look. Because I'm shallow like that.

When I do alt-x now in module_triggers, it shows me something I didn't even touch and tells me that my indentation is wrong. Then, though, I 'untabify region', like they tell me to, and get that beep that alerts me that something didn't take, and alt-x brings up the same error. What am I doing wrong?
Spam, Spam, Spam, Spam the Taleworlds forums!

Thog get jiggy with it!

(He doesn't say that, but he should.)

svaucher

  • Veteran
  • *
    • View Profile
    • http://www-etud.iro.umontreal.ca/~vauchers
  • M&B
Re: More Python Troubles
« Reply #4 on: January 10, 2007, 08:48:16 PM »
You've got to be kidding me. I missed End of File? Thanks a bunch for both, though ... now I can stop coddling the Peasants I have :D

Does that mean it's resolved?

I don't mean that you missed the EOF. AFAIK, the compiler (build script) tries to match a } for every { and a ] for every [. If by it's missing one, or it will reach EOF and complain about a multi-line statement.

Riven

  • Sergeant at Arms
  • *
  • I know 37 ways to mutilate a kumquat.
    • View Profile
Re: More Python Troubles
« Reply #5 on: January 10, 2007, 08:50:18 PM »
Ooh. It's not resolved, but that'll give me a better handle on it. I'll tell you here when I nail it ;)
Spam, Spam, Spam, Spam the Taleworlds forums!

Thog get jiggy with it!

(He doesn't say that, but he should.)

JHermes

  • Sergeant at Arms
  • *
    • View Profile
    • My website
Re: More Python Troubles
« Reply #6 on: January 11, 2007, 12:29:57 AM »
I'm assuming you've set reyvadin_mercs to your new troop types? I need to know before I can offer any suggestions...
Brother against Brother - the American Civil War mod

There was once a young man who, in his youth, professed his desire to become a great writer. When asked to define "great" he said,

"I want to write things that the whole world will read, things that people will react to on a truly emotional level, things that will make them scream, cry, howl in pain and anger!"

He now works for Microsoft, writing error messages.

Riven

  • Sergeant at Arms
  • *
  • I know 37 ways to mutilate a kumquat.
    • View Profile
Re: More Python Troubles
« Reply #7 on: January 11, 2007, 12:58:44 AM »
Yes, I did.
Spam, Spam, Spam, Spam the Taleworlds forums!

Thog get jiggy with it!

(He doesn't say that, but he should.)

Hellequin

  • Sergeant at Arms
  • *
    • View Profile
Re: More Python Troubles
« Reply #8 on: January 11, 2007, 04:20:36 AM »
There's a trigger in module_triggers which refreshes the mercenary troops.  It's separate from the initial contents.  If you didn't change that, then every (24h? I forget) the game will be adding the original troops to the merc party.

That's my best guess at that one.  And in terms of the brackets, really do go get Thorgrim's MBDev tool, which has a "count brackets" function in it to help find exactly that kind of error.  You'll find it in the Mod Tools forum here.  It's far from perfect IMO, but it does make a handy helper.

Winter

  • I am Tek Jansen!
  • Developer
  • *
    • View Profile
    • STREET: A Cyberpunk Trilogy
  • Faction: Neutral
Re: More Python Troubles
« Reply #9 on: January 11, 2007, 04:32:05 AM »
There's a trigger in module_triggers which refreshes the mercenary troops.  It's separate from the initial contents.  If you didn't change that, then every (24h? I forget) the game will be adding the original troops to the merc party.

That's my best guess at that one.

And you're completely correct.

Propitiously,
Winter

STREET: Losing your mind has never been so much fun . . .

svaucher

  • Veteran
  • *
    • View Profile
    • http://www-etud.iro.umontreal.ca/~vauchers
  • M&B
Re: More Python Troubles
« Reply #10 on: January 11, 2007, 05:03:40 AM »
Sorry for the double-post; I have to be sure someone's going to look. Because I'm shallow like that.

When I do alt-x now in module_triggers, it shows me something I didn't even touch and tells me that my indentation is wrong. Then, though, I 'untabify region', like they tell me to, and get that beep that alerts me that something didn't take, and alt-x brings up the same error. What am I doing wrong?

Didn't see this post before my response. I'll repeat myself, you didn't close a statement, list ->
you are missing a } or a ].

Try removing parts of your dialog code and re-indent. When it works, you've identified the part that contains an error.

Hellequin

  • Sergeant at Arms
  • *
    • View Profile
Re: More Python Troubles
« Reply #11 on: January 11, 2007, 05:04:40 AM »
Winter - Oh, I know I'm correct about the factual stuff.  The guesswork is that this is, in fact, the source of his problems. :P

Riven

  • Sergeant at Arms
  • *
  • I know 37 ways to mutilate a kumquat.
    • View Profile
Re: More Python Troubles
« Reply #12 on: January 15, 2007, 11:56:00 AM »
Arg. Now it's turning up an error in module_triggers (I think that was it; not in a position to go check right now) that says I need a float argument somewhere? Any ideas?
Spam, Spam, Spam, Spam the Taleworlds forums!

Thog get jiggy with it!

(He doesn't say that, but he should.)

svaucher

  • Veteran
  • *
    • View Profile
    • http://www-etud.iro.umontreal.ca/~vauchers
  • M&B
Re: More Python Troubles
« Reply #13 on: January 15, 2007, 03:47:36 PM »
Arg. Now it's turning up an error in module_triggers (I think that was it; not in a position to go check right now) that says I need a float argument somewhere? Any ideas?

Another hunch, you are probably lacking an argument for a trigger. At some point the build module expects to see a number, but probably see a series of operations ( [<op_1>,<op_2>,...,<op_n>] instead of a number.

Remember every trigger has the following format:

(<number>, <number>, <number, or constant>, [<condition>], [<ops>]),

check the line mentioned, it should be relatively specific.