Greets.
Is there anyway to create a trigger from a script? My intention is to have a custom spell create a trigger that freezes anyone who steps into it, except the caster. The point would be that the caster would create a place where he/she was protected from melee attacks.
The one thing I am unsure of is how to size the trigger. If created, is it just set to a default square (as if created by the DM in game?) or can it's size be customized?
Thanks in advance.
Creating a trigger from a script?
Débuté par
Ivanovich
, mai 05 2011 12:28
#1
Posté 05 mai 2011 - 12:28
#2
Posté 05 mai 2011 - 12:39
I have never found a way to change the size of a trigger via scripting.
I would suggest looking more a making an Area of Effect. Function - EffectAreaOfEffect
Hope that helps.
L8
I would suggest looking more a making an Area of Effect. Function - EffectAreaOfEffect
Hope that helps.
L8
#3
Posté 05 mai 2011 - 04:55
Actually, that seems like it will work quite nicely. thank you, Lightfoot.
#4
Posté 05 mai 2011 - 07:32
Ok, I've gotten most of it to work, thank you.
The problem I have is in the HeartBeat script identified in the AreaOfEffect script.
I am trying to have an effect "pulse" while the spell is in effect, but no matter what I do, the Visualeffect won't show up in the heartbeat. Here is the code:
void main()
{
object oCaster = GetAreaOfEffectCreator();
location lCaster = GetLocation(OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(778), oCaster, 0.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(792), oCaster, 1.0);
}
If I try applying the visual effect to the caster, nothing happens. If I apply it to the Location of the caster, it only occurs where the caster originally stood, and repeats until the areaeffect is over.
Thoughts?
The problem I have is in the HeartBeat script identified in the AreaOfEffect script.
I am trying to have an effect "pulse" while the spell is in effect, but no matter what I do, the Visualeffect won't show up in the heartbeat. Here is the code:
void main()
{
object oCaster = GetAreaOfEffectCreator();
location lCaster = GetLocation(OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(778), oCaster, 0.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(792), oCaster, 1.0);
}
If I try applying the visual effect to the caster, nothing happens. If I apply it to the Location of the caster, it only occurs where the caster originally stood, and repeats until the areaeffect is over.
Thoughts?
#5
Posté 05 mai 2011 - 08:04
My best guess is that the creator of the effect is not who/what you think it is. Can you post the part of your script where your area of effect is created?
#6
Posté 05 mai 2011 - 08:38
Sure. It's very simple. A scroll is used to execute the following script:
object oCaster = GetItemActivator();
int iHD = GetHitDice(oCaster);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAreaOfAffect(1500, "saronenter", "sarhb", "saronexit"), oCaster, RoundsToSeconds(iHD));
That's it. The script I posted before is the "sarhb" script.
object oCaster = GetItemActivator();
int iHD = GetHitDice(oCaster);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAreaOfAffect(1500, "saronenter", "sarhb", "saronexit"), oCaster, RoundsToSeconds(iHD));
That's it. The script I posted before is the "sarhb" script.
#7
Posté 05 mai 2011 - 09:09
Since you are not appying the command to anything in particular the
creator of the effect is the module. So in your second script when you call GetAreaOfEffectCreator it is getting the module. Therefore since oCaster is the module you can not properly apply the visual effects. Pretty sure this is your issue.
Try your line like this and see if that helps:
AssignCommand(oCaster, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAreaOfAffect(1500,
"saronenter", "sarhb", "saronexit"), oCaster, RoundsToSeconds(iHD)));
Good Luck.
creator of the effect is the module. So in your second script when you call GetAreaOfEffectCreator it is getting the module. Therefore since oCaster is the module you can not properly apply the visual effects. Pretty sure this is your issue.
Try your line like this and see if that helps:
AssignCommand(oCaster, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAreaOfAffect(1500,
"saronenter", "sarhb", "saronexit"), oCaster, RoundsToSeconds(iHD)));
Good Luck.
#8
Posté 06 mai 2011 - 06:09
That worked perfectly. Thank you, GoG.





Retour en haut






