RUNNING WITH RIFLES
http://www.runningwithrifles.com/phpBB3/

Squad Question?
http://www.runningwithrifles.com/phpBB3/viewtopic.php?f=7&t=2687
Page 1 of 1

Author:  CptGallium [ Tue Dec 29, 2015 10:48 pm ]
Post subject:  Squad Question?

Is it possible to make a mod that allows a player to have more than 10 squadmates?

I have been working on a mod to do this but seem to be at a loss.

Thanks.

Author:  pasik [ Wed Dec 30, 2015 8:32 am ]
Post subject:  Re: Squad Question?

There's a chance it's possible. There are squad_member_xp_cost and squad_size_xp_cap parameters for soldier tag in the faction file. By default they are 0.1 and 1.0, giving you max 10 mates at 1.0 (10000) XP.

From what I can tell, the squad member icon set with hud_squad*.png is clamped between 0 and 10, but the system should still allow more members and show it correctly in text.

Author:  CptGallium [ Wed Dec 30, 2015 8:49 pm ]
Post subject:  Re: Squad Question?

I got it working, please read below for instructions:

Step 1:
Add squad_size_xp_cap="2.0" to the "default group" section of green.xml file:
Code:
<soldier name="default" spawn_score="1.0" squad_size_xp_cap="2.0" >

The "squad_size_xp_cap" increases the number allowed to join your squad. It does not increase the soldiers actually joining your squad. That number still caps at 10. So you end up with 10/14 or 10/20.

1.0 = 10 squadmates and 2.0 = 20 squadmates

Step 2:
Update the squad configuration files. By adding additional <soldier /> tags, it increases the additional soldiers actually joining your squad.

Below is the new code from default.squad_config file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<squad_config name="Default">
   <soldier />
   <soldier weapon2_tag="medikit" />
   <soldier />
   <soldier />

   <soldier />
   <soldier />
   <soldier />
   <soldier />

   <soldier />
   <soldier />
   <soldier />
   <soldier />
   
   <soldier />
   <soldier />
   <soldier />
   <soldier />
   
   <soldier />
   <soldier />
   <soldier />
   <soldier />
</squad_config>

There are 20 soldier tags which correspond with squad_size_xp_cap="2.0"

Step 3:
Make a hud_squad11.png, hud_squad12.png, etc ....

You can copy hud_squad10.png and rename the copy to hud_squad11.png or you can create your own.

Hope this helps everyone ... :D

Author:  pasik [ Thu Dec 31, 2015 12:36 am ]
Post subject:  Re: Squad Question?

Nicely done! I completely forgot the squad config and that its 10 entries would have an effect to it, nice job finding that!

Had to recheck the remark about the icon set index being clamped; there's actually a bug that the clamped value isn't in fact used at all :lol: Lucky break we've never hit the issue of non-existing icons due to the max 10 being forced by squad configs / default parameters. Won't be fixing this one as it allows proper modding too.

Author:  The Soldier [ Thu Dec 31, 2015 2:08 am ]
Post subject:  Re: Squad Question?

We have a budding modder here. Something I've never done before - well done, Galliium. :)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/