#Clock Rocket Flare providing vision of invisible units
1 messages · Page 1 of 1 (latest)
here's the code I have so far
(btw clock's sound isn't working for some reason)
try
find units in radius and
target:AddNewModifier(caster, self, "modifier_truesight", {duration = sight_duration})
I want the invisible units to be displayed inside of the area, but if they leave they get hidden again
instead of it "revealing them" even after they leave the area
if they get hit initially
I'm assuming it's gonna work like that, so I'll try it out, thank you
put a dummy unit in the center that has a modifier that emits an aura of modifier_truesight
thats how valve handles that kind of thing
hm so I guess it's more complex than I initially thought
do you have any examples of dummies being created?
Found 1 function for createmodifierthinker
🇸 CreateModifierThinker(caster: CDOTA_BaseNPC|nil, ability: CDOTABaseAbility|nil, modifierName: string, paramTable: table|nil, origin: Vector, teamNumber: DOTATeam_t, phantomBlocker: bool): CDOTA_BaseNPC
Create a modifier not associated with an NPC.
just use that
if you open that link, and click the github button you'll see plenty of examples
thanks
it says >not associated with an NPC.
but in reality there is a dummy unit that the modifier applies to
is a dummy unit invisible?
yes, the unit from createmodifierthinker has no model invisible box model and is not found by things like findunitsinradius normally
you can find them if you want to, but in 99% of cases you dont want to
what would be the best way to get the enemy's team team number
this is what I have currently
it would be the team number of the caster
the true sight would reveal all of the enemies of the casters team
oh
hold on. you need to make your own modifier to apply to the thinker
and that modifier emits an aura of modifier_truesight
ah I thought a thinker would be special in the sense that you just apply any modifier to it and it works
I see
there are a bunch of modifier functions for auras.
you would need most of them
Found 11 functions for aura
🇸 🇨 CDOTA_Buff:GetAuraDuration(): float
Returns aura stickiness (default 0.5).
🇸 🇨 CDOTA_Modifier_Lua:GetAuraDuration(): float
Returns aura stickiness.
🇸 🇨 CDOTA_Modifier_Lua:GetAuraEntityReject(entity: CDOTA_BaseNPC): bool
Return true/false if this entity should receive the aura under specific conditions.
🇸 🇨 CDOTA_Buff:GetAuraOwner(): CDOTA_BaseNPC|nil
Returns the owner of the aura modifier, that applied this modifier. Always `nil` on the client.
🇸 🇨 CDOTA_Modifier_Lua:GetAuraRadius(): int
Return the range around the parent this aura tries to apply its buff.
and 6 more…
alright
do note that you should use DOTA_UNIT_TARGET_FLAG_INVULNERABLE, so that the true sight is applied to invulnerable units.
by default invulnerable units are ignored in searches and such
worked beautifully
what would be an invulnerable unit?
like an example
bkb?
something like this right
yeah
euls scepter, faceless void's time walk, banes nightmare
plenty of others
did you precache them?
if you don't tell the engine to load them then you can't use them
some don't need to be loaded, but generally anything thats tied to a hero or other entity needs to be
yep
either in the ability kv, in the ability lua, or in addon_game_mode.lua
I generally use the ability lua
function kraken_spout:Precache( context )
PrecacheResource( "soundfile", "soundevents/game_sounds_heroes/game_sounds_tidehunter.vsndevts", context )
PrecacheResource( "particle", "particles/units/heroes/hero_tidehunter/tidehunter_gush.vpcf", context )
PrecacheResource( "particle", "particles/units/heroes/hero_tidehunter/tidehunter_gush_splash.vpcf", context )
PrecacheResource( "particle", "particles/units/heroes/hero_tidehunter/tidehunter_gush_slow.vpcf", context )
end
I think elfansoer used to precache in the KV, but he does it in the lua now, you can see in the repo that old abilities have the precache in the kv
"precache"
{
"soundfile" "soundevents/game_sounds_heroes/game_sounds_abaddon.vsndevts"
"particle" "particles/units/heroes/hero_abaddon/abaddon_death_coil.vpcf"
}
still doesnt work
I'm confused
is there a chance this isnt working because clockwork is disabled?
on the herolist
actually no that doesnt make sense because shadowfiend is disabled and I can use its autoattack as a particle
followup question is there any good examples of repos messing with panorama after the change so that the <scripts> tag isn't allowed?
What do you mean scripts tag isnt allowed?
And "messing with panorama" is pretty vague.
Well that says, <script> is not allowed in custom_ui_manifest.
You can still use it in other xml's, and there is both <script> and <scripts>
Plural is for linking js files where the code would be.
Singular is for writing js code in the xml
I see
btw any explanation for this?
doth sound and particle dont work
if I change it to something like cheese or w/e it does work
Dotas items have all effects and sounds precached in every game because items are always in every game.
Hero/ unit stuff is not unless the hero is picked or you explicitly precache it.
Custom items are a little weird with precaching, it's been a long time so I'm not entirely sure but i think you need to call this in addon_game_mode's precache function in addition to that
Found 2 functions for precacheitem
🇸 PrecacheItemByNameAsync(itemName: string, callback: (precacheId: int) → nil): nil
Asynchronously precaches a DOTA item by its dota_npc_items.txt name, provides a callback when it's finished.
🇸 PrecacheItemByNameSync(itemName: string, context: CScriptPrecacheContext): nil
Precaches a DOTA item by its dota_npc_items.txt name.
If that doesnt work then just precache the effects in addon_game_mode instead. As an item it always needs to be precached anyway
Sync is done immediately.
Async is done whenever there are spare resources.
Whenever possible you want to use async functions over sync, to prevent hiccups in the servers performance.
But in some cases you need sync
even that doesnt work
I am so confused
also tried precacheitembynamesync and it didn't work
Ability precache is an ability method
Have a look at the first chunk of code I sent
I didnt know this was for an item, item precache is jankass so I always just put it into the addon_game_mode precache
I'll also add that precaches on abilities occur when an ability is created. For heroes, that's usually great because heroes typically start with abilities and don't change them during the course of the game. There's usually just 1 of each ability in the game.
However, for items, which can be bought multiple times, it might be better to just precache the effect on addon_game_mode. This makes it so the precaches are done at the start of the game
like this?
I tried putting it on addon_game_mode
but it didnt work
this is why I found it weird
even precaching on the item lua doesnt work
am I really gonna have to pull the soundfile / particle separately and throw it into my mod
instead of getting it from dota itself
Let's try another tricking way: create a rattletrap on map, then delete him
I think I wanna figure the sound first
but I can try that as well
oh you mean on top of the createparticle function?
can I still create a rattletrap considering he's disabled on herolist?
maybe the particle I want doesn't exist? idk
but I checked it in the assets browser
ok. surprised i didnt notice earlier but you're doing the sounds wrong.
not sure about the particle without checking the asset browser
you need to precache the sound events file for clockwerk (not individual sound files), and then play the sound thats listed there.
I thought I just pulled the corresponding file
from whatever showed in assets browser
let me check
so for that sound effect the actual name you use in EmitSound is Hero_Rattletrap.Rocket_Flare.Explode
and the file you need to precache is game_sounds_rattletrap.vsndevts
yes
been too long, idk. gimmie a moment to find an example.
how you have it should be correct
well now we're back to the issue of "items are jank at precaching" i think.
try putting the precache in addon_game_mode
and just to make sure. you are reloading the map after these changes, correct?
lets see
yes
but I'm doing it through the console
instead of hammer
idk if that matters
no thats fine
but I'm assuming not because all lua scripts update
OK IT WORKS
THE AUDIO AT LEAST
THANK GOD
great
gonna remove it from the lua file
and keep it only on addon to see if it still works
it does ok
nice
what about the particle now
do I import it differently like in the game_sounds
no, the particle one is done how you have it (assuming the filepath is correct)
hmmm
is it particle instead of particles
wait
oh it works now
ok now I just have to figure out
how to make the particle spawn at my cursor / point target
is it just pattach absorigin on target_position?
depends on the particle.
but the 'absorigin' pattachments are for attaching the particle to a unit.
if you just want it at a point in the world it probably be PATTACH_POINT
most particles use cp0 as their "position" control point.
so you would want to set cp0 to the position
local particle_id = ParticleManager:CreateParticle(...)
ParticleManager:SetControlPoint(particle_id, 0, position)
something like that
in createparticle the last parameter is the unit the particle should be associated with, it can be nil.
its for things like fog of war hiding/showing the particle when the unit cant/can be seen for example.
you set the position with control points
my bad
Found 8 functions for SetParticleControl
🇸 🇨 CScriptParticleManager:SetParticleControl(particle: ParticleID, controlPoint: int, value: Vector): nil
Set the control point data for a control on a particle effect.
🇸 🇨 CScriptParticleManager:SetParticleControlEnt(particle: ParticleID, controlPoint: int, unit: CBaseEntity, particleAttach: ParticleAttachment_t, attachment: string, offset: Vector, lockOrientation: bool): nil
🇸 🇨 CScriptParticleManager:SetParticleControlFallback(particle: ParticleID, controlPoint: int, vecPosition: Vector): nil
🇸 🇨 CScriptParticleManager:SetParticleControlForward(particle: ParticleID, controlPoint: int, arg3: Vector): nil
[OBSOLETE - Use SetParticleControlTransformForward] (int nFXIndex, int nPoint, vForward).
🇸 🇨 CScriptParticleManager:SetParticleControlOrientation(particle: ParticleID, controlPoint: int, arg3: Vector, arg4: Vector, arg5: Vector): nil
[OBSOLETE - Use SetParticleControlTransform] (int nFXIndex, int nPoint, vForward, vRight, vUp) - Set the orientation for a control on a particle effect (NOTE: This is left handed -- bad!!).
and 3 more…
particles can have any number of control points that influence their effects.
its different for every particle.
some have just cp0, some have like 15 of them.
you can see if you open the particle in the particle editor what the cps do by changing their values.
clicking them also highlights what properties read them