Jump to content

Modding inventory containers


Recommended Posts

So, I altered the backpack and belt (in both sequipview and sequipview_gc) to make them both smaller, like so:

5qO5t8d.jpg

But...when in the ground combat view, I'm able to swap the rifle and the pistol. I shouldn't be able to as the rifle is to big to go in the backpack. The image distorts and hangs past the edge of the backpack, like it's using the space that is normally there (i.e. a 5x5 pack rather than 3x3). Anyone know why this happens, and if it's preventable?

Link to comment
Share on other sites

Probably related to the code which auto-swaps weapons? I presume you can't manually place the rifle in the backpack and it only happens when you swap the pistol in for the rifle.

If that's the case, you probably can't do anything about it as it's probably in the source code. (For what it's worth, it works fine in vanilla if there's other items blocking all the valid tiles. What happens if you place a item on the left hand side before the pistol? Does it do the same thing then, or does the other item block it? Dunno if knowing that would be useful, just trying to think of work-arounds.)

Cool idea by the way - always feels to me like there's far more inventory space than necessary to make loadouts require some choice.

Link to comment
Share on other sites

Probably related to the code which auto-swaps weapons? I presume you can't manually place the rifle in the backpack and it only happens when you swap the pistol in for the rifle.

If that's the case, you probably can't do anything about it as it's probably in the source code. (For what it's worth, it works fine in vanilla if there's other items blocking all the valid tiles. What happens if you place a item on the left hand side before the pistol? Does it do the same thing then, or does the other item block it? Dunno if knowing that would be useful, just trying to think of work-arounds.)

Cool idea by the way - always feels to me like there's far more inventory space than necessary to make loadouts require some choice.

I think it's probably source code stuff...I changed the shape of the belt, putting extra slots under the two left ones, but I could only place single space items in there, ones that were say 2x1 (like shotgun shells) wouldn't work, as if the tiles weren't being recognised properly. Yeah, the two weapons will only swap position if I place them directly over each other (and only in the gc weirdly, doesn't do it in the base screen), so there's not much chance of a workaround.

I think it looks far better with the smaller containers. Reduces the universal soldier effect too. The other way to do it, which is what I'm doing now, is kinda the same, but doesn't look as slick. I'm making items bigger, but it looks a bit clumsy:

OWlEWDa.jpg

Primaries are now 6x2, so they don't fit in the pack. Nades are tricky, they look odd taking up four spaces, that'll probably be changed to 1x2. I toyed with putting them in molles (like the ammo in the pic), which works quite well because of the separate quick throw image being left as a normal un-molled nade. So it's wrapped up in the bag or belt, then taken out of the pouch for throwing. The general idea is to try and make things take up "x" amount more room...nerfing the backpack was something like 60% less capacity (5x5 to 3x3), that worked well.

EDIT: I've actually cracked it now, by a combination of the two approaches. I loaded up the small 3x3 backpack, but kept the primary weapon size as 6x2, and they don't swap. I think with the primary being too big for even the original size backpack (which probably ghosts in the background of the smaller one when modded in), I have managed to fool it.

Edited by Mikhail Ragulin
Link to comment
Share on other sites

Think I've found a work around.

Using the first version, just set the length of the item to 6 instead of 5.

Just tried this using a very rough mock-up and it worked fine.

(It occurred to me that you couldn't place 1x2 items in added belt sections, the game must have information on the inventory layout elsewhere too. That implied it might 'know' that the backback is 5x5, which is why the auto-swap would allow the swap even when you'd removed some of the slots because, in some way, it still thinks there's 5 tiles across. But since 5 is max, it probably wouldn't allow length 6 items in any case.)

Link to comment
Share on other sites

I am just trying to make my weapon selection box larger so that I can see more weapons without scrolling. I have edited various sections of the file but just cant get the desired results. Can anybody help.

Link to comment
Share on other sites

AAhhh haa I managed to get it done.

For anybody else who want to do the same. I edited the sequipview.lua script file in notepad. This script lives in the assets/scripts folder as was stated in an earlier post.

The parts I modified were:

{

name = "weaponselect",

x = kMax - (wsw * 1.0),

y = 0,

w = wsw,

h = wsh * 1.25,

image = "ui_screens/ui_stores/speechbubble",

bordersize = 4,

headersize = 23 * screenScaleY,

and a little bit further down

{

name = "weaponwindow";

x = wsw * 0.04,

y = wsw * 0.2,

w = wsw * 0.94,

h = wsh + (wsh * 0.13),

Window

This now lets me see more weapons without scrolling.

XenonautsWeaponList.jpg

XenonautsWeaponList.jpg

XenonautsWeaponList.thumb.jpg.51cd271e2b

Link to comment
Share on other sites

Another nice feature is getting the kills and no. of missions in the ground combat view:

5ffk3sh.jpg

Here's how:

Find this bit:

Container

{

name = "gcstats",

x = 10,

y = 20 * screenScaleY + 7,

change the y = 20 to y = 10, which moves the panel up a bit. Bung these two into the dotted label container section:

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statmissions",

name = "statmissions",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 6,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATMISSIONS",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statkills",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 7,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATKILLS",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

and also change y = 10 to y = 15 (keeping all the bits after it) in the primweaponframe, which moves it down a bit.

The kill total updates during the mission too. Could probably do with some cleaning up, maybe even moving to a different space.

Link to comment
Share on other sites

AAhhh haa I managed to get it done.

For anybody else who want to do the same. I edited the sequipview.lua script file in notepad. This script lives in the assets/scripts folder as was stated in an earlier post.

The parts I modified were:

{

name = "weaponselect",

x = kMax - (wsw * 1.0),

y = 0,

w = wsw,

h = wsh * 1.25,

image = "ui_screens/ui_stores/speechbubble",

bordersize = 4,

headersize = 23 * screenScaleY,

and a little bit further down

{

name = "weaponwindow";

x = wsw * 0.04,

y = wsw * 0.2,

w = wsw * 0.94,

h = wsh + (wsh * 0.13),

Window

This now lets me see more weapons without scrolling.

A quick word of warning. This method actually breaks the scroll bar:

W9YSeR3.jpg

I have twelve weapons in this category, but can't access them all due to the scroll bar not working. I shall take a look at it in due course.

Like this quite a bit. Good to see the kills and missions in there.

Yeah, it's one of the first things I noted to be missing when I got the game. Little things like that to help me bond with my 'nauts.

edit:

The scroll bar was borked because the weapon window was too big for its container (the weapon select window), which doesn't really matter unless there are extra weapons in the category. So, the bit in "weaponwindow" that says h = wsh + (wsh * 0.13) should be changed to h = wsh * 1.1, which keeps it within the boundaries and with it a functioning scroll bar.

Edited by Mikhail Ragulin
Link to comment
Share on other sites

Saw this in the bug reports, and he's onto something. I think this looks better, and more functionable:

lG7tg5t.jpg

May even move it up a bit more, and move the window above it. And reduce the title size, which seems to have grown too. Here's how to do it:

- open up scripts\personnelview

- scroll down a little bit (it's really early on in the file) to this: local cpbheight = hww / ( 1141.0 / 233.0 ) * 1.5;

- change the 1.5 to 2: local cpbheight = hww / ( 1141.0 / 233.0 ) * 2;

Makes it bigger by something%.

To make the title smaller ("Northern Africa"), look at the line below it: local pageHeaderHeight = cpbheight * 0.13;

Change the 0.13 to 0.09: local pageHeaderHeight = cpbheight * 0.09;, and it looks like this:

nlOwIkw.jpg

And then, we can shift the manage/hire window up a bit...

-find this bit, it's just past half way in the file:

name = "manage_tab",     x = sbx,     y = sbh1 * 0.4,     w = sbw,     h = sbh1,     image = "ui_screens/ui_stores/speechbubble",     bordersize = 4,

...change it to:

name = "manage_tab",     x = sbx,     [b]y = -25,[/b]     w = sbw,     h = sbh1,     image = "ui_screens/ui_stores/speechbubble",     bordersize = 4,

Then, we can make the clipboard even bigger. So go back to local cpbheight = hww / ( 1141.0 / 233.0 ) * 2;, and change the 2 to 2.35. Clipboard go bigger. Then, reduce the title height again: local pageHeaderHeight = cpbheight * 0.09;, change the 0.09 to 0.065 and...

oSURGBL.jpg

There's 17 soldiers on that list. They'll be room for 20 at least without scrolling. Can probably reduce the height of the lines to make it fit 24 comfortably.

Edited by Mikhail Ragulin
Link to comment
Share on other sites

Incase anyone else has had a problem with the default loadouts causing issues when modding item sizes or inventory layouts, thought I would post my fix of sorts. If you change the name of the medkit for example (weapon.grenade.medipack1) in Items.xml, weapons.xml, and weapons_gc.xml it will no longer load for the Rifleman default loadout but still work fine when placed afterwards. Although a small thing it was bothering me. Also research.xml needs changes for medkit and grenade so the replace with newer versions works.

Also Mikhail, I was testing your script changes for inventory size and noticed if you right click on grenades in equip view when slots are full it adds them to the invisible squares and there is no way to get them out. you can tell as your carry weight keeps going up as you right click items to add. I only used your 2 script files if I missed something related sorry for the alarm.

Link to comment
Share on other sites

Yeah, that's why in M'nauts the nade are called things like frag2 and smoke2, so the default loadouts don't load in.

Good find with the right-clicking. I didn't know one could fill a loadout like that. Unfortunately it shows the problem that was experienced with weapons that shouldn't have been able to fit...the size of the backpack is also determined somewhere else. I just gave it a go, and managed 33 nades and a shotgun, ha. They can be cleared out of the invisible spaces by clicking the equip default loadout.

Link to comment
Share on other sites

  • 2 months later...
Another nice feature is getting the kills and no. of missions in the ground combat view:

5ffk3sh.jpg

Here's how:

Find this bit:

Container

{

name = "gcstats",

x = 10,

y = 20 * screenScaleY + 7,

change the y = 20 to y = 10, which moves the panel up a bit. Bung these two into the dotted label container section:

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statmissions",

name = "statmissions",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 6,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATMISSIONS",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statkills",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 7,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATKILLS",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

and also change y = 10 to y = 15 (keeping all the bits after it) in the primweaponframe, which moves it down a bit.

The kill total updates during the mission too. Could probably do with some cleaning up, maybe even moving to a different space.

Followed this to a T, doesn't seem to work for me? I got the other two edits to work (soldier list screen, weapons list screen), but the two lines from this don't show. This is what I have:

Container

{

name = "gcstats",

x = 10,

y = 10 * screenScaleY + 7,

w = 140 * screenScaleX,

h = 10 * screenScaleY + ( 14 * screenScaleY ) * 6,

DottedLabelsContainer

{

name = "dottedLabelsCtr",

x = 0,

y = 0,

w = kMax,

h = kMax,

justifyDots = true,

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statapx",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 0,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATAP",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statresx",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 1,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATRESILENCE",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statstrx",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 2,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATSTRENGTH",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "stataccx",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 3,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATACCURACY",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statrefx",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 4,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATREFLEXES",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statbravx",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 5,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATBRAVERY",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statmissions",

name = "statmissions",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 6,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATMISSIONS",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

DottedLabel

{

font = XenonautsLabelFontMediumOrange,

name = "statkills",

x = 0,

y = 10 * screenScaleY + ( 14 * screenScaleY ) * 7,

w = kMax - 5,

h = 14 * screenScaleY,

left = "SEQ.STATKILLS",

right = "undefined",

leftcolor = OrangeTextColor,

dotscolor = WhiteColor,

rightcolor = OrangeTextColor,

fontScale = screenScaleY,

},

},

},name = "primweaponframe",

x = 30 * screenScaleX,

y = 15 * screenScaleY + ( 14 * screenScaleY ) * 6 + 20 * screenScaleY + 7,

w = 5 * Floor( 23 * screenScaleX ),

h = 23 * screenScaleY + ( 5 * Floor( 23 * screenScaleX ) * 2 / 5 ),

headimage = "uitextures/sequip/frametoptrans",

bodyimage = "uitextures/sequip/framebottomtrans",

bordersize = 2,

headersize = 23 * screenScaleY,

I bolded all the parts you mentioned to change.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...