Malxados Posted March 21, 2009 Share Posted March 21, 2009 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 More sharing options...
glovemaster Posted March 22, 2009 Share Posted March 22, 2009 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 Link to comment Share on other sites More sharing options...
Malxados Posted March 22, 2009 Author Share Posted March 22, 2009 What would the script look like to paralyze everyone in the area (for a spell)? Link to comment Share on other sites More sharing options...
glovemaster Posted March 22, 2009 Share Posted March 22, 2009 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 More sharing options...
stoffe Posted March 22, 2009 Share Posted March 22, 2009 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 More sharing options...
glovemaster Posted March 22, 2009 Share Posted March 22, 2009 Whooops thanks Stoffe This one should work 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 More sharing options...
Malxados Posted March 22, 2009 Author Share Posted March 22, 2009 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 More sharing options...
GeorgNihilus Posted March 22, 2009 Share Posted March 22, 2009 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 ... 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 More sharing options...
Malxados Posted March 22, 2009 Author Share Posted March 22, 2009 Really? It gave me an error at line 8: "syntax error at "object"". If it helps, this should be for TSL. Link to comment Share on other sites More sharing options...
stoffe Posted March 22, 2009 Share Posted March 22, 2009 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 More sharing options...
Malxados Posted March 22, 2009 Author Share Posted March 22, 2009 Thanks, yours compiled fine. However, I was hoping to make one with a permanent duration and one or more with a temporary duration (which I've been unsuccessful at). Anyone? Link to comment Share on other sites More sharing options...
Star Admiral Posted March 22, 2009 Share Posted March 22, 2009 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 More sharing options...
Malxados Posted March 23, 2009 Author Share Posted March 23, 2009 Yay! All three (powers) worked! Thanks guys. Its really funny walking right past tons of enemies. I think I even froze one in mid-air. Hopefullly after I finish some technicalities I can upload it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.