• 0
Sign in to follow this  
vilkhl

Disguise event script help

Question

9 answers to this question

Recommended Posts

  • 0
17 minutes ago, vilkhl said:

Hi, how can I make the event runs only for 40mins? here's my current script that im using.

 

disguise.txt

change

OnClock0200:
OnClock0800:
OnClock1400:
OnClock2000:

to

OnMinute40:

 

Edited by maken06

Share this post


Link to post
Share on other sites
  • 0
6 minutes ago, maken06 said:

change

OnClock0200:
OnClock0800:
OnClock1400:
OnClock2000:

to

OnMinute40:

 

so if using this,event will start every 40mins right? if that so, the event will clash with my other event script. I set onclock because want every event runs 1 by 1 sir

Share this post


Link to post
Share on other sites
  • 0

organize the hours of the events so that they do not collide

Share this post


Link to post
Share on other sites
  • 0
12 minutes ago, maken06 said:

organize the hours of the events so that they do not collide

I mean sir,the event duration..for example, disguise event has started. and I want that event runs only for 40mins. after 40mins with or without participants, the event will automatically ends.

Share this post


Link to post
Share on other sites
  • 0
25 minutes ago, vilkhl said:

I mean sir,the event duration..for example, disguise event has started. and I want that event runs only for 40mins. after 40mins with or without participants, the event will automatically ends.

set .Rounds,5;

specifies how many rounds the event should last.

Share this post


Link to post
Share on other sites
  • 0
OnClock0240:
OnClock0840:
OnClock1440:
OnClock2040:
	setnpcdisplay "Disguise Event",795;
	set .RoundCount,0; set .Change,0; set .EventON,0;
	setnpctimer 0; stopnpctimer;
	npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
	disablenpc "Disguise Event";
	announce "The Disguise Event has ended",bc_all | bc_blue;
	end;
	

you could add this part into your script.

Share this post


Link to post
Share on other sites
  • 0

I made a little modify in my Disguise Event script. all worked as I wanted. but 1 problem is, when the event's triggered by OnClock that i setted, how to make the event's duration runs only for 40mins or automatically stop/end if no participants joined? current script now is when triggered, it never stop if no participants joined and can't be triggered again on next OnClock. im much appreciated with your help and here's my script

disguise.txt

Edited by Emistry
Merged + Hidden duplicated content.
  • Like 1

Share this post


Link to post
Share on other sites
  • 0
18 hours ago, vilkhl said:

I got 1 last request. I made a little modify in my Disguise Event script. all worked as I wanted. but 1 problem is, when the event's triggered by OnClock that i setted, how to make the event's duration runs only for 40mins or automatically stop/end if no participants joined? current script now is when triggered, it never stop if no participants joined and can't be triggered again on next OnClock. im much appreciated with your help and here's my script 

disguise.txt

yes, this script has a bug, good job on pointing this out
this event can only ends when someone ACTUALLY play this event,
the .RoundCount variable only increase when someone answer it right
if nobody ever participate in this event, or players give up after 9 correct guess,  the npc will continue non-stop

instead of ending after 40 minutes, its better to make it stop at exactly 10 rounds (.Rounds), including wrong guesses or nobody actually playing it

change the code under OnTimer30000: into something like this

OnTimer30000:
	if (.Timer) end;
	set .Change,0;
	setnpcdisplay "Disguise Event",795;
	npctalk "Disguise Event : You took too long to guess what I was. Please wait 10 seconds while I disguise again.";
	specialeffect EF_DETECT2;
	set $MonsterName$,"";
	deletepset 1;
	stopnpctimer;
	setnpctimer 0;
	set .RoundCount,.RoundCount+1;
	if (.RoundCount>=.Rounds) {
		setnpcdisplay "Disguise Event",795;
		set .RoundCount,0; set .Change,0; set .EventON,0;
		setnpctimer 0; stopnpctimer;
		npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
		end;
	}
	initnpctimer;
	end;

honestly speaking ... the way euphy rewrite this script is still not very optimize ...
if he actually learn to use sleep command, the script will be extremely clean ... I dislike using npc timers because of this reason

Edited by AnnieRuru
  • Love 1

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, AnnieRuru said:

yes, this script has a bug, good job on pointing this out
this event can only ends when someone ACTUALLY play this event,
the .RoundCount variable only increase when someone answer it right
if nobody ever participate in this event, or players give up after 9 correct guess,  the npc will continue non-stop

instead of ending after 40 minutes, its better to make it stop at exactly 10 rounds (.Rounds), including wrong guesses or nobody actually playing it

change the code under OnTimer30000: into something like this

OnTimer30000:
	if (.Timer) end;
	set .Change,0;
	setnpcdisplay "Disguise Event",795;
	npctalk "Disguise Event : You took too long to guess what I was. Please wait 10 seconds while I disguise again.";
	specialeffect EF_DETECT2;
	set $MonsterName$,"";
	deletepset 1;
	stopnpctimer;
	setnpctimer 0;
	set .RoundCount,.RoundCount+1;
	if (.RoundCount>=.Rounds) {
		setnpcdisplay "Disguise Event",795;
		set .RoundCount,0; set .Change,0; set .EventON,0;
		setnpctimer 0; stopnpctimer;
		npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
		end;
	}
	initnpctimer;
	end;

honestly speaking ... the way euphy rewrite this script is still not very optimize ...
if he actually learn to use sleep command, the script will be extremely clean ... I dislike using npc timers because of this reason

thanks Annie. u helped me a lot. all my problem solved. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this