Jump to content
  • 0

Special effect command


ScriptingPhailure

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   21
  • Joined:  01/13/12
  • Last Seen:  

Is there a way to loop the special effect command? I want the effect to repeat itself for the same duration as progress bar. In my case 10 secs. I want the effect to go off while charging and loop until charge is completed.

Edited by ScriptingPhailure
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

Refer to the portion "VIII - Effects "

http://rathena.org/b...e-for-browedit/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   21
  • Joined:  01/13/12
  • Last Seen:  

I tried that and it gave me an infinite loop. Could you take a look at my script and tell me where to apply and what?

 new_1-3,100,120,3	script	Fishing Spot	857,15,15,{

mes "[Yourself]";
mes "Maybe I should go fishing.";
switch(select("yes:no")) {
case 1:
close2;
goto OnAction;
end;



case 2:
mes "ok bye failure";
close;
}

OnAction:
[b]specialeffect 54;  [/b]//I want this to loop for 10 secs while the progress bar charges up
progressbar "^000000",10;
set fishingz, rand(7);
if (fishingz == 0) goto gotfish;
if (fishingz == 1) goto gotfish;
if (fishingz == 2) goto gotfish;
if (fishingz == 3) goto gotfish;
if (fishingz == 4) goto gotfish;
if (fishingz == 5) goto gotfish;
if (fishingz == 6) goto gotfish;
close;

OnTouch:						   
showevent 2,0;					
end;	  

specialeffect2 14 ;
getitem 579,1;
close;
} 

Edited by ScriptingPhailure
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  43
  • Reputation:   2
  • Joined:  01/17/12
  • Last Seen:  

1.

set .@duration, 10;
set .@delay, 1000;
set .@timeToEnd, gettimetick(2) + 
while (gettimetick(2)<.@timeToEnd) {
specialeffect whatever;
sleep2 .@delay;
}

2.

set .working, 1;
set .@delay, 1000;
initnpctimer;
while (.working) {
specialeffect whatever;
sleep2 .@delay;
}
end;

OnTimer[something]:
.working = 0;
end;

Needless to mention the 1) is much better, but you can choose the one is more convenient for you.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   21
  • Joined:  01/13/12
  • Last Seen:  

Ok the effect repeats but I need to go off while the progress bar is charging up, either the effect goes off and then the bar charges or it charges after the bar is full.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

OnEffect:
set @loop_effect, 1;
set .@delay, 500;
while ( @loop_effect ) {
	specialeffect 54;
	sleep2 .@delay;
}
end;

OnAction:
doevent strnpcinfo(3) + "::OnEffect";
progressbar "^000000",10;
set @loop_effect, 0;

Since progressbar() pause the script you have to do the effect loop in another """thread""".

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   21
  • Joined:  01/13/12
  • Last Seen:  

OnEffect:
set @loop_effect, 1;
set .@delay, 500;
while ( @loop_effect ) {
	specialeffect 54;
	sleep2 .@delay;
}
end;

OnAction:
doevent strnpcinfo(3) + "::OnEffect";
progressbar "^000000",10;
set @loop_effect, 0;

Since progressbar() pause the script you have to do the effect loop in another """thread""".

This effect still triggers after the progress bar finishes charging not while. Then it's an infinite loop.

Is it possible to use doevent to trigger two events at once?

Edited by ScriptingPhailure
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

Weird, maybe you should put a sleep2(1); just after the doevent() to force the script engine to execute it before it pause the script with the progressbar().

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   21
  • Joined:  01/13/12
  • Last Seen:  

That didn't work either. I feel like pulling out my hair.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...