Aller au contenu

Photo

OnEnter/OnSpawn


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

#1
Omega27

Omega27
  • Members
  • 198 messages
 Ok, so i want the spell (Call Lightning) to Apper/Cast  after the player steps on the "Encounter Trigger" to spawn a monster into the area. But not to deal damage to either the monster or the player.
So to fix it up, the player steps on the area where the trigger is, to there far left and right two huge monsters are spawned and when they enter the area thats when i want "Call Lightning" to be Cast/Appear near the area with the monster.
If anyone can help. it would be great.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
You do not want to cast the spell, you just want to use the visual effect.

effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_M);

#3
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
void main()
{
object oPC = GetEnteringObject();
location lSpawn1 = GetLocation(GetWaypointByTag("your_wp_tag1"));
location lSpawn2 = GetLocation(GetWaypointByTag("your_wp_tag2"));

if (!GetIsPC(oPC))
return;

object oSpawn1 = CreateObject(OBJECT_TYPE_CREATURE, "your_creature_resref", lSpawn1);
object oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "your_creature_resref", lSpawn2);

/*
Try the VFX without the delay first. If the timing is off, then comment out the first two lines and uncomment
the two lines with the Delay. You'll have to adjust the delay timer to suit the effect you are trying to achieve.
*/
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), oSpawn1);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), oSpawn2);
//DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), oSpawn1));
//DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), oSpawn2));
}

#4
Omega27

Omega27
  • Members
  • 198 messages
To Lightfoot and Pstemarie, im still a bit new at scripting. So with this do i need to make my own script from scratch? Or is there something i needto edit.I have something similar like this with VFX during a conversation.

#5
Baragg

Baragg
  • Members
  • 271 messages
Use the script Pstemarie provided add it to a triggers onenter, ensure that you have 2 waypoints laid out and their tags in the indicated spots, also ensure you have the critter resref in the indicated spots in the above script and you should be good.

#6
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

Baragg wrote...

Use the script Pstemarie provided add it to a triggers onenter, ensure that you have 2 waypoints laid out and their tags in the indicated spots, also ensure you have the critter resref in the indicated spots in the above script and you should be good.


What Baragg said...

#7
Omega27

Omega27
  • Members
  • 198 messages
Thanks for the help guys.