Jump to content

Looking For Cigar/Lucky Goggles Combo


ModKeep

Recommended Posts

I thought I saw a mod that combines the effects of the Cigar and the Lucky Goggles.  A face item that has the trade bonus and the looting bonus.  It would be nice not to have to switch back and forth all the time.  Most of the time I forget to equip the cigar.  A20 version please.  Thanks in advance.

Link to comment
Share on other sites

You will need to edit 3 files total, but lets look at items.xml first...
 

<!-- Cigar -->
<item name="apparelCigar">
	<property name="Tags" value="head,clothing,noMods"/>
	<property name="DisplayType" value="clothingCigar"/>
	<property name="UnlockedBy" value="perkUrbanCombatCigar"/>
	<property name="Material" value="Mplants"/>
	<property name="Stacknumber" value="1"/>
	<property name="DegradationBreaksAfter" value="false"/>
	<property name="EconomicValue" value="500"/>
	<property name="HoldType" value="45"/>
	<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
	<property name="Group" value="Clothing"/>
	<property name="EquipSlot" value="Face"/>
	<property class="UMA">
		<property name="Mesh" value="gear_cigar"/>
		<property name="Overlay0" value="gear_cigar"/>
		<property name="Layer" value="1"/>
		<property name="UISlot" value="Face"/>
	</property>
	<effect_group tiered="false">
		<passive_effect name="ModSlots" operation="base_set" value="0"/>
		<passive_effect name="AttributeLevel" tags="attStrength" operation="base_add" value="1"/>
		<passive_effect name="BarteringBuying" operation="base_add" value=".1"/>
		<passive_effect name="BarteringSelling" operation="base_add" value=".1"/>
	</effect_group>
</item>

<!-- Lucky Goggles -->
<item name="apparelAviatorGoggles">
	<property name="Extends" value="apparelShades"/>
	<property name="Material" value="Mleather"/>
	<property name="DisplayType" value="clothingAviatorGoggles"/>
	<property class="UMA">
		<property name="Mesh" value="aviator_goggles"/>
		<property name="Overlay0" value="aviator_goggles"/>
	</property>
	<effect_group tiered="false">
		<passive_effect name="ModSlots" operation="base_set" value="0"/>
		<passive_effect name="LootGamestage" operation="base_add" value="3,5.2"/>
		<passive_effect name="TreasureBlocksPerReduction" operation="base_add" value="-1"/>
		<display_value name="dTreasureBlocksPerReduction" value="-1"/>
	</effect_group>
</item>


In the above code are both items for Cigar and Lucky Goggles.

We can combine both effects into one item, and call it LuckyCigar...
 

<item name="LuckyCigar">
	<property name="Tags" value="head,clothing,noMods"/>
	<property name="DisplayType" value="clothingCigar"/>
	<property name="UnlockedBy" value="perkUrbanCombatCigar"/>
	<property name="Material" value="Mplants"/>
	<property name="Stacknumber" value="1"/>
	<property name="DegradationBreaksAfter" value="false"/>
	<property name="EconomicValue" value="500"/>
	<property name="HoldType" value="45"/>
	<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
	<property name="Group" value="Clothing"/>
	<property name="EquipSlot" value="Face"/>
	<property class="UMA">
		<property name="Mesh" value="gear_cigar"/>
		<property name="Overlay0" value="gear_cigar"/>
		<property name="Layer" value="1"/>
		<property name="UISlot" value="Face"/>
	</property>
	<effect_group tiered="false">
		<passive_effect name="ModSlots" operation="base_set" value="0"/>
		<passive_effect name="AttributeLevel" tags="attStrength" operation="base_add" value="1"/>
		<passive_effect name="BarteringBuying" operation="base_add" value=".1"/>
		<passive_effect name="BarteringSelling" operation="base_add" value=".1"/>
		<passive_effect name="LootGamestage" operation="base_add" value="3,5.2"/>
		<passive_effect name="TreasureBlocksPerReduction" operation="base_add" value="-1"/>
		<display_value name="dTreasureBlocksPerReduction" value="-1"/>
	</effect_group>
</item>


