|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
|
|
|
10-10-2009, 02:19 PM
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
instance creation script help pls
Code:
if($zoneid == 189) {
if(!defined($qglobals{$name."tutb"})) {
my $instanceID = quest::CreateInstance("tutorialb", 1, 64800);
quest::AssignToInstance($instanceID);
quest::setglobal($name."tutb",$instanceID,7);
quest::setglobal($name."zone",$instanceID,7);
quest::MovePCInstance(189, $instanceID, -696.0, 271.2, 16.4);
}
else
if (defined($qglobals{$name."tutb"}) && !defined($qglobals{$name."zone"})) {
my $instanceID = $qglobals{$name."tutb"};
quest::AssignToInstance($instanceID);
quest::setglobal($name."zone",$instanceID,7);
quest::MovePCInstance(189, $instanceID, -696.0, 271.2, 16.4);
}
}
if($zoneid != 189 && defined($qglobals{$name."zone"})) {
quest::delglobal($name."zone");
}
basically i'm wantin to check globals, and see if they are defined. if not then create instance, set globals, and move pc to instance, if one is, but other isn't then get $instanceID from one, assign to instance, set global, and move pc. and of course, if not the correct zone, and global is defined, then delete it. my problem is I can't get it to create an instance, or define globals, i've been mulling it over for hours now, and idk whats wrong with it. could someone take a look at this and tell me whats wrong? I know its probably something stupid. thanks
|
|
|
|
10-10-2009, 02:39 PM
|
Hill Giant
|
|
Join Date: Jan 2007
Posts: 124
|
|
This might not help, but I have had some trouble getting the quest globals to work.
Below is what I had to do to get the quest global to work.
Code:
quest::setglobal("buff", $text, 0, "M5");
#I'm not sure why I need the next line, the line above should set the $qglobals{buff}, but it wouldn't work for me.
$qglobals{buff} = $text;
Also double/triple check that your npc has the qglobal is set to 1 in the database.
HTH
__________________
Syl
"The significant problems we have cannot be solved at the same level of thinking with which we created them."
Albert Einstein
|
10-10-2009, 02:43 PM
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
this is for a player.pl script, not an NPC, also I haven't had a problem before defining variables through my *variable* ==. its gotta be a syntax problem, but Idk what.
|
10-10-2009, 07:53 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
You don't need the $name. part and to set a global you need to show the npc/player/zone level.
|
10-10-2009, 08:14 PM
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
Quote:
Originally Posted by joligario
You don't need the $name. part and to set a global you need to show the npc/player/zone level.
|
$name. is part of the global name,helps me identify what global is for who, and i'm not understanding what you mean by need to show the npc/player/zone level. could you please clarify?
|
10-11-2009, 10:12 AM
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
Code:
if($zoneid == 189 && !defined($qglobals{$name."tutb"}) && $ulevel ==1) {
my $instanceID = quest::CreateInstance("tutorialb", 1, 64800);
quest::AssignToInstance($instanceID);
quest::setglobal($name."tutb",$instanceID,7,"H18");
quest::setglobal($name."zone",$instanceID,7,"H18");
quest::MovePCInstance(189, $instanceID, -696.0, 271.2, 16.4);
}
if ($zoneid == 189 && defined($qglobals{$name."tutb"}) && !defined($qglobals{$name."zone"})) {
my $instanceID = $qglobals{$name."tutb"};
quest::AssignToInstance($instanceID);
quest::setglobal($name."zone",$instanceID,7,"H18");
quest::MovePCInstance(189, $instanceID, -696.0, 271.2, 16.4);
}
if($zoneid != 189 && defined($qglobals{$name."zone"})) {
quest::delglobal($name."zone");
}
got it working, here is a working version, for anyone that wants to do somethin similar. I just rewrote it, so honestly, IDK what was causing it to not work. but it works now, so thats all I care lol.
|
10-11-2009, 10:24 AM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
I was mistaken. You did have the access of "7" in there. It was the time component you were missing in your original script. 18 hours.
|
10-11-2009, 10:28 AM
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
I had caught that after I had posted, when I was tryin to fix the old script, but it still wasn't workin. so I just scrapped it, and rewrote. kinda annoying that I couldn't figure out what was originally wrong, but the new script works now. so /shrug
|
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 08:05 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|