• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Is there any way to trigger the old "recipe unlocked" msg in A17? (ttRecipeUnlocked)

mjrice

New member
It used to be that when a recipe was unlocked, the game would pop up a message above the hud that said "Recipe Unlocked: {recipe}", and that tooltip key is still in Localization.txt, but I can't figure out how to make it do anything.

I thought the way to do it would be to add the parameter "tooltip_key" to the triggered effect that unlocks the recipe, like this example for Bacon and Eggs:

Code:
<item name="Cookbook: Bacon and Eggs">
<property name="Extends"      value="recipeBookBase"/>
<property name="CreativeMode" value="Player"/>
<property name="EconomicValue"    value="500"/>
<property class="Action0">
<requirement name="CVarCompare" cvar="foodBaconAndEggs" operation="Equals" value="0"/> <!-- Equals 0 -->
</property>
<effect_group tiered="false">
<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="foodBaconAndEggs" operation="set" value="1" tooltip_key="ttRecipeUnlocked" />
</effect_group>
</item>
But this does nothing, and nothing else I have tried has worked. Does anybody know if it is possible to do?

Just to be clear, the recipe does get unlocked, I just can't get it to display a message telling the player about it.

 
I figured it out - here are the details if anybody else looking to do the same stumbles onto this:

You can display a brief message above the toolbelt by triggering a effect of action type = ShowToolbeltMessage with attribute message set to the string you want to display. On the one hand, this isn't tied to the actual recipe being unlocked, so it relies on you putting the effect in right spot. But on the other hand, this is really nice because you can display any text you want and doesn't involve touching localization.txt. And it works well with multiple items, each message will be displayed for a few seconds before it moves on to the next one queued up. Here is an example, a cookbook that unlocks three different recipes and shows three corresponding messages:

Code:
<item name="Cookbook: Noodles" >
<property name="Extends"      value="recipeBookBase"/>
<property name="CreativeMode" value="Player"/>
<property name="EconomicValue"    value="500"/>
<property class="Action0">
	<requirement name="CVarCompare" cvar="Noodles" operation="Equals" value="0"/> <!-- Equals 0 -->
</property>
<effect_group tiered="false">
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="GiveSkillExp" target="self" skill="attIntellect" experience="1500"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="Noodles"               operation="set" value="1"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="Chicken Noodle Soup"   operation="set" value="1"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="Tuna Noodle Casserole" operation="set" value="1"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ShowToolbeltMessage" target="self" message="Recipe Unlocked: Noodles"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ShowToolbeltMessage" target="self" message="Recipe Unlocked: Tuna Noodle Casserole"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ShowToolbeltMessage" target="self" message="Recipe Unlocked: Chicken Noodle Soup"/>
</effect_group>
</item>
 
Thanks for sharing this mjrice I have been thinking about a modlet and this was also eluding me on how to do the message displays.

 
Back
Top