Just like you can add VFX to NPC's - Can it be done for a pc as well? If so, how?
Can I add a VFX on a PC permanently?
Débuté par
psiiijay
, oct. 21 2013 02:10
#1
Posté 21 octobre 2013 - 02:10
#2
Posté 21 octobre 2013 - 07:13
make an active invisible feat with the VFX in it?
#3
Posté 22 octobre 2013 - 12:07
Genasi have permanent hair/head effects, which are encoded into appearance.2da. Such effects would show up for any PC or NPC using that appearance type though.
As Morbane suggested, a persistent feat would re-apply a VFX on a regular basis (such as loading a saved game, entering a new area, or after resting). There's no guarantee that the VFX wouldn't occasionally get bumped off by spell VFX though.
A heartbeat script that checks for a particular effect, and re-applies it if it isn't found, also works. Do PCs have a HB script though?
As Morbane suggested, a persistent feat would re-apply a VFX on a regular basis (such as loading a saved game, entering a new area, or after resting). There's no guarantee that the VFX wouldn't occasionally get bumped off by spell VFX though.
A heartbeat script that checks for a particular effect, and re-applies it if it isn't found, also works. Do PCs have a HB script though?
Modifié par DannJ, 22 octobre 2013 - 12:09 .
#4
Posté 23 octobre 2013 - 08:05
a persistent feat can have an onenter, HB, and onexit script if it is an AOE that only effects the PC - the enter and exit script could be " " and not have a script
" " = empty string
" " = empty string
Modifié par Morbane, 23 octobre 2013 - 08:38 .
#5
Posté 23 octobre 2013 - 08:25
this is an example of a HB script i use in a persistent feat with an AOE - not really a design you would be looking for but just as an example:
#include "a_include_mor"
#include "a_inc_lycanthrope"
void main()
{
//SendMessageToPC(GetFirstPC(FALSE), "HB_Per_Cycling");
object oSelf = GetAreaOfEffectCreator();
location lSelf = GetLocation(oSelf);
int nMurder = GetGlobalInt("murder");
int nWis = GetAbilityModifier(ABILITY_WISDOM, oSelf);
int nDC = (16 + nMurder) - nWis;
int nCur = GetCurrentHitPoints(oSelf);
int nMax = GetMaxHitPoints(oSelf);
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oTarget))
{
if(oTarget == oSelf)
{
//SendMessageToPC(GetFirstPC(FALSE), "Skip oSelf");
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
}
//SendMessageToPC(GetFirstPC(FALSE), "Is Valid");
if(GetIsInCombat(oSelf) == TRUE)
{
//SendMessageToPC(GetFirstPC(FALSE), "In Combat");
if(nCur < nMax /2 && GetGlobalInt("is_poly") == FALSE)
{
BecomeWereWolf(oSelf, -1);
}//damaged 1/2
if(GetIsEnemy(oTarget, oSelf))
{
//SendMessageToPC(GetFirstPC(FALSE), "Is Enemy");
if(IsVampire(oTarget))
{
//SendMessageToPC(GetFirstPC(FALSE), "Is Vampire");
nDC += 5;
if(GetIsDone(oTarget, "sBecome") == FALSE && GetGlobalInt("is_poly") == FALSE)
{
BecomeWereWolf(oSelf, nDC);
//SendMessageToPC(GetFirstPC(FALSE), "Lycan_Forced_Vampire");
SetIsDone(oTarget, "sBecome");
}//VampireForced
if(GetPlayerCurrentTarget(oSelf) == oTarget && IsVampire(oTarget) == TRUE)
{
if(GetIsDone(oTarget, "sMax") == FALSE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oTarget, RoundsToSeconds(d4()));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oSelf, RoundsToSeconds(d4()));
SetIsDone(oTarget, "sMax");
}
}//effect max dam
}//vampire
if(IsUsingSilver(oTarget))
{
//SendMessageToPC(GetFirstPC(FALSE), "IsUsingSilver");
if(GetGlobalInt("is_poly") == FALSE && GetLastDamager(oSelf) == oTarget)
{
if(GetIsDone(oTarget, "sBecome") == FALSE)
{
BecomeWereWolf(oSelf, nDC);
//SendMessageToPC(GetFirstPC(FALSE), "Become_Forced_Silver");
SetIsDone(oTarget, "sBecome");
}
else if(GetIsDone(oTarget, "sApplyConfuse") == FALSE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectConfused(), oSelf, RoundsToSeconds(d4()));
//SendMessageToPC(GetFirstPC(FALSE), "Confusion Applied");
SetIsDone(oTarget, "sApplyConfuse");
}
if(GetAttemptedAttackTarget() == oSelf && IsUsingSilver(oTarget) && GetIsDone(oTarget, "sMax") == FALSE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oTarget, RoundsToSeconds(d4()));
SetIsDone(oTarget, "sMax", TRUE);
}
}
}//silver
}//enemy
}//combat
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
}//while
if(GetIsInCombat(oSelf) == FALSE)
{
//SendMessageToPC(GetFirstPC(FALSE), "Not In Combat");
RevertEffects(oSelf);
SkillBuff(oSelf, 3);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDetectUndead(), oSelf);
Regeneration(oSelf, 2, RoundsToSeconds(3));
if(GetGlobalInt("murder") > 10)
{
if(GetIsDone(oSelf, "sRecord") == FALSE)
{
FeatAdd(oSelf, Feat_Lycanthropy_Act, TRUE, TRUE, TRUE);
nMurder = GetGlobalInt("murder");
//SendMessageToPC(GetFirstPC(FALSE), "New_nMurder = " + IntToString(nMurder));
FeatRemove(oSelf, Feat_Lycanthropy_Per);
SetIsDone(oSelf, "sRecord");
TransformRestore(oSelf);
SetGlobalInt("is_poly", FALSE);
SetGlobalInt("murder", 0);
}
}//New Murder
if(GetGlobalInt("is_poly") == TRUE && GetIsInCombat(oSelf) == FALSE)
{
DelayCommand(30.0f, RevertForm(oSelf, -1));
//SendMessageToPC(GetFirstPC(FALSE), "Revert_NonCom");
SetGlobalInt("is_poly", FALSE);
}
}//combat FALSE
//SendMessageToPC(GetFirstPC(FALSE), "Final_nMurder = " + IntToString(nMurder));
}//main
#include "a_include_mor"
#include "a_inc_lycanthrope"
void main()
{
//SendMessageToPC(GetFirstPC(FALSE), "HB_Per_Cycling");
object oSelf = GetAreaOfEffectCreator();
location lSelf = GetLocation(oSelf);
int nMurder = GetGlobalInt("murder");
int nWis = GetAbilityModifier(ABILITY_WISDOM, oSelf);
int nDC = (16 + nMurder) - nWis;
int nCur = GetCurrentHitPoints(oSelf);
int nMax = GetMaxHitPoints(oSelf);
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oTarget))
{
if(oTarget == oSelf)
{
//SendMessageToPC(GetFirstPC(FALSE), "Skip oSelf");
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
}
//SendMessageToPC(GetFirstPC(FALSE), "Is Valid");
if(GetIsInCombat(oSelf) == TRUE)
{
//SendMessageToPC(GetFirstPC(FALSE), "In Combat");
if(nCur < nMax /2 && GetGlobalInt("is_poly") == FALSE)
{
BecomeWereWolf(oSelf, -1);
}//damaged 1/2
if(GetIsEnemy(oTarget, oSelf))
{
//SendMessageToPC(GetFirstPC(FALSE), "Is Enemy");
if(IsVampire(oTarget))
{
//SendMessageToPC(GetFirstPC(FALSE), "Is Vampire");
nDC += 5;
if(GetIsDone(oTarget, "sBecome") == FALSE && GetGlobalInt("is_poly") == FALSE)
{
BecomeWereWolf(oSelf, nDC);
//SendMessageToPC(GetFirstPC(FALSE), "Lycan_Forced_Vampire");
SetIsDone(oTarget, "sBecome");
}//VampireForced
if(GetPlayerCurrentTarget(oSelf) == oTarget && IsVampire(oTarget) == TRUE)
{
if(GetIsDone(oTarget, "sMax") == FALSE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oTarget, RoundsToSeconds(d4()));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oSelf, RoundsToSeconds(d4()));
SetIsDone(oTarget, "sMax");
}
}//effect max dam
}//vampire
if(IsUsingSilver(oTarget))
{
//SendMessageToPC(GetFirstPC(FALSE), "IsUsingSilver");
if(GetGlobalInt("is_poly") == FALSE && GetLastDamager(oSelf) == oTarget)
{
if(GetIsDone(oTarget, "sBecome") == FALSE)
{
BecomeWereWolf(oSelf, nDC);
//SendMessageToPC(GetFirstPC(FALSE), "Become_Forced_Silver");
SetIsDone(oTarget, "sBecome");
}
else if(GetIsDone(oTarget, "sApplyConfuse") == FALSE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectConfused(), oSelf, RoundsToSeconds(d4()));
//SendMessageToPC(GetFirstPC(FALSE), "Confusion Applied");
SetIsDone(oTarget, "sApplyConfuse");
}
if(GetAttemptedAttackTarget() == oSelf && IsUsingSilver(oTarget) && GetIsDone(oTarget, "sMax") == FALSE)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oTarget, RoundsToSeconds(d4()));
SetIsDone(oTarget, "sMax", TRUE);
}
}
}//silver
}//enemy
}//combat
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
}//while
if(GetIsInCombat(oSelf) == FALSE)
{
//SendMessageToPC(GetFirstPC(FALSE), "Not In Combat");
RevertEffects(oSelf);
SkillBuff(oSelf, 3);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDetectUndead(), oSelf);
Regeneration(oSelf, 2, RoundsToSeconds(3));
if(GetGlobalInt("murder") > 10)
{
if(GetIsDone(oSelf, "sRecord") == FALSE)
{
FeatAdd(oSelf, Feat_Lycanthropy_Act, TRUE, TRUE, TRUE);
nMurder = GetGlobalInt("murder");
//SendMessageToPC(GetFirstPC(FALSE), "New_nMurder = " + IntToString(nMurder));
FeatRemove(oSelf, Feat_Lycanthropy_Per);
SetIsDone(oSelf, "sRecord");
TransformRestore(oSelf);
SetGlobalInt("is_poly", FALSE);
SetGlobalInt("murder", 0);
}
}//New Murder
if(GetGlobalInt("is_poly") == TRUE && GetIsInCombat(oSelf) == FALSE)
{
DelayCommand(30.0f, RevertForm(oSelf, -1));
//SendMessageToPC(GetFirstPC(FALSE), "Revert_NonCom");
SetGlobalInt("is_poly", FALSE);
}
}//combat FALSE
//SendMessageToPC(GetFirstPC(FALSE), "Final_nMurder = " + IntToString(nMurder));
}//main
#6
Posté 23 octobre 2013 - 08:27
ok - cut out all of the specialised functions - unless you find my naming conventions useful to decipher the code
the effective range of the AOE is the short end of medium perception range
the effective range of the AOE is the short end of medium perception range
Modifié par Morbane, 23 octobre 2013 - 08:30 .
#7
Posté 23 octobre 2013 - 03:29
(Note that you can get a script to display with normal indentation in this forum if you use non-breaking spaces. In Windows OS with Mozilla I'm able to type those using shift+space.)
#8
Posté 23 octobre 2013 - 06:52
&nbs





Retour en haut






