Multiplayer Troop Classes/Divisions/Whatever *SOLVED

正在查看此主题的用户

phoenixguard09

Knight at Arms
Hi everyone,

After an extensive search, I found one thread which came close to the question I am about to ask but unfortunately it was about 7 months dead and my post would have been a bit off topic.  So...

How can I set a MP troop to a certain class/division/whatever?  Because I want to set a horse archer type unit to Archers and not Cavalry. Thanks in advance. 
 
Thanks Somebody, should that be at the end, as in, after  "#for multiplayer mode" but before "#faction banners" or should I be putting it before "#for multiplayer mode."  Hang on, I am supposed to put this in scripts.py right?
 
phoenixguard09 说:
Thanks Somebody, should that be at the end, as in, after  "#for multiplayer mode" but before "#faction banners" or should I be putting it before "#for multiplayer mode."  Hang on, I am supposed to put this in scripts.py right?

Doesn't matter. Yes.
 
Caba`drin 说:
Troop_set_class was introduced in 1.134.
Apparently you're not using the most recent Module System.

Ouch! that sucks. Use winmerge to compare the native modules of 1.134 and the Native module version your mod is based on to see what needs to be updated. 
 
Oh bugger.  Well I'd better go see what I can do then.  :sad:  Thanks guys.

Actually another question.  Would you guys consider it a good idea to just transfer my differences over onto the 1.134 ModSys?  I can't get 1.134, for some reason I can't patch, so would the mod still work on 1.132 if I transfer it over onto 1.134?  I hope that you guys can understand my rambling there.
 
If you just want access to the new modder features of 1.134, and don't care about the single player bug fixes: copy across header_operations.py, header_triggers.py, header_items.py, header_scene_props.py, module_postfx.py, and if you haven't edited it and want to use the bayonet animation, module_animations.py. For troop_set_class, you only need header_operations.py, but you might as well copy the rest - some nice stuff in there.
 
Oh that's excellent, thanks a lot Vornne. :grin:  I probably won't use the Bayonet animation, mainly because I don't know what I've done to module_animations as I tried to incorporate a shield bash before.  But anyway, thanks a bunch guys. :wink:
 
Ok sorry about the double post but I figured that it would slide down the page and no one would see if I editted. 

I put the line "troop_set_class, "trp_khergit_veteran_horse_archers_ai", grc_archers" in and, well I'm getting the attribute error,
插入代码块:
'int' object has no attribute 'lower'

I have no idea. 
It's ok, I accidentally put it in twice.  Found it and took it out.  But its still having no effect in game. Khergit Horse Archer bots are still selected with the Cavalry key. 
 
Well I left it for two days so *BUMP*

It's not like its a massive issue I suppose but its still irritating.  So any suggestions?  To recap, I implemented Somebody's code in  module_scripts after doing what Vornne said about replacing those header files.  I put them in several places in module_scripts and yet horse archer bots in MP are still selected along with other cavalry. 
 
Just thought I'd post my solution for anyone who is interested. 

The classes are determined by the flags,
插入代码块:
tf_guarantee_ranged
(which denotes the troop as an Archer and
插入代码块:
tf_mounted or tf_guarantee_horse
which determines Cavalry. I'm not sure which one determines it, but I believe that it might have to be both together, otherwise they are counted as Infantry.

So to get a Horse Archer, you only need the flags,
插入代码块:
tf_guarantee_ranged & tf_guarantee_all
for some odd reason guaranteeing all doesn't override the guarantee ranged like guaranteeing horses and yet it still acounts for it I think. 

Thanks for the help guys, and I hope that this was helpful to some people.
 
后退
顶部 底部