Jump to content

Home

Area time stop?


Malxados

Recommended Posts

I have two questions:

1) What exactly is the time stop effect ("effect EffectTimeStop();") and will it work for TSL?

 

2)How would I apply said effect or another (such as paralysis) to every enemy in/ the entire area?

 

Thanks

Malxados

 

EDIT: BTW, I was hoping to use this as a force power script.

Link to comment
Share on other sites

The EffectStopStop() simply stops everything, does what it says really. Its kinda like a pause without being paused - So I'd imagine it probably is what the game fires when you hit pause.

 

The effect is pretty useless as the PC can't move either. Would have been pretty cool otherwise though :p

Link to comment
Share on other sites

The script to paralyse all hostiles in the current area would looks like this:

void main() {
   // Duration of paralysis
   fDuration = [color=cyan]10.0[/color]; // Just change this to how long you want to paralyze enemies for.

   // Paralyse all hostiles in the area.
   object oTarget = GetFirstObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);
   while(GetIsObjectValid(oTarget)) {
       if(GetIsEnemy(oTarget)) {
           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, oTarget, EffectParalyze(), fDuration);

           oTarget = GetNextObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);
       }
   }
}

 

Just change the 10.0 to how ever long it needs to be for.

Link to comment
Share on other sites

The script to paralyse all hostiles in the current area would looks like this:

Show spoiler
(hidden content - requires Javascript to show)
void main() {
   // Duration of paralysis
   fDuration = 10.0; // Just change this to how long you want to paralyze enemies for.

   // Paralyse all hostiles in the area.
   object oTarget = GetFirstObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);
   while(GetIsObjectValid(oTarget)) {
       if(GetIsEnemy(oTarget)) {
           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, oTarget, EffectParalyze(), fDuration);

           oTarget = GetNextObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);
       }
   }
}

 

Just change the 10.0 to how ever long it needs to be for.

 

Move the GetNextObjectInArea() line outside the conditional check or the loop would get stuck as soon as it encounters any NPC who isn't hostile to the one running the script. :)

 

Also you have the Target and Effect parameters in the wrong order in the ApplyEffectToObject() call.

Link to comment
Share on other sites

Whooops :dozey: thanks Stoffe :lol:

 

This one should work :roleyess:

void main() {
   // Duration of paralysis
   fDuration = [color=cyan]10.0[/color]; // Just change this to how long you want to paralyze enemies for.

   // Paralyse all hostiles in the area.
   object oTarget = GetFirstObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);
   while(GetIsObjectValid(oTarget)) {
       if(GetIsEnemy(oTarget)) {
           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectParalyze(), oTarget, fDuration);  
       }
       oTarget = GetNextObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);
   }
}

Link to comment
Share on other sites

Thanks.

I'll hopefully be able to try it out soon.

 

EDIT: Also, what would I put for the duration to make it permanent?

 

EDIT2: It gives me the error "Undeclared identifier "fDuration"" for lines 3 and 9, even if I don't change anything.

Link to comment
Share on other sites

EDIT: Also, what would I put for the duration to make it permanent?

 

I don't know, just put a bigggggg number ...

 

EDIT2: It gives me the error "Undeclared identifier "fDuration"" for lines 3 and 9, even if I don't change anything.

 

You need to declare fDuration before giving it a number, try this one, it compiled clean for me but I haven't tested it :xp: ...

 

void main() {

 

float fDuration;

// Duration of paralysis

fDuration = 1000.0 // Just change this to how long you want to paralyze enemies for.

 

// Paralyse all hostiles in the area.

object oTarget = GetFirstObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);

while(GetIsObjectValid(oTarget)) {

if(GetIsEnemy(oTarget)) {

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectParalyze(), oTarget, fDuration);

}

oTarget = GetNextObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);

}

}

 

hope it helps ;)

Link to comment
Share on other sites

Thanks.

I'll hopefully be able to try it out soon.

 

EDIT: Also, what would I put for the duration to make it permanent?

 

EDIT2: It gives me the error "Undeclared identifier "fDuration"" for lines 3 and 9, even if I don't change anything.

 

Change DURATION_TYPE_TEMPORARY to DURATION_TYPE_PERMANENT when applying the effect.

 

As for fDuration it hasn't been declared yet when a value is assigned to it, which must be done for the compiler to know what data type it's supposed to be. But if the effect is supposed to be permanent it has no purpose and can be removed.

 

void main() {   
   effect eParalyze = EffectParalyze();
   object oTarget = GetFirstObjectInArea();

   while (GetIsObjectValid(oTarget)) {
       if (GetIsEnemy(oTarget)) {
           ApplyEffectToObject(DURATION_TYPE_PERMANENT, eParalyze, oTarget);  
       }

       oTarget = GetNextObjectInArea();
   }
}

Link to comment
Share on other sites

Same as what stoffe posted, except change DURATION_TYPE_PERMANENT to DURATION_TYPE_TEMPORARY and add a time such as 30.00.

 

void main() {   
   effect eParalyze = EffectParalyze();
   object oTarget = GetFirstObjectInArea();

   while (GetIsObjectValid(oTarget)) {
       if (GetIsEnemy(oTarget)) {
           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyze, oTarget, 30.00);  
       }

       oTarget = GetNextObjectInArea();
   }
}

 

- Star Admiral

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...