Jump to content

Applying status effects in Witcher 1


Recommended Posts

Aaaand I post to the wrong forum. Good job me.

 

Ignore!

 

 

Hey guys,

 

I was wanting to experiment with status effects, but I can't figure out how to actually apply a status effect to a character in a script.

 

Here, for instance,

 

void main()
{
object oPC = GetFirstPC();

SetCurrentVitalityPoints( 100, oPC);
SetCurrentEndurancePoints (0, oPC);
ActionCastSpellAtObject( 55, oPC, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, FALSE);

ApplyEffectToObject(GetEffectDurationType(EffectHeal(50)), EffectHeal(50), oPC, 0.0f, "", -1);


}

 

Will set my health to 100 and endurance to 0, which is good, and then cast a healing spell (incidentally, spell ID 55 and 59 appear to be identical) for 100 points. All this happens just fine. Afterwards, I should be getting some more healing on top of that for another 50 points, but this doesn't happen. Also, as long as the last line calling for the applied healing effect is left in when the script runs, I get a stack underflow error in Djinni (which doesn't cause much trouble).

 

So. There seems to be something I'm doing wrong with the language involved. The script compiles fine in Djinni, so I'm not screwing up there. I'm referring to the following functions (from the Djinni wiki):

 

ApplyEffectToObject (int nDurationType, effect eEffect, object oTarget, float fDuration=0.0f,string sEffectType="",int nEffectLevel=-1)

 

and for that first parameter, the duration type, I try to bypass having to actually know it out by using

 

GetEffectDurationType (effect eEffect)

 

My biggest issue is that I don't know what the "string sEffect" means or how to find the proper string to use for it (I think it's supposed to be the name of the status effect). I'm also not sure what to put for nEffectLevel, but changing it doesn't seem to do anything.

 

There's also another function,

 

AddRunningEffect (object oTargetCreature, string sType, int nLevel, string sMedium, float fBaseIntensity = -1.0, float fStartDelay = 0.0, object oInitiator = OBJECT_INVALID, string sAbilities="")

 

Which doesn't work any better for me, since I need to know both the string specifying the status effect (sType) and something called a medium (sMedium, apparently "Silver" is one, IDK).

 

Any suggestions?

 

Edited by illegalcheese
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...