More Python Troubles

正在查看此主题的用户

Riven

Sergeant at Arms
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 :razz:) 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.
 
Riven 说:
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.

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.
 
...

: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 :grin:
 
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?
 
Riven 说:
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 :grin:

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.
 
Ooh. It's not resolved, but that'll give me a better handle on it. I'll tell you here when I nail it :wink:
 
I'm assuming you've set reyvadin_mercs to your new troop types? I need to know before I can offer any suggestions...
 
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.
 
Hellequin 说:
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
 
Riven 说:
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.
 
Winter - Oh, I know I'm correct about the factual stuff.  The guesswork is that this is, in fact, the source of his problems. :razz:
 
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?
 
Riven 说:
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.
 
后退
顶部 底部