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

07-03-2009, 10:08 PM
|
Sarnak
|
|
Join Date: Oct 2008
Location: USA
Posts: 92
|
|
Instancing
Ok, I can do a basic quest to setup an instance, that's easy. My question will be for something a little bit more involved, unless I'm just completely missing something simple. I'm still learning daily in perl, so I have to look at examples for some of the things I want to do, but here is what I've got so far just for testing purposes.
Code:
sub EVENT_SAY {
if ($text =~/Hail/i){
quest::say ("Good day to you, $name. Are you ready for a [test]?"); }
if ($text =~/test/i){
quest::CreateInstance(guildhall, 0, 300);
quest::GetInstanceID(guildhall, 0);
quest::AssignToInstance(1);
quest::say ("Ok do you want to go now?");
}
if ($text =~/go/i){
quest::MovePCInstance(345, 1, 0, 1, 2.7, 0);
}
}
This is a very simple thing to just load into an instance and I'm obviously assigning them to instance id 1, just because I know that's going to be the next id available. What I want to do is if I set this up to bring someone to a zone, and there might be potentially be more than 1 instance running, how would I use the getinstanceId command to assign that person to their particular instance. I would like to also expand this to allow guilds to have their own guildhall at some point, but my knowledge in perl is lacking on how to do that with these commands. (I know these aren't all the instance commands.) Anyway, any help would be much appreciated!
|
 |
|
 |

07-03-2009, 11:29 PM
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
GetInstanceID() returns the id of the instance so something like this might work:
Code:
my $instid = quest::GetInstanceID(guildhall, 0);
quest::AssignToInstance($instid);
|

07-04-2009, 09:40 PM
|
Sarnak
|
|
Join Date: Oct 2008
Location: USA
Posts: 92
|
|
Of course. Doing it like that slipped my mind. I haven't been able to test that yet but I'll see what I can get working once I get to it. Thanks.
|

07-04-2009, 10:35 PM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Code:
my $i_id = quest::CreateInstance("guildhall", 0, 300);
quest::AssignToInstance($i_id);
One less line.
|

07-04-2009, 10:43 PM
|
 |
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
question: I assume you can make more than 1 instance of the same zone at the same time?
|

07-05-2009, 02:44 AM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Yes but if you try creating several instances of the same zone of the same version for one person it's going to cause problems.
For example:
You create an instance version 0 and give it to person A
You create an instance version 1 and give it to person A
You create an instance version 2 and give it to person A
You create an instance version 3 and give it to person A
And they will easily be able to switch between them but if instead you try:
You create an instance version 0 and give it to person A
You create an instance version 1 and give it to person A
You create an instance version 1 and give it to person A
You create an instance version 1 and give it to person A
It will cause problems as the server wont be able to tell which id you really want to be in because the quest::GetInstanceID(name, version) only returns one value.
|

07-13-2009, 12:12 AM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
what if you wanted to do something involving qglobals? So like if you were going to do an instance for the first time it would send u to one version, then if you beat that one, it would send u to the second one. Would I need to make a bunch of different versions using GeorgeS's tool and would it let multiple people in if they both had the same qglobal value? Or would it make them wait until the first person finished it?
|

07-13-2009, 05:53 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
Disregard. Misread question.
|

07-13-2009, 10:59 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
anyone know why this
Code:
quest::CreateInstance("arena", 1, 360);
my $instid = quest::getinstanceID("arena",1);
quest::assigntoinstance($instid);
quest::movepcinstance(77, $instid, -3, 3.6, -2.1);
doesn't have any effect? I know it's not the stuff around that because I replaced this part of the quest with quest::zone(poknowledge); and it worked fine. I guess I just wrote this part wrong
|

07-13-2009, 11:09 PM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Code:
quest::CreateInstance("arena", 1, 360);
my $instid = quest::GetInstanceID("arena",1);
quest::AssignToInstance($instid);
quest::MovePCInstance(77, $instid, -3, 3.6, -2.1);
quest:: commands are case sensitive.
|

07-13-2009, 11:43 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
that worked but now I have another problem. It just sends me to the normal arena instead of version 1 of it
|

07-13-2009, 11:53 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Also, it appears that it isn't assigning the instance to the player. It is creating it successfully, but that's pretty much it
|

07-14-2009, 12:27 AM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
ok I got it working. I just changed it to
Code:
my $i_id = quest::CreateInstance("arena", 1, 360);
quest::AssignToInstance($i_id);
quest::MovePCInstance(77, $i_id, -41, 131, -0.5);
I guess that works better than what I was doing. But now for some reason, no matter what time i put, it defaults to like 2 minutes 19 seconds.
|

07-14-2009, 05:16 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Does anyone know how I could do something to destroy an instance when the player leaves it? I know there is quest::destroyinstance(), but how would I get it to destroy the instance the player is leaving?
|

07-14-2009, 05:44 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Are you only allowing 1 char in the zone per instance? If so, you could probably put that in the player.pl for the zone under an EVENT_ZONE.
|
Thread Tools |
|
Display Modes |
Linear 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 12:25 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |