Bladestorm Games Posted February 6, 2023 Share Posted February 6, 2023 (edited) Hello I am attempting to make a buff functions similar to Animal Tracking, but tracks zombies instead. For testing I am delivering the Tracking Buff like this: buff.xml <configs> <!-- Grant Player the ability to track Zombies --> <append xpath="/buffs/buff[@name='buffPerkAbilityUpdate']"> <effect_group> <triggered_effect trigger="onSelfBuffUpdate" action="AddBuff" buff="buffZombieTracking"> <requirement name="!HasBuff" buff="buffZombieTrackEnabled"/> <requirement name="EntityTagCompare" tags="player"/> </triggered_effect> </effect_group> </append> <!-- Zombie Tracking --> <append xpath="/buffs"> <buff name="buffZombieTrackEnabled" hidden="true"> <stack_type value="replace"/> <duration value="0"/> <effect_group name="handling"> <!-- Track Distance --> <passive_effect name="TrackDistance" operation="base_add" value="100"/> <!-- Recycle Buff --> <triggered_effect trigger="onSelfBuffUpdate" action="AddBuff" buff="buffZombieTracking"> <requirement name="!HasBuff" buff="buffZombieTracking"/> </triggered_effect> </effect_group> </buff> <buff name="buffZombieTracking" name_key="buffZombieTrackingName" description_key="buffZombieTrackingDesc" showonhud="true" icon="ui_game_symbol_zombie" icon_color="255,0,0"> <stack_type value="replace"/> <duration value="20"/> <effect_group name="track_zombie"> <passive_effect name="Tracking" operation="base_set" value="1" tags="zombie"/> </effect_group> </buff> </append> </configs> Localization for Buff Text: Localization.txt Key,File,Type,UsedInMainMenu,NoTranslate,english buffZombieTrackingName,buffs,Buff,,,Tracking Zombies buffZombieTrackingDesc,buffs,Buff,,,Tracking zombies. Now I'm guessing the next step is to setup a nav_objects.xml like so: nav_objects.xml <config> <append xpath="/nav_object_classes"> <nav_object_class name="track_zombie" extends="animaltracking_hostile"> <property name="requirement_type" value="Tracking" /> <property name="use_override_icon" value="true" /> <map_settings> <property name="sprite_name" value="ui_game_symbol_zombie"/> </map_settings> <compass_settings> <property name="sprite_name" value="ui_game_symbol_zombie"/> </compass_settings> <onscreen_settings> <property name="sprite_name" value="ui_game_symbol_zombie"/> <property name="offset" value="0,1.1,0" /> </onscreen_settings> </nav_object_class> </append> </config> And I think the final step would be to setup a entityclasses.xml like so: entityclasses.xml <config> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='TrackerIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='MapIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='CompassIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='NavObject']/@value">track_zombie</set> </config> Or is this setup a better option: entityclasses.xml <config> <!-- zombieArlene --> <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='TrackerIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='MapIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='CompassIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='NavObject']/@value">track_zombie</set> <!-- Repeat the above for zombieArleneFeral --> <!-- Repeat the above for zombieArleneRadiated --> <!-- Repeat for the other Zombies --> </config> I probably dont have to set tags in the entity_class.xml, because in buffs.xml I am using tags="zombie" which the entities already have the zombie tag. But it is worth noting based on the game's core entityclasses.xml, that for entity_class zombieTemplateMale: <property name="Tags" value="entity,zombie,walker"/> <!-- this property DOES NOT inherit on extends and target_tags cannot be AND connected --> Let me know if you guys have any thoughts, or spot any mistakes issues. Thanks! Edited February 8, 2023 by Bladestorm Games (see edit history) Link to comment Share on other sites More sharing options...
Telric Posted February 6, 2023 Share Posted February 6, 2023 Without knowing what you're experiencing, as in how its not working, I can only guess right now. Off the bat, in buffs, you have your buff being applied via update of perkabilityupdate. That update runs every second. You then have it applying your custom buff that lasts 20 seconds, but is set to replace. That means every update tick of perkabilityupdate causes that 20 seconds to refresh, meaning it will never fall off. Next up, you have no application to get the zombietrackenabled buff at all. I'm assuming you'd want it to trigger after the 20 seconds, so a onselfbufffinish on your tracking buff. That then triggers the trackenabled buff, which has some issues on its own. First, it has a duration of 0, which is infinite until removed or death. Next, you have it attempting to apply the first buff on update, if the player doesnt have the same buff it needs. So you can't have the buff required to give the 2nd buff. That's not possible. What you'd want is another trigger, either timed or player caused such as onselfcrouch. That would then apply the first buff to cause a loop. Again, without knowing what exactly is going wrong, i'm just going off what i see immediately. After you fix those things, it could work right out. if not, tell us what's supposed to happen vs what the outcome is. Link to comment Share on other sites More sharing options...
Bladestorm Games Posted February 7, 2023 Author Share Posted February 7, 2023 1 hour ago, Telric said: Without knowing what you're experiencing, as in how its not working, I can only guess right now. Off the bat, in buffs, you have your buff being applied via update of perkabilityupdate. That update runs every second. You then have it applying your custom buff that lasts 20 seconds, but is set to replace. That means every update tick of perkabilityupdate causes that 20 seconds to refresh, meaning it will never fall off. Next up, you have no application to get the zombietrackenabled buff at all. I'm assuming you'd want it to trigger after the 20 seconds, so a onselfbufffinish on your tracking buff. That then triggers the trackenabled buff, which has some issues on its own. I've modified this part to be a bit more simple for testing, and removed the buffPerkAbilityUpdate portion. (Now all I do is Console Command "buff buffZombieTrackEnabled") The buff "buffZombieTrackEnabled" is there to grant Tracking Distance, and also recycle the buff "buffZombieTracking". The buff "buffZombieTracking" is there to activate/trigger/proc the tracking of zombies. I've also changed the duration to 5, down from 20. Now Im not exactly sure how the game's tracking system works (even when looking at the Animal tracking buff) so this is a guess: <passive_effect name="Tracking" operation="base_set" value="1" tags="zombie"/> If this is set to 1, are you constantly tracking zombies, where if a zombie out of your Tracking Distance were to arrive within the range, it would become tracked? (This is why I have "buffZombieTracking" recycling, so that every X seconds, it will "re-activate/trigger/proc" the Tracking System) Quote Again, without knowing what exactly is going wrong, i'm just going off what i see immediately. After you fix those things, it could work right out. if not, tell us what's supposed to happen vs what the outcome is. Well the buff system is working, and the Tracking should be working (zombies/entityclasses.xml already have the tag "zombie" so I dont have to add that tag to them). The issue at the moment is, I dont actually see any Tracking/Icons on the Map/Compass/Etc. That is likely due to the zombies in entityclasses.xml not having the TrackerIcon, MapIcon, CompassIcon, and NavObject set to something. I'm going to mess with that next and report back (I'm a bit busy so it may take a bit before reporting back.) Link to comment Share on other sites More sharing options...
Jinx_DG Posted February 7, 2023 Share Posted February 7, 2023 The Darkness Falls Mod has zombie tracking. Maybe taking a look at how Khaine did his may help you in yours...? 1 Link to comment Share on other sites More sharing options...
Bladestorm Games Posted February 7, 2023 Author Share Posted February 7, 2023 1 hour ago, Jinx_DG said: The Darkness Falls Mod has zombie tracking. Maybe taking a look at how Khaine did his may help you in yours...? Taking a quick glance, the buff portion is similar to the vanilla animal tracking. DF's entityclasses.xml has a few notable things: <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='Tags']/@value">entity,zombie,walker,feraltracking,radiatedtracking,demontracking,female</set> <insertBefore xpath="/entity_classes/entity_class[@name='zombieArleneFeral']/effect_group[@name='Base Effects']"> <property name="NavObject" value="twitch_spawn,twitch_spawn_other,clear_sleeper,zombietrackertwo" /> </insertBefore> DF's navobjects.xml is pretty much what I already have. I need to mess around with my entityclasses.xml, im just a bit busy tonight so Ill likely report back about that tomorrow. Link to comment Share on other sites More sharing options...
Bladestorm Games Posted February 7, 2023 Author Share Posted February 7, 2023 (edited) Okay I have it working. Seems the issue was entityclasses.xml needing to be updated to this: <config> <append xpath="/entity_classes/entity_class[@name='zombieTemplateMale']"> <property name="MapIcon" value="ui_game_symbol_zombie"/> </append> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='TrackerIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='CompassIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='NavObject']/@value">track_zombie</set> </config> Here are some images of what's going on: Spoiler And I'm going to provide the code I used here: Spoiler buffs.xml <configs> <append xpath="/buffs"> <!-- Enables Zombie Tracking and Cycling of Tracking Effect --> <buff name="buffZombieTrackEnabled" hidden="true"> <stack_type value="replace"/> <duration value="0"/> <effect_group name="handling"> <!-- Track Distance --> <passive_effect name="TrackDistance" operation="base_add" value="100"/> <!-- Recycle Buff --> <triggered_effect trigger="onSelfBuffUpdate" action="AddBuff" buff="buffZombieTracking"> <requirement name="!HasBuff" buff="buffZombieTracking"/> </triggered_effect> </effect_group> </buff> <!-- Triggers Zombie Tracking (Updates Compass/Map/Location) --> <buff name="buffZombieTracking" name_key="buffZombieTrackingName" description_key="buffZombieTrackingDesc" showonhud="true" icon="ui_game_symbol_zombie" icon_color="255,0,0"> <stack_type value="replace"/> <duration value="15"/> <effect_group name="track_zombie"> <passive_effect name="Tracking" operation="base_set" value="1" tags="zombie"/> </effect_group> </buff> </append> </configs> navobjects.xml <config> <append xpath="/nav_object_classes"> <nav_object_class name="track_zombie" extends="animaltracking_hostile"> <property name="requirement_type" value="Tracking" /> <property name="use_override_icon" value="true" /> <map_settings> <property name="sprite_name" value="ui_game_symbol_zombie"/> </map_settings> <compass_settings> <property name="sprite_name" value="ui_game_symbol_zombie"/> </compass_settings> <onscreen_settings> <property name="sprite_name" value="ui_game_symbol_zombie"/> <property name="offset" value="0,1.1,0" /> </onscreen_settings> </nav_object_class> </append> </config> entityclasses.xml <config> <append xpath="/entity_classes/entity_class[@name='zombieTemplateMale']"> <property name="MapIcon" value="ui_game_symbol_zombie"/> </append> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='TrackerIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='CompassIcon']/@value">ui_game_symbol_zombie</set> <set xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='NavObject']/@value">track_zombie</set> </config> localization.txt Key,File,Type,UsedInMainMenu,NoTranslate,english buffZombieTrackingName,buffs,Buff,,,Tracking Zombies buffZombieTrackingDesc,buffs,Buff,,,Tracking zombies. Also I'll include a download link for a ZIP containing the files as a mod: https://drive.google.com/file/d/1eRExa9Ay-z_inMzIxeOTfzNOyny1_LEK/view?usp=sharing Edited February 7, 2023 by Bladestorm Games (see edit history) Link to comment Share on other sites More sharing options...
Jinx_DG Posted February 7, 2023 Share Posted February 7, 2023 Hey Awesome! Glad you got it working!! 1 Link to comment Share on other sites More sharing options...
RyanFaeScotland Posted February 19, 2023 Share Posted February 19, 2023 In addition to Darkness Falls mentioned above, you might be interested in The Tracker Perk by jayfusion at 7 Days to Die Nexus - Mods and community (nexusmods.com) which looks like it does a similar thing to what you are looking for. From your experience making this mod, how much work do you think it would be to add a new tier that allows the tracking of arrows / bolts? I've always thought that would be a nice addition to have but not got round to trying it out yet. Link to comment Share on other sites More sharing options...
Bladestorm Games Posted February 21, 2023 Author Share Posted February 21, 2023 On 2/19/2023 at 5:49 AM, RyanFaeScotland said: From your experience making this mod, how much work do you think it would be to add a new tier that allows the tracking of arrows / bolts? I've always thought that would be a nice addition to have but not got round to trying it out yet. Added a new tier is possible. Adding the ability to track Arrows/Bolts I think is possible: Spears come to mind as a reference. Looking at the core game's items.xml I searched for "meleeWpnSpearT0StoneSpear" In "meleeWpnSpearT0StoneSpear" I can see "<property name="NavObject" value="spear"/>" I dont have the time now, but later I'll try to make a test mod to see if this works, but I'll leave my notes here incase you or others want to try it until i have some free time to test it my self: Step 1: Add "<property name="NavObject" value="projectile_arrow"/>" to the following items: ammoArrowStone, ammoArrowIron, ammoArrowSteelAP (If using a mod(s) that have custom arrows, add them here too) (Exclude ammoArrowFlaming, and ammoArrowExploding, because they have IsSticky set to False (<property name="IsSticky" value="false"/>)) Add a archery-projectile specific tag to the Arrow/Bolt items.xml Spoiler <configs> <!-- Stone Arrow --> <insertAfter xpath="/items/item[@name='ammoArrowStone']/property[@name='DisplayType']"> <property name="NavObject" value="track_projectile_archery"/> </insertAfter> <set xpath="/items/item[@name='ammoArrowStone']/property[@name='Tags']/@value">ammo,ranged,attAgility,perkArchery,perkPenetrator,projectileArchery</set> <!-- Iron Arrow --> <insertAfter xpath="/items/item[@name='ammoArrowIron']/property[@name='DisplayType']"> <property name="NavObject" value="track_projectile_archery"/> </insertAfter> <set xpath="/items/item[@name='ammoArrowIron']/property[@name='Tags']/@value">ammo,ranged,attAgility,perkArchery,perkPenetrator,projectileArchery</set> <!-- Steel Arrow --> <insertAfter xpath="/items/item[@name='ammoArrowSteelAP']/property[@name='DisplayType']"> <property name="NavObject" value="track_projectile_archery"/> </insertAfter> <set xpath="/items/item[@name='ammoArrowSteelAP']/property[@name='Tags']/@value">ammo,ranged,attAgility,perkArchery,perkPenetrator,projectileArchery</set> <!-- Stone Bolt --> <insertAfter xpath="/items/item[@name='ammoCrossbowBoltStone']/property[@name='DisplayType']"> <property name="NavObject" value="track_projectile_archery"/> </insertAfter> <set xpath="/items/item[@name='ammoCrossbowBoltStone']/property[@name='Tags']/@value">ammo,ranged,attAgility,perkArchery,perkPenetrator,projectileArchery</set> <!-- Iron Bolt --> <insertAfter xpath="/items/item[@name='ammoCrossbowBoltIron']/property[@name='DisplayType']"> <property name="NavObject" value="track_projectile_archery"/> </insertAfter> <set xpath="/items/item[@name='ammoCrossbowBoltIron']/property[@name='Tags']/@value">ammo,ranged,attAgility,perkArchery,perkPenetrator,projectileArchery</set> <!-- Steel Bolt --> <insertAfter xpath="/items/item[@name='ammoCrossbowBoltSteelAP']/property[@name='DisplayType']"> <property name="NavObject" value="track_projectile_archery"/> </insertAfter> <set xpath="/items/item[@name='ammoCrossbowBoltSteelAP']/property[@name='Tags']/@value">ammo,ranged,attAgility,perkArchery,perkPenetrator,projectileArchery</set> </configs> Step 2: Add a nav_object_class for the archery projectiles in nav_objects.xml nav_objects.xml: Spoiler <config> <append xpath="/nav_object_classes"> <nav_object_class name="track_projectile_archery"> <property name="requirement_type" value="Tracking" /> <map_settings> <property name="sprite_name" value="ui_game_symbol_archery"/> <property name="min_distance" value="0"/> <property name="max_distance" value="-1"/> <property name="color" value="255,255,0,255"/> <property name="has_pulse" value="true"/> </map_settings> <compass_settings> <property name="sprite_name" value="ui_game_symbol_archery"/> <property name="min_distance" value="0"/> <property name="max_distance" value="1024"/> <property name="color" value="255,255,0,255"/> <property name="has_pulse" value="true"/> <property name="icon_clamped" value="false" /> </compass_settings> <onscreen_settings> <property name="sprite_name" value="ui_game_symbol_archery"/> <property name="min_distance" value="0"/> <property name="max_distance" value="50"/> <property name="color" value="255,255,0,255"/> <property name="has_pulse" value="true"/> <property name="text_type" value="Distance"/> </onscreen_settings> </nav_object_class> </append> </config> Step 3: Allow the tracking of Arrows and Bolts <!-- INCOMPLETE CODE --> <!-- Plug this into an Item or Progression or Buff --> <!-- whatever you'd want to enable the tracking of Arrow & Bolts --> <effect_group name="track_archery_projectiles"> <passive_effect name="Tracking" operation="base_set" value="1" tags="projectileArchery"/> </effect_group> 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now