Aller au contenu

Photo

Applying vfx to object [resolved]


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

#1
PJ156

PJ156
  • Members
  • 2 988 messages
I am having trouble with the script below. Why might it not fire?

The object is a rock placeable that is not environmental, in the game the script is called out of a convo between a creature and an ipoint. I can get a VFX to fire so might there be a reason that is to do with the fx_fire_lg.

The script fires fine in another part of the mod Image IPB

void main()
{
object oPC = GetPCSpeaker();
object oTarget;
oTarget = GetObjectByTag("2000_cs_rock");
effect eEffect;
eEffect = EffectNWN2SpecialEffectFile("fx_fire_lg");
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);

}

Any thoughts

PJ

Modifié par PJ156, 22 avril 2012 - 08:13 .


#2
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Is it the same script in use in the other part of the module ( you only have one item with the tag "2000_cs_rock", you might be having it show up in the wrong spot ). Make sure it's a unique tag, or get the nearest with that tag instead.

I'd put some debug sendmessagetopc type code in and review if it's even firing and what it thinks it's applying things to.

#3
PJ156

PJ156
  • Members
  • 2 988 messages
I will try the tag issue. It is in the same campaign but not the same mod.

Debug messages is new to me but I will try that too, I'm no scripter as evidenced by the post :)

Thanks for the reply

PJ

#4
Shaughn78

Shaughn78
  • Members
  • 637 messages
I like to use the function GetNearestObjectByTag() instead of GetObjectByTag(). If you do have an object with the same tag it will get the nearest and I believe it will only check the current area.

#5
PJ156

PJ156
  • Members
  • 2 988 messages
I will try that but I'm not sure its the tag.



void main()
{
object oPC = GetPCSpeaker();
SendMessageToPC(oPC, "Script fired");
object oTarget;
oTarget = GetObjectByTag("2006_cs2_rock");
effect eEffect;
eEffect = EffectNWN2SpecialEffectFile("fx_fire_lg");
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
object oTarget2;
oTarget2 = GetObjectByTag("2006_cs2_rock_2");
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_HIT_FIRE), oTarget2);
SendMessageToPC(oPC, "End of script");
}

This script starts and finishes according to the messages. The second VFX is applied but the first one (the fx) is not.

Is there a permanent fire VFX to work the same way as fx_fire_lg? I have not found one.

I tried to browse the fx files and they all seem to be there including the one I am calling Image IPB

PJ

#6
MasterChanger

MasterChanger
  • Members
  • 686 messages
A number of VFX don't work when applied to an object, only at a location. I'm not sure why that is. If I had to guess, the large fire VFX you're using would fall under that category since it seems like a placed effect.

#7
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Make sure the rock is a placeable, not an environmental object. Make sure it is not set to static as well.

#8
PJ156

PJ156
  • Members
  • 2 988 messages
Static rocks ... who needs em eh!

That was it, four hours of tearing my hair our trying different script combinations and I had forgot to set my rocks to static.

PJ

#9
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Ah, yes the old static rocks. I can't count how many times I've done that. Glad it works.

My next suggestion was going to be that rocks are not very flammable.

#10
Alupinu

Alupinu
  • Members
  • 528 messages

PJ156 wrote...

Static rocks ... who needs em eh!

That was it, four hours of tearing my hair our trying different script combinations and I had forgot to set my rocks to static.

PJ


LMAO! Pj I've have so been there! Image IPB

#11
PJ156

PJ156
  • Members
  • 2 988 messages
I think it's an occupational hazard ...