Next you will need to edit ui_display.xml, and the value we're looking for here is 'clothingCigar'.

     <item_display_info display_type="clothingCigar" display_group="groupAttire" >
            <display_entry name="AttributeLevel" tags="attStrength" title_key="statShowStrength" display_leading_plus="true"/>
            <display_entry name="BarteringBuying" title_key="statBarteringSellBuy" display_type="Percent" display_leading_plus="true"/>
        </item_display_info>


As things stand you will have a new item in game with the effects of both the cigar and lucky goggles, but this interface will only show the effects of the cigar... so in the items.xml change the the following line:

<property name="DisplayType" value="clothingCigar"/>


To a new name, e.g.

<property name="DisplayType" value="LuckyCigar"/>


Then in ui_display.xml, make the same name changes...

		<item_display_info display_type="LuckyCigar" display_group="groupAttire" >
			<display_entry name="AttributeLevel" tags="attStrength" title_key="statShowStrength" display_leading_plus="true"/>
			<display_entry name="BarteringBuying" title_key="statBarteringSellBuy" display_type="Percent" display_leading_plus="true"/>
		</item_display_info>


But add in the values from 'clothingAviatorGoggles' in ui_display.xml too...

		<item_display_info display_type="clothingAviatorGoggles" display_group="groupAttire">
			<display_entry name="LootGamestage" title_key="statLootGamestage" display_leading_plus="true"/>
			<display_entry name="dTreasureBlocksPerReduction" title_key="statTreasureRadius" display_leading_plus="true" negative_preferred="true"/>
		</item_display_info>


So your new ui_display.xml block will look like this..

		<item_display_info display_type="LuckyCigar" display_group="groupAttire" >
			<display_entry name="AttributeLevel" tags="attStrength" title_key="statShowStrength" display_leading_plus="true"/>
			<display_entry name="BarteringBuying" title_key="statBarteringSellBuy" display_type="Percent" display_leading_plus="true"/>
			<display_entry name="LootGamestage" title_key="statLootGamestage" display_leading_plus="true"/>
			<display_entry name="dTreasureBlocksPerReduction" title_key="statTreasureRadius" display_leading_plus="true" negative_preferred="true"/>
		</item_display_info>


Finally, reference this block in the items.xml

<item name="LuckyCigar">
	<property name="Tags" value="head,clothing,noMods"/>
  	<property name="CustomIcon" value="apparelCigar"/>
	<property name="DisplayType" value="LuckyCigar"/><!-- this property -->
	<property name="UnlockedBy" value="perkUrbanCombatCigar"/>
	<property name="Material" value="Mplants"/>
	<property name="Stacknumber" value="1"/>
	<property name="DegradationBreaksAfter" value="false"/>
	<property name="EconomicValue" value="500"/>
	<property name="HoldType" value="45"/>
	<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
	<property name="Group" value="Clothing"/>
	<property name="EquipSlot" value="Face"/>
	<property class="UMA">
		<property name="Mesh" value="gear_cigar"/>
		<property name="Overlay0" value="gear_cigar"/>
		<property name="Layer" value="1"/>
		<property name="UISlot" value="Face"/>
	</property>
	<effect_group tiered="false">
		<passive_effect name="ModSlots" operation="base_set" value="0"/>
		<passive_effect name="AttributeLevel" tags="attStrength" operation="base_add" value="1"/>
		<passive_effect name="BarteringBuying" operation="base_add" value=".1"/>
		<passive_effect name="BarteringSelling" operation="base_add" value=".1"/>
		<passive_effect name="LootGamestage" operation="base_add" value="3,5.2"/>
		<passive_effect name="TreasureBlocksPerReduction" operation="base_add" value="-1"/>
		<display_value name="dTreasureBlocksPerReduction" value="-1"/>
	</effect_group>
</item>


This will give you a new item with the properties of both the Cigar and Lucky Goggles, using the appearance of the Cigar.

I have also added a custom icon to the code above so it displays as a cigar in your inventory.

The only other file you might want to change would be localization.txt for the name and description.

Link to comment
Share on other sites

Thank you for this.  I will try it out when I have some spare time.  I was looking through some of the code on other mods I downloaded to see how they work and planned on trying to figure out how to do this.  It is so nice to be part of a community that is willing to teach someone new to modding how to do it.  Thank you.

