Aller au contenu

Photo

Effect questions


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
I'm wondering what work people have done with effects, because I can't find out the information I'm looking for anywhere and my questions seem to be pretty straightforward. I've checked the effect page on the toolset wiki and done some googling, but still no dice.

So, my questions are:
1) How do you set a duration on an effect?
There's a "GetEffectDurationType" but no equivalent set function. There also doesn't seem to be a means to set a numerical duration. I can work around this issue by using events and delaying them in order to remove an effect after an appropriate time, but this seems a little clunky - particularly if I want to apply an effect to a large group of creatures. (On that note, why is there only a "GetHostileCreaturesWithinRadius" and not a "GetCreaturesWithinRadius" function? I want friendly fire!)

EDIT: I'm apparently an idiot.  ApplyEffectOnObject() allows you specific all of these... what's more, I'd actually used this very function in a script I'd written some time ago. Don't I feel awkward and embarrassed?  ("Yes" is the answer to that question, just in case anyone was wondering)

2) How do you "link effects"?
The wiki mentions you can link effects into a package before applying them, but I can't see any functions that seem to fit this purpose.

3) How do you set whether an effect is magical?
It's stated that effects are either "normal" or "magical" and that magical effects can be removed with "dispel magic" effects. I'd like to make sure that certain effects I'm applying to people aren't considered magical, because I don't want them dispelled.

4) How does one get "tooltips" for any effects you may apply to a player?
There's the little status bar that shows active effects next to your XP and if hover over it, it will give you a short description. Is there any way to add new custom text to this?

Modifié par AmstradHero, 22 octobre 2011 - 11:12 .


#2
Sunjammer

Sunjammer
  • Members
  • 925 messages
1) Hee hee ... we all have those moments. Coincidentally when I was doing some Item Ability testing found myself going off on a similar tangent (which is still in my test script albeit commented out):

    //--------------------------------------------------------------------------------------
    // HOW MANY WAYS TO APPLY A VISUAL EFFECT?
    //--------------------------------------------------------------------------------------

    // method 1
    effect eVisual1 = Effect(EFFECT_TYPE_VISUAL_EFFECT);
    eVisual1 = SetEffectInteger(eVisual1, 0, 90184);
    Engine_ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eVisual1, oTarget, 5.0);

    // method 2
    effect eVisual2 = EffectVisualEffect(90184);
    ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eVisual2, oTarget, 5.0);

    // method 3
    ApplyEffectVisualEffect(oCreator, oTarget, 90184, EFFECT_DURATION_TYPE_TEMPORARY, 5.0);

2-4) I believe that the answers to these questions may be found in the ability used to apply the effect rather than the effect itself though I haven't finished testing abilities so I can't say definitively. However ...

2) A custom ability could potentially bundle various effects together either through its 2da definition or through its spell script (keeping in mind the nAbilityId parameter in the ApplyEffectOnObject function and the RemoveEffectsByParameters function).

3) This appears to be as simple as all effects created by an ability of with an abilitytype of 2 (spell) are deemed to be magical and therefore can be dispelled. If you look in the effect_dispel_magic_h include you will see the following:

        // ---------------------------------------------------------------------
        // We only dispell ABILITY_TYPE_SPELL!
        // ---------------------------------------------------------------------
        if (Ability_GetAbilityType(nId) == ABILITY_TYPE_SPELL)
        {
            RemoveEffect(OBJECT_SELF,arSpell[i]);
        }

4) Again through its 2da definition an ability can have a strid_effect and an icon which I believe combine to produce the effect (no pun intended) you are looking for.

Modifié par Sunjammer, 23 octobre 2011 - 01:23 .


#3
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
Awesome! Thanks sunjammer.

 I've not really experimented with creating new abilities, so I must confess I'm a little clueless in that area. Some of these effects are being activated by the use of placeables, so I'm not sure whether that would have any effect (again, no pun intended) on the implementation.

It is good to know that setting something as a spell isn't something you're going to do by accident - ABILITY_TYPE defauls to invalid... though I wonder whether that is a good thing.

I might investigate custom icons and tooltips for these effects at a later date - introducing new abilities (particularly if that means pursuing new talent trees) sounds like it could create a lot of work, and I think I already have enough on my plate without delving into new additions like that. :)