I thought I has the code needed to do it but it is not working at all.
Code to follow (so formatting doesnt get borked)
Trying to make an fx_* file appear on a heartbeat on a object
Débuté par
Morbane
, mars 14 2011 10:27
#1
Posté 14 mars 2011 - 10:27
#2
Posté 14 mars 2011 - 10:28
void main()
{
object oObelisk = OBJECT_SELF;
location lLoc = GetLocation(oObelisk);
effect eHB = EffectNWN2SpecialEffectFile("fx_hag_spawn01", oObelisk, lLoc);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHB, oObelisk);
}
I haven't been crunching code for a while - what am I missing here?
#3
Posté 14 mars 2011 - 11:24
Perhaps instead try to ApplyEffectToLocation().
#4
Posté 14 mars 2011 - 05:01
Yep Tried that - no luck.
So - have I coded the effect correctly? If so I will look to other things for roadblocks.
So - have I coded the effect correctly? If so I will look to other things for roadblocks.
#5
Posté 14 mars 2011 - 07:00
unless the effect is a beam or projectile, the only argument you need for the function "EffectNWN2SpecialEffectFile" is the string name of the file you are using. You also should write "fx_hag_spawn01.sef", instead of just "fx_hag_spawn01".
#6
Posté 14 mars 2011 - 07:41
Thanks M. Got it to work - but i had one more thing that was needed: apply the sef file to a waypoint.
void main()
{
object oObelisk = OBJECT_SELF;
location lLoc = GetLocation(GetWaypointByTag("wp_fx_a"));
effect eHB = EffectNWN2SpecialEffectFile("fx_hag_spawn01.sef");
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eHB, lLoc);
}
It is good to have a few people that are always willing to help!
void main()
{
object oObelisk = OBJECT_SELF;
location lLoc = GetLocation(GetWaypointByTag("wp_fx_a"));
effect eHB = EffectNWN2SpecialEffectFile("fx_hag_spawn01.sef");
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eHB, lLoc);
}
It is good to have a few people that are always willing to help!
#7
Guest_Chaos Wielder_*
Posté 14 mars 2011 - 07:45
Guest_Chaos Wielder_*
Hm, I never write .sef in my own work with special effect files. Still, if it works, it works!--so I'm just quibbling.
#8
Posté 14 mars 2011 - 07:56
Apparently it works both ways. I suspect morbane's main problem was fixed when he applied it to a waypoint.
Glad you got it working.
Glad you got it working.
Modifié par M. Rieder, 14 mars 2011 - 07:57 .
#9
Posté 14 mars 2011 - 08:12
You don't need the .sef as said above.
The issue with the origianl post was the additional information in the EffectNWN2SpecialEffectFile() funtion. Your second script post doesn't include it and it worked. Also the origianl script shouldn't have complied, you had a location for a vector.
EffectNWN2SpecialEffectFile("fx_hag_spawn01", oObelisk, lLoc);
EffectNWN2SpecialEffectFile( string sFileName, object oTarget=OBJECT_INVALID, vector vTargetPosition=[0.0,0.0,0.0] );
The issue with the origianl post was the additional information in the EffectNWN2SpecialEffectFile() funtion. Your second script post doesn't include it and it worked. Also the origianl script shouldn't have complied, you had a location for a vector.
EffectNWN2SpecialEffectFile("fx_hag_spawn01", oObelisk, lLoc);
EffectNWN2SpecialEffectFile( string sFileName, object oTarget=OBJECT_INVALID, vector vTargetPosition=[0.0,0.0,0.0] );
#10
Posté 14 mars 2011 - 08:21
Another thing on top of all that - the object the script was attached to had to be non static.
Shaughn - The extra parameters were removed before I got it working - M. mentioned that they were unnecessary, so I dropped them before posting the working script.
Further, I used the same script on 3 more similar objects and it did not work until I made them non static.
Shaughn - The extra parameters were removed before I got it working - M. mentioned that they were unnecessary, so I dropped them before posting the working script.
Further, I used the same script on 3 more similar objects and it did not work until I made them non static.
#11
Posté 14 mars 2011 - 08:28
Morbane wrote...
Another thing on top of all that - the object the script was attached to had to be non static.
Shaughn - The extra parameters were removed before I got it working - M. mentioned that they were unnecessary, so I dropped them before posting the working script.
Further, I used the same script on 3 more similar objects and it did not work until I made them non static.
The thing to keep in mind is that "static" means just that: they cannot be changed in-game in any way, whether by interaction with a player or by script. If you want an placeable to be static (or environmental) and still be able to put something in its vicinity, using a waypoint like you did would be the ticket.





Retour en haut