Link to comment
Share on other sites

1 hour ago, BFT2020 said:

Don’t forget to put it the world via crafting, looting, and/or traders.


I think this will make changes to loot.xml, progression.xml, traders.xml and recipes.xml, so will be a good way to learn about editing different things in game, and how they all link together

Link to comment
Share on other sites

Okay here is a link to download the mod:

 

LuckyCigar via GitHub

 

I have left comments in some of the files to help you understand how everything works and links together

 

Essentially this adds a new item Lucky Cigar into the game. It is locked by default.

You unlock it by reading Urban Combat Vol 2 (the same book which unlocks the normal Cigar), once unlocked you can craft it using the same resources as the normal Cigar.

It also appears in the same loot groups as the normal Cigar, and shows up in the same trader group.

Link to comment
Share on other sites

I figured it out.  The sexual tyrannosaurus perk unlocked the regular cigar.   Also I was thinking of adding 1 gold nugget to the recipe.  I understand how to now but don't know how to reference it.  Is there a list of the items internal names?  I looked at the wiki but didn't find anything.

 

Am I missing the edit post button?  I don't like to triple post.

Link to comment
Share on other sites

1 hour ago, ModKeep said:

They both use the face slot.  I don't see how that would be possible.

That seems weird (and definitely not what the xml file indicates).  Cigar uses the Face UI Slot while the lucky goggles use the Eyes UI Slot (Lucky goggles extend from the Shades which is Eyes UI Slot).  Unless something else was setup wrong elsewhere and there is a conflict between the two.  I know my survivor has transition between bandana to cigar while wearing eyewear, though I can't recall if I had cigar and the lucky goggles on at the same time.  Going to try that out tonight when I am working on my modlets.  My initial thought was that combining lucky goggles with the cigar was for people to get both bonuses and still be able to wear nerdy glasses.

 

<item name="apparelCigar">
.....
    <property name="EquipSlot" value="Face"/>
    <property class="UMA">
        <property name="Mesh" value="gear_cigar"/>
        <property name="Overlay0" value="gear_cigar"/>
        <property name="Layer" value="1"/>
        <property name="UISlot" value="Face"/>
    </property>


 

<item name="apparelBandana"> <!-- item name directly referenced in the code -->
.......
    <property name="EquipSlot" value="Face"/>
    <property class="UMA">
        <property name="Mesh" value="gear_bandana"/>
        <property name="Overlay0" value="gear_bandana"/>
        <property name="Layer" value="1"/>
        <property name="UISlot" value="Face"/>
        <property name="Mask0" value="Face" param1="base"/>
  </property>

 

item name="apparelAviatorGoggles">
    <property name="Extends" value="apparelShades"/>
    <property name="Material" value="Mleather"/>
    <property name="DisplayType" value="clothingAviatorGoggles"/>
    <property class="UMA">
        <property name="Mesh" value="aviator_goggles"/>
        <property name="Overlay0" value="aviator_goggles"/>
    </property>
    <effect_group tiered="false">
        <passive_effect name="ModSlots" operation="base_set" value="0"/>
        <passive_effect name="LootGamestage" operation="base_add" value="3,5.2"/>
        <passive_effect name="TreasureBlocksPerReduction" operation="base_add" value="-1"/>
        <display_value name="dTreasureBlocksPerReduction" value="-1"/>
    </effect_group>
</item>
<item name="apparelShades"> <!-- item name directly referenced in the code -->
........
    <property name="EquipSlot" value="Eyes"/>
    <property name="Group" value="Clothing"/>
    <property class="UMA">
        <property name="Mesh" value="gear_shades"/>
        <property name="Overlay0" value="gear_shades"/>
        <property name="Layer" value="1"/>
        <property name="UISlot" value="Eyewear"/>
</property>

 

Link to comment
Share on other sites

I did some digging and figured it out.  I feel really stupid now.  You are correct.  The "H7SB Backpacks" mod I have installed stole one of the slots and changed it to only accept backpacks.  All this for almost nothing.  At least I learned a bit about modding.  Thanks poly and BFT2020 for helping me figure this out.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...