Skip to content

Tag an AOE Effect and AOE sizes.

NeverwinterWightsNeverwinterWights Member Posts: 339
edited March 2020 in Builders - Scripting
So I attempted to use the TagEffect function to change the tag of a custom EffectAreaOfEffect but it doesn't seem to work. I assumed since it is categorized as an effect that it would still apply to EffectAreaOfEffect. I know that once applied to a location it becomes an object.
So my question is, how do I change the tag of the created EffectAreaOfEffect or set/get it as a local object or even "get it" as a very specific object?
If there is not currently a way can we either have TagEffect work on AOEs or get another parameter in the EffectAreaOfEffect function to set a new tag?

Also do different AOE ids have different sizes? Currently using AOE_PER_CUSTOM_AOE but it is a little too big for what I need it for.

Comments

  • ShadooowShadooow Member Posts: 402
    when you apply the EffectAreaOfEffect it will create an object with the tag matching the column LABEL from vfx_persistent.2da

    you can find this object and change its tag, you can find example of this in community patch 70_inc_spells function spellsSetupNewAOE
  • FreshLemonBunFreshLemonBun Member Posts: 909
    I also did something similar.

    Basically you have to get the object and set it yourself I think, that's how I did it. TagEffect is only used when you're looping through effects with GetFirst/NextEffect functions, for example the effects applied by the heartbeat or enter events. Using vfx_persistent.2da allows you to set different sizes and visuals. To implement widen spell you can simply set a vfx in vfx_persistent.2da with twice the radius.
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    edited March 2020
    I also did something similar.

    Basically you have to get the object and set it yourself I think, that's how I did it. TagEffect is only used when you're looping through effects with GetFirst/NextEffect functions, for example the effects applied by the heartbeat or enter events. Using vfx_persistent.2da allows you to set different sizes and visuals. To implement widen spell you can simply set a vfx in vfx_persistent.2da with twice the radius.

    Well there is the new "TagEffect" function which allows you to give a tag to the effect as soon as you create it. Unfortunately it just doesn't work for EffectAreaOfEffect. What I did end up doing is a GetObjectByTag using the default tag and then SetTag, in the same script, immediately after I create the effect which does work. However since this is in a pseudo HB I'm not sure if there is a possibility that the script may occasionally grab someone else's AOE object.

    Edit: Now thinking about it I suppose I could just use a GetNearestObjectByTag to be safe?
  • FreshLemonBunFreshLemonBun Member Posts: 909
    Yes but that TagEffect function can only be used when looping through effects using GetEffectTag, that is it's not the same as other tags. A useful thing about TagEffect is that you can encode spell variables into the tag and then parse them out again later on for various spell interactions.

    You could use any way of grabbing the object, if you're changing all AOE object tags then a standard tag means it hasn't been set yet. The issue with safety is what to do when multiple objects are created at once.

    Using AssignCommand changes the caller of the function you give to the object you assign it to. This means within that assigned function you can use GetAreaOfEffectCreator to get the caster. That allows you to confirm the correct object and set caster dependent tags.
  • ShadooowShadooow Member Posts: 402
    Why do you need to change AOE object tag anyway? It is not good idea generally because some scripts/spells do react on AOE objects and are checking their tags (Gust of Wind for example in CPP also elemental wind pulse). So if you change the AOE object tag you can break some functionality.
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    Shadooow wrote: »
    Why do you need to change AOE object tag anyway? It is not good idea generally because some scripts/spells do react on AOE objects and are checking their tags (Gust of Wind for example in CPP also elemental wind pulse). So if you change the AOE object tag you can break some functionality.

    Was looking for a way to put something down at a player location that has an OnExit script and it would only apply to the owner of the AOE object or effect and not someone running through it. Might be useful for many different things.
  • WilliamDracoWilliamDraco Member Posts: 175
    GetAreaOfEffectCreator(object) is a function, just check if the creator == the exiting object.
Sign In or Register to comment.