|
|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
| Quests::Q&A This is the quest support section |

05-24-2009, 10:22 PM
|
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
I tried that, but it still doesnt work
|

05-24-2009, 10:35 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Yeah, you do definitely need to make sure to use all uppercase. That script should work fine when you have it set like this:
Code:
sub EVENT_SPAWN {
quest::settimer("Timer1",10);
}
sub EVENT_TIMER {
if ($timer eq "Timer1"){
quest::say("text1");
quest::stoptimer("Timer1");
quest::settimer("Timer2",10);
}
if ($timer eq "Timer2"){
quest::say("text2");
quest::stoptimer("Timer2");
quest::settimer("Timer3",10);
}
if ($timer eq "Timer3"){
quest::say("text3");
quest::stoptimer("Timer3");
quest::settimer("Timer4",10);
}
if ($timer eq "Timer4"){
quest::say("text4");
quest::stoptimer("Timer4");
quest::settimer("Timer1",10);
}
}
Make sure to do a #reloadquest and also a #repop to start the timer. Also, make sure you have the script named properly.
|

05-24-2009, 10:44 PM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,500
|
|
Maybe try integers instead of strings for timer id as a last resort.
|

05-24-2009, 11:06 PM
|
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
If you use integers, change eq to ==
Code:
sub EVENT_SPAWN {
quest::settimer(1, 10);
}
sub EVENT_TIMER {
if ($timer == 1){
quest::say("text1");
quest::stoptimer(1);
quest::settimer(2, 10);
}
if ($timer == 2){
quest::say("text2");
quest::stoptimer(2);
quest::settimer(3, 10);
}
if ($timer == 3){
quest::say("text3");
quest::stoptimer(3);
quest::settimer(4, 10);
}
if ($timer == 4){
quest::say("text4");
quest::stoptimer(4);
quest::settimer(1, 10);
}
}
|

06-18-2009, 11:47 PM
|
|
Discordant
|
|
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
|
|
I was messing around with event timers the other night and it appeared that the timer could not get the player that triggered the event. Things like quest::movepc() didn't function and $client wasn't exported for the timer event.
|
 |
|
 |

06-19-2009, 10:17 AM
|
|
Hill Giant
|
|
Join Date: Apr 2008
Location: Milwaukee
Posts: 141
|
|
Getting $client in a timer in most cases will not happen cause a timer is not triggered by the client. Is these cases you have to store the client in another variable or qglobal. I have the common types below, but there are many other ways of doing this too.
Code:
sub EVENT_SPAWN {
$x = $npc->GetX();
$y = $npc->GetY();
quest::set_proximity($x - 20, $x + 20, $y - 20, $y + 20);
quest::settimer("testclient",5);
}
sub EVENT_SAY {
if($text=~/hail/i)
{$firstclient = $client;}
}
sub EVENT_AGGRO {
$secondclient = $client;
}
sub EVENT_COMBAT {
$thirdclient = $client;
}
sub EVENT_ENTER {
$fourthclient = $client;
}
sub EVENT_ENTERZONE {
$fifthclient = $client;
}
sub EVENT_TIMER {
if ($timer eq "testclient") {
if ($firstclient != 0)
{$cone = $firstclient->GetName();}
if ($secondclient != 0)
{$ctwo = $secondclient->GetName();}
if ($thirdclient != 0)
{$cthree = $thirdclient->GetName();}
if ($fourthclient != 0)
{$cfour = $fourthclient->GetName();}
if ($fifthclient != 0)
{$cfive = $fifthclient->GetName();}
quest::say("$cone");
quest::say("$ctwo");
quest::say("$cthree");
quest::say("$cfour");
quest::say("$cfive");
}
}
|
 |
|
 |

06-19-2009, 10:43 AM
|
|
Discordant
|
|
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
|
|
Some of the data is sent to the timer event, such as $name of player and $entity_list for the zone. I was specifically trying to functions for the client but those seemed to fail as well, strangely enough.
Code:
sub EVENT_TIMER
{
quest::say("Hello $name");
$c = $entity_list->GetClientByName($name);
$charname = $c->GetName();
quest::say("Hi $charname");
$c->MovePC(1,1,1,1);
$c->CastSpell(1,1);
}
Output:
Code:
NPC says, 'Hello JohnDoe'
NPC says, 'Hi JohnDoe'
*crickets*
*more crickets*
Not an actual script but prefect representation if all function input had valid data.
|

06-19-2009, 05:58 PM
|
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
not sure if this will fix it, but the client movepc function takes 5 parameters... zoneid, x, y, z, heading
and since movepc failed, castspell probably didn't even get called.
|
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 02:37 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |