Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - darkestaxe

Pages: [1] 2 3 ... 12
1
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: September 14, 2018, 04:35:34 pm »
The last one looks good to me if we're going with 1 gear item.

It would give us a place to pick one big utility item regardless of it's size, while still preferring smaller or easier to fit utility items in the rest of the inventory. This way a towel might actually get used, but won't necessarily be the only utility item anyone would choose.

Assuming meridian adds slot restrictions, I don't think current OXCE+ will be work with piratez. One issue I know of is that STR_UNAVAILABLE will be ignored unless we create a research project for it. Solution, make researching STR_UNAVAILABLE depend on STR_UNAVAILABLE, since STR_UNAVAILABLE will then be a valid research topic and will be enforced, even for itself. Otherwise we all get to build an Eye Of Horus at the beginning of the game.

2
XPiratez / Re: Bugs & Crash Reports
« on: September 13, 2018, 08:12:14 am »
I get a segmentation fault if a beastmaster surrenders while in her suit. I blasted the suit off her and knocked her out and was able to complete the mission.

3
XPiratez / Defensive layout strategies
« on: September 05, 2018, 02:18:07 am »
I recently had a base defense mission where I realized my 'defensive' layout was about as horrible as I could have possibly created. After thinking about it for a bit I can't really come up with a reasonable way to make any reasonable defensive layout.

First off, it turns out the fire-trap doesn't grate sewers and isn't very lethal to invaders, it just keeps you separated from your enemies for a while. Worse dirt is also sewer accessible. Apparently corridors are the only way to avoid fighting in sewers. Sewers are very slow to traverse and fighting there is definitely not my idea of a fun afternoon.

Beast dens are the only facility that blocks roof passage. Thus the only way to force enemies to fight you in an accessible focal point would be to surround your access and hangers with a layer of corridors, surrounded by a layer of dirt?

Thoughts? It looks like the 'defensive' layouts on Piratez-ufopedia are for early versions. I heard your bases get assaulted monthly after a while, and I'd like to know how to keep those defense missions down to a few hours each, or even 30 mins. No sewer treks.

4
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: September 01, 2018, 07:31:25 am »
Yeah but I'm concerned with inventory cluttering... Also... A though, if you go Nudist, why should you be allowed to "cheat" by wearing clothes? If you want to fight while wearing clothes, um... wear clothes?

Using the latest version, the size of the Aux slot can be managed per-outfit in the same way as the backpack is currently, with fake weapon blocks.

I myself don't really know how much of it should be blocked on different outfits since I'm still new to Piratez and haven't even made it to the mid-game. I'm still trying to figure out what I can safely shoot down with 20mm and a laser charger, and it's even worse on the battlescape. I keep equipping all these hundreds of different guns, and always still take out cattle-prods after every gun fails to take down anything. Except for that shotgun with the .6g cause it can butt-smack them, and the roto-gun which kills all the not dangerous stuff that I wanted to make slaves out of. Oh, right, moral grenades are starting to seem like they might be effective though, and I just got some dojos so I'll have to see if any of my gals can do anything with guns in a couple months. Plus something I'm reaserching about enterprise is supposed to make it so I can buy lasers.

BTW, I'm pretty sure medpacks don't really train bravery, but I have yet to patch 20 wounds with the same soldier in a battle so I can't be sure. What was I talking about? I'm gonna go test the medkit bravery thing.

5
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: August 31, 2018, 09:05:36 pm »
999 TU idea could work, sort of, but remember I've already posted OXCE+ code changes that would add exactly what we need to do it properly. Slot restriction levels.

Code: [Select]
invs:
   -   type: STR_AUX
       restrictionLevel: 2

Restriction level 2 will make a slot accept only those items with allowedInventorySlots listing that slot. Thus we would only have to do allowedInventorySlots for utility items that belong in the AUX slot.

This is all assuming someone with visual studio and github is willing to try building with my code, and if it builds, pushes it to Meridians branch. The code changes to add gear slot restriction levels are really small and if we need it for Piratez gear slots, I doubt Meridian will say no.

6
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: August 30, 2018, 11:31:34 pm »
So I'm thinking just 2 isn't really enough, but BIS for every slot is too hard, and we don't even necessarily need that. Also, some utility items probably have other places they should be equipped, like backpack slot gear should go ... guess where. Can u guess? Hel charms should continue to fill ur inventory. If you could wear a shield without using inventory space, then it would be an outfit. Maybe 'don't panic' towel can just go anywhere it fits, including aux slots?

Alright here's what I got now:
(Note, for now you have to pretend that non-utility items won't go in places that they shouldn't. And this is just a demo, not complete.)

7
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: August 30, 2018, 04:21:54 am »
Lol. OK, good thing you reminded me of this. It is an interesting feature, however I don't see how this would allow fitting all the cool gear... Maybe if you used 1x1 slots? There is at least 10 gear slots atm.
Not even mentioning the scary amount of work it would take to set these parameters for every single item in the game.

The link is to a thread where I posted code so we wouldn't have to add those parameters for every single item. https://openxcom.org/forum/index.php/topic,6543.0.html

So, darkestaxe? Do you think it is possible to rearrange slots in such a way that this works? 2 aux slots are nice but likely not enough... And it's not really acceptable how the paperdoll is squashed from our right.

If we're willing to put the slots over the doll, then yes. Some items might have to be shrunk a little but I think all the slots should be able to fit. Problem, there would be squares all over the doll!

Hmm, I think you could add a sequence of aux slots, each next about 16 px lower than the last to save space, each partially occluding the previous one. Would not look pretty, but could work...

But 10? IDK about 10. That would create a lot of cursor bugs.

We could use all 1x1 slots and make all the gear items 1x1. At least coat and towel would have to shrink or they would cover way too many squares around them. We would also have to cut the backpack max size down to 3x3 or limit to 5, maybe 6 slots.

Dioxine, what do you think of reworking some of the gear-slot items' art to be able to fit on something like the pics below? Because overlapping a little is one thing, but a raincoat centered on a box in that grid would cover-up an awful lot of stuff, and even more overlap on the ground.

Otherwise there's the idea I talked about in my last post up; about putting the slots on the doll and making code to hide (not draw) the squares. Dioxine would you want to have items go directly on the doll? Because some things like the bra already look kinda like you could just stick them right on the doll. Then the bootypedia could say "To equip a synthread bra on a Gal, put it onto her boobs so it covers up both of her nipples. :P"

8
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: August 29, 2018, 05:22:12 am »
I am not aware of any code that lets you limit what can be carried in an inventory slot.

supportedInventorySections: on an item. That's the code I was showing earlier. I made an example that works with current OXCE+ for the last couple years.

https://openxcom.org/forum/index.php/topic,6543.0.html - Thread where I posted code changes to add a property to the actual slot that limits default items with no supportedInventorySections: also.

Code: [Select]
#We can use the supportedInventorySections: parameter to limit an item to certian inventory locations.
#This has no effect on the ground, which is always allowed, and no effect on other items.
items:
  - type: STR_NOOSE
    #With everything listed except QD, we block the rope from the QD slot.
    supportedInventorySections:
      - STR_RIGHT_HAND
      - STR_LEFT_HAND
      - STR_BELT
      - STR_BACK_PACK
      - STR_RIGHT_LEG
      - STR_LEFT_LEG
      - STR_RIGHT_SHOULDER
      - STR_LEFT_SHOULDER
  - type: STR_FIRST_AID_KIT
    #Same thing, but first aid kit can now only go in your left hand.
    supportedInventorySections:
      - STR_LEFT_HAND

Pic shows this example being tested, the medkit in the belt was already there, attempting to pick it up and put it back in the belt generated the same error.

9
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: August 28, 2018, 01:48:03 pm »
I posted the remaining code to restrict by slot over in the extended+ forum so we'll just have to wait and see, unless someone wants to add a list of allowed slots to the ruleset for every single equipable item in all of Piratez.

In the meantime it's quite easy to add, remove, or rearrange equipment slots in the ruleset, so I went ahead and toyed with a proof of concept.

It works, sort-of, as seen in the first image, but it's basically just a couple more spots to put anything you want for now.

The bigger issue now, I think, is that many gear items are simply to large to make small slots for them. For my demo I used type 1 slots (holds 1 item of any size) which take up a lot of space. Hypothetically if we did use my layout, someone would need to go through all the soldier images and shift each one about 8 pixels over. That wouldn't be too difficult, but whoever had to do it might very well break down and just start crying after a few hundred of them. I wouldn't blame them.

A better solution might be to shrink the graphics for the gear items themselves, especially since many of them aren't all that big anyway. Also, as you can see in my images, the text on top of gear slots is optional, though I still don't really like the idea of putting brown boxes all over the beautiful outfit art.

A more ambitious implementation would be to add a 'hidden' option to gear slots as well as a 'behind' option. Hide the squares (more accurately, don't draw them) and let players seem to put the gear items directly on the soldier, with the back-slot items rendering behind (before) the soldier image. Then scale/edit gear items graphics to match the soldier image. That way when you put a bra on a gal, it looks like she's just wearing the bra. (Changes to render order might be more then Meridian would allow.)

As an added bonus it would look absolutely hilarious for a male slave wearing a bra over his superman outfit! As for the height difference there'd have to be 2 versions of some of the slots with one blocked off by fixed weapons, though the fakes could be transparent for slots that are already invisible.

If there's interest in my more ambitious idea, I'm game for attempting to figure out the CE+ code to make it work. Assuming it's not already there...

10
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: August 27, 2018, 08:43:33 pm »
For what purpose, pissing the player off?

No, my whole idea is that bras and towels should have their own dedicated inventory location. I had thought that was the intended idea with those 'gear' items in the first place. I thought the whole idea was that scarf equips to the neck slot like it says, and we only stick it in backpacks because OXC doesn't support a 'neck' slot for only neck slot items.

If I were to make a mod that shifted the standard equipment slots around and added dedicated gear holder slots, then I'd need a way to make those slots a place only for those items. Otherwise I'd just be adding a place to stick a Canteen o Wisdom or booze on nude armor. Aside from breaking balance, there still wouldn't be any way to justify equipping a scarf or towel.

Due to size concerns on the equip screen I don't think there's room for a neck, back, bra, legs each so they might have to share 1 or 2 slots, but at least they wouldn't just fill up your backpack.

11
OXCE Suggestions DONE / Re: [Sugestion] Ufopedia window bigger
« on: August 26, 2018, 12:55:06 am »
How about << and >> buttons at the bottom to cycle pages? It's not that great for usability maybe, compared to proper scrolling, but if you can use the cursor keys to change the page I think it would be okay.

It would allow a major improvement to Piratez current method of listing all 14,838,976 "Tools of The Trade" in one category that's 3,960,476 pages long. A second page of categories could reduce the time it takes to find X-Nipple Mounted LasScatter entry to less then ten minutes.

Hmm, there should probably be a nipple mounted laser shotgun in Piratez too! Maybe I should work on a mod for that after I make a mod for gear slots.

12
Currently OXCE+ allows items to be restricted to a list of supported inventory slots but doesn't allow the inventory slot to be restricted to supported items. For example, as a ruleset moder I could make it so that STR_RIFLE_CLIP can only go in slot STR_CLIP_HOLDER, but short of adding an applicability list to every equipable item in the game I can't make it so that only STR_RIFLE_CLIP, or only clips, can go in STR_CLIP_HOLDER. Right now we want this feature for Piratez to add a dedicated utility items slot without having to add a list of all other slots to every non-utility item.

I want to add a property "PlacementRestrictionLevel" to inventory slots that, when set >1, causes applicability to be enforced for all items. By default slots would have restriction level 1 and only enforce applicability for items that have a non-null applicability list. PlacementRestrictionLevel: 0 (or any slot named "STR_GROUND") would ignore applicability entirely. Useful for a backpack maybe.

First we have to add the property and a getter in Mod/RuleInventory.cpp to add support in the ruleset.
Code: [Select]
/**
 * Creates a blank ruleset for a certain
 * type of inventory section.
 * @param id String defining the id.
 * @param _resLevel int restriction level for item placement.
 */
RuleInventory::RuleInventory(const std::string &id): _id(id), _x(0), _y(0), _type(INV_SLOT), _resLevel(1), _listOrder(0), _hand(0)

void RuleInventory::load(const YAML::Node &node, int listOrder)
{
_resLevel = node["PlacementRestrictionLevel"].as<int>(_resLevel);

/**
 * Gets the restriction level. 0 never restricted, 1 restricted for items with slot lists (default), 2 always restricted.
 * @return restriction level.
 */
bool RuleInventory::getResLevel() const
{
return _resLevel;
}
With the property added we need to send the slots resLevel to the item along with the slots string ID when we check for compatibility in BattleScape/Inventory.cpp.
Code: [Select]
/**
 * Picks up / drops an item.
 * @param action Pointer to an action.
 * @param state State that the action handlers belong to.
 */
void Inventory::mouseClick(Action *action, State *state)
{
// Check if this inventory section supports the item
if (!_selItem->getRules()->canBePlacedIntoInventorySection(slot->getId(), slot->getResLevel()))
And finally we need to catch the resLevel parameter and use it to determine item applicability in Mod/RuleItem.cpp.
Code: [Select]
/**
 * Checks if the item can be placed into a given inventory section.
 * @param inventorySection Name of the inventory section (RuleInventory->id).
 * @param resLevel restriction level of the inventory section (RuleInventory->_resLevel).
 * @return True if the item can be placed into a given inventory section.
 */
bool RuleItem::canBePlacedIntoInventorySection(const std::string &inventorySection, int &resLevel) const
{
// allow default items in unrestricted inventory sections.
if (resLevel == 1 && _supportedInventorySections.empty())
return true;

// always possible to put an item on the ground or in fully unrestricted slots
if (inventorySection == "STR_GROUND" or resLevel == 0)
return true;

// otherwise check allowed inventory sections
return std::find(_supportedInventorySections.begin(), _supportedInventorySections.end(), inventorySection) != _supportedInventorySections.end();
}

I submitted a pull request for the code as I wrote it to the Meridian branch for convenience. I triple checked it a few times and I don't think there's anything blatantly wrong in it, but IDC if you use my code or even do it the way I came up with. My approach was to do it without adding any new functions except a getter, and put it alongside your old code.

PS, huge thanks for all the work extending OXC! And thanks for reading all this too btw.

13
XPiratez / Re: Custom inventories, gear slots and OXCE limitations
« on: August 25, 2018, 09:26:58 am »
Oh, ok I get it now. The fixed weapons in the armors are being used to plug unused inventory slots, and OXC already allowed u to define extra slots, and Piratez just put that in a different .rul somewhere.

So now we just need to figure out how to add a property to an item that limits which inventory sections it can be placed in, add a hook right where the game checks to see if the item fits and there are enough time units, input an extra check for whether the given item can be placed in said inventory slot, else inform user STR_ITEM_CANT_GO_HERE.

Quote from: Inventory.cpp
Code: [Select]
void Inventory::mouseClick(Action *action, State *state)
{
  ...
// Check if this inventory section supports the item
if (!_selItem->getRules()->canBePlacedIntoInventorySection(slot->getId()))
{
_warning->showMessage(_game->getLanguage()->getString("STR_CANNOT_PLACE_ITEM_INTO_THIS_SECTION"));
}
Quote from: RuleItem.cpp
Code: [Select]
/**
 * Checks if the item can be placed into a given inventory section.
 * @param inventorySection Name of the inventory section (RuleInventory->id).
 * @return True if the item can be placed into a given inventory section.
 */
bool RuleItem::canBePlacedIntoInventorySection(const std::string &inventorySection) const
{
// backwards-compatibility
if (_supportedInventorySections.empty())
return true;

// always possible to put an item on the ground
if (inventorySection == "STR_GROUND")
return true;

// otherwise check allowed inventory sections
return std::find(_supportedInventorySections.begin(), _supportedInventorySections.end(), inventorySection) != _supportedInventorySections.end();
}
Code: [Select]
/**
 * Loads the item from a YAML file.
 * @param node YAML node.
 * @param mod Mod for the item.
 * @param listOrder The list weight for this item.
 */
void RuleItem::load(const YAML::Node &node, Mod *mod, int listOrder, const ModScript& parsers)
_supportedInventorySections = node["supportedInventorySections"].as< std::vector<std::string> >(_supportedInventorySections);

OMFG it was there all along?!?!?!?! WTF
Quote from: MeridianOXC committed on Oct 31, 2016
Items can now be limited to certain inventory slots only

hahaha 2 years ago? WOW! NVM guys meridian already gone and done fixed it already. Guess the next project is making a mod for Piratez that adds the new slots and associated item requirements.

14
XPiratez / Custom inventories, gear slots and OXCE limitations
« on: August 24, 2018, 06:55:18 am »
I was looking into the idea of adding gear slot functionality into CE and while I think I've found the right part of the OXCE code, but then things got strange...

Is Piratez using a custom version of OXCE to add inventory layouts to armor types? And why/how are we using fixed weapons as inventory slots? If someone did add proper support for custom inventory layouts into OXCE ... would that even help piratez?

I mean what the flying tits is this?
Code: [Select]
armors:
  - type: STR_PIR_CASTAWAY_ARMOR_UC
    spriteSheet: PIR_489.PCK
    spriteInv: MAN_489
    builtInWeapons: // WAAAAAAHt?!?
      - INV_NULL_4X3
      - INV_NULL_2X1_LS
           ...
      - INV_NULL_1X2_QD //This built in weapon is the Quickdraw slot for this armor?
items:
  - type: INV_NULL_1X2_QD
    invWidth: 1
    invHeight: 2
    fixedWeapon: true
    defaultInventorySlot: STR_QD_SLOT //But where is STR_QD_SLOT defined?

15
XPiratez / Re: Bugs & Crash Reports
« on: August 16, 2018, 02:17:42 am »
Ah, so your not supposed to start with them?

Pages: [1] 2 3 ... 12