Thanks for the help so far. Download link doesn't work btw, but so far I've managed to make my own script suited to my own needs based off of someone's I've found. But I've ran into a real problem now. Right now it just causes the infamous TMI error.
#include "are_eff_quake"
void RunVisualEffectLoop(object oVFX, object oPC, float fFrequency)
{
if((GetArea(oVFX) != GetArea(oPC)))
{
DeleteLocalInt( oVFX, "VFXLoopActive");
return;
}
effect eRocksoup = EffectVisualEffect(137);
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, eRocksoup, GetLocation(oVFX));
DelayCommand( fFrequency, RunVisualEffectLoop(oVFX, oPC, fFrequency));
}
void ShakeScreen(object oPC)
{
if (GetArea(oPC)!=OBJECT_SELF)
return;
effect eVis=EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
location lLoc=GetLocation(oPC);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eVis,lLoc);
if (!GetLocalInt(OBJECT_SELF,"StopShake"))
DelayCommand(3.0,ShakeScreen(oPC));
RandomQuakes();
}
void main()
{
object oPC=GetEnteringObject();
if (!GetIsPC(oPC) || GetIsDM(oPC))
return;
int nCount = 1;
object oFirst = GetObjectByTag("obj_looprockfirst");
object oVFX = GetObjectByTag("obj_looprock");
if(!GetIsObjectValid(oVFX) || GetLocalInt(oVFX, "VFXLoopActive")) return;
while (GetIsObjectValid(oVFX))
{
SetLocalInt(oVFX, "VFXLoopActive", TRUE);
float fDelayMagnitude = 7.0 +IntToFloat(Random(5));
RunVisualEffectLoop(oVFX, oPC, fDelayMagnitude);
object oVFX = GetNearestObjectByTag("obj_looprock", oFirst, 1);
}
if (!GetLocalInt(OBJECT_SELF,"StopShake"))
ShakeScreen(oPC);
}
The thing I added that caused the TMI was when I attempted to make the visual effect play on every waypoint I have designated with the tag "obj_looprock". If I don't do the whole while loop thing, it works. But then it only plays on one waypoint. How do you guys make it play through ALL the waypoints with the tag "obj_looprock", without the TMI error?
EDIT: Nevermind, thanks a lot Borden! I took snippets of your iCount and while code and instead made a lot of waypoints entitled obj_looprock_# to like 15. It now plays at every waypoint
Modifié par mwplayer, 20 juin 2011 - 08:32 .