Results 1 to 5 of 5

Thread: [Suggestion] Truesight/Detection Function and Modifier Property

  1. #1
    Basic Member
    Join Date
    Jun 2012
    Posts
    184

    [Suggestion] Truesight/Detection Function and Modifier Property

    Hello, I'm trying to temporarily provide a team with truesight of a targeted enemy unit for a duration. The MakeVisibleToTeam() function has worked well to reveal units in fog of war, but there does not appear to be an analogous function for truesight.

    Also, there does not appear to be any modifier states nor properties to solve this. I have looked into MODIFIER_STATE_INVISIBLE, MODIFIER_PROPERTY_INVISIBILITY_LEVEL, and MODIFIER_PROPERTY_PERSISTENT_INVISIBILITY, none of which appear to be what I'm looking for (unless I'm not using them correctly).

    I am aware that there is a built-in modifier called modifier_truesight, which works, but I am hesitant to remove it explicitly because I imagine it's used by several abilities, I don't know if duplicate instances of it are allowed on a unit, etc. I'd prefer to make my own modifier_truesight so I would feel comfortable removing it, but no one seems to know exactly how modifier_truesight functions behind-the-scenes.

    Hopefully that makes sense!

  2. #2
    Basic Member KreeG's Avatar
    Join Date
    Jan 2014
    Posts
    31
    I'm using this:
    Code:
    		"OnSpellStart"
    		{
    			"ApplyModifier"
    			{
    				"ModifierName"	"modifier_item_truesight_aura"
    				"Target"		"CASTER"
    			}
    		}
    		"Modifiers"
    		{
    			"modifier_item_truesight_aura"
    			{
    				"IsHidden"		"0"
    				"Duration"		"15"
    				"ThinkInterval"		"0.25"
    				"OnIntervalThink"
    				{
    					"ApplyModifier"
    					{
    						"Target"
    						{
    							"Center"	"CASTER"
    							"Radius"	"125"
    							"Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
    							"Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_CREEP | DOTA_UNIT_TARGET_MECHANICAL | DOTA_UNIT_TARGET_OTHER"
    						}
    						"ModifierName"		"modifier_item_truesight"
    					}
    				}
    			}
    			"modifier_item_truesight"
    			{
    				"IsHidden"		"1"
    				"IsDebuff"		"1"
    				"Duration"		"0.25"
    				"States"
    				{
    					"MODIFIER_STATE_INVISIBLE"	"MODIFIER_STATE_VALUE_DISABLED"
    				}
    			}
    		}

  3. #3
    Basic Member
    Join Date
    Jun 2012
    Posts
    184
    Thanks for the code! If that's always how Valve programs truesight, where it's constantly being reapplied, it might work for me. Is modifier_item_truesight different from modifier_truesight? I only see the latter listed on the wiki.

    I'm currently remaking Sniper's ultimate, and it's supposed to provide truesight of the target from the start of the extended cast animation until Sniper cancels the animation (a separate issue that doesn't seem possible to replicate), the projectile hits the target, or four seconds have elapsed (whichever occurs first). Since we don't seem to be able to code our own modifiers with truesight, one option is to apply modifier_truesight to the target for four seconds, and remove it explicitly using Lua when the target is hit (or when the animation is stopped).

    However, I imagine modifier_truesight is used in loads of abilities. Using RemoveModifierByName()--or even RemoveModifierByNameAndCaster()--seems risky to me, since it could permanently remove the truesight given by another ability. How does Bounty Hunter's Track work, for example? I see there's a modifier_bounty_hunter_track and a modifier_bounty_hunter_track_effect. If the truesight is hardcoded within modifier_bounty_hunter_track (I haven't checked), then Valve handled this issue the way I would like to (using separate modifiers for ability instances of truesight). If it applies an invisible modifier_truesight with a duration to the target, then I wouldn't want to inadvertently remove this early by explicitly removing the truesight thSniper's ultimate briefly provides.

  4. #4
    Basic Member KreeG's Avatar
    Join Date
    Jan 2014
    Posts
    31
    Is modifier_item_truesight different from modifier_truesight?
    "modifier_item_truesight" is custom modifier that I created. It under "modifier_item_truesight_aura" in code above.But you can use "modifier_truesight" aswell, but "Duration" will be needed.

    Code with "modifier_truesight":
    Code:
    		"OnSpellStart"
    		{
    			"ApplyModifier"
    			{
    				"ModifierName"	"modifier_item_truesight_aura"
    				"Target"		"CASTER"
    			}
    		}
    		"Modifiers"
    		{
    			"modifier_item_truesight_aura"
    			{
    				"IsHidden"		"0"
    				"Duration"		"15"
    				"ThinkInterval"		"0.25"
    				"OnIntervalThink"
    				{
    					"ApplyModifier"
    					{
    						"Target"
    						{
    							"Center"	"CASTER"
    							"Radius"	"125"
    							"Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
    							"Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_CREEP | DOTA_UNIT_TARGET_MECHANICAL | DOTA_UNIT_TARGET_OTHER"
    						}
    						"ModifierName"		"modifier_truesight"
    						"Duration"			"0.25"
    					}
    				}
    			}
    		}
    How does Bounty Hunter's Track work, for example?
    Something like this:
    Code:
    			"modifier_bh_track"
    			{
    				"IsHidden"		"0"
    				"IsDebuff"		"1"
    				"Duration"		"%duration"
    				"Aura"					"modifier_bh_track_effect"
    				"Aura_Radius"			"%aura_radius"
    				"Aura_Teams"			"DOTA_UNIT_TARGET_TEAM_ENEMY"
    				"Aura_Types"			"DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_CREEP | DOTA_UNIT_TARGET_MECHANICAL"
    				"Aura_Flags"			"DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
    				"ThinkInterval"		"0.25"
    				"OnIntervalThink"
    				{
    					"ApplyModifier"
    					{
    						"Target"
    						{
    							"Center"	"TARGET"
    							"Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
    							"Types" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_CREEP | DOTA_UNIT_TARGET_MECHANICAL | DOTA_UNIT_TARGET_OTHER"
    						}
    						"ModifierName"		"modifier_truesight"
    						"Duration"			"0.25"
    					}
    				}
    				"States"
    				{
    					"MODIFIER_STATE_PROVIDES_VISION"	"MODIFIER_STATE_VALUE_ENABLED"
    				}
    			}
    			"modifier_bh_track_effect"
    			{
    				"IsHidden"		"0"
    				"ThinkInterval"		"0.25"
    				"Properties"
    				{
    					"MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE"	"%bonus_move_speed_pct"
    				}
    			}

  5. #5
    Basic Member
    Join Date
    Jun 2012
    Posts
    184
    Oh, I see what you're saying now. Assuming modifier_truesight has "Attributes" "MODIFIER_ATTRIBUTE_MULTIPLE", I can repeatedly apply short-duration modifier_truesight modifiers to avoid having to explicitly remove the modifier with RemoveModifierByName().

    Thank you for your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •