I've played around with createareainstancefromsource, while it does create area instances, I still cant make it worked according to what I need. So my first question is : are all the objects inside the area are also instanced ?
Here is what I want to do : When player 1 enter the game, go to area1. When player 2 enter the game when player 1 is inside the game, go to instance of area 1. By doing so I want player 1 and player 2 wont meet each other.
So I've got the area instanced but cant allocate the player to the area I want. Here is my code (I put it in onPCLoad) :
void main(){
string room1status;
string room2status;
object oPC;
string sAreaname;
int i;
int iNumberPlayers=0;
room1status=GetGlobalString("groom1status");
room2status=GetGlobalString("groom2status");
iNumberPlayers=GetGlobalInt("giNumberPlayers");
object areaid=GetObjectByTag("NW_WAYPOINTspooks",0);
string getareatagfirst=GetTag(areaid);
oPC=GetFirstPC();
if(room1status=="nobody"||room1status=="") {
//if there is nobody just use the first NW_WAYPOINTspooks
SetGlobalString("groom1status","somebody");
} else {
//when there is somebody, create instance of the area and then access the NW_WAYPOINTspooks in the instanced area
object areaid=GetObjectByTag("Area2",0);
string getareatagfirst=GetTag(areaid);
CreateInstancedAreaFromSource(areaid);
areaid=GetObjectByTag("NW_WAYPOINTspooks",1);
getareatagfirst=GetTag(areaid);
SetGlobalString("groom2status","somebody");
}
location lLoc = GetLocation(areaid);
AssignCommand ( oPC, JumpToLocation (lLoc));
}
Any help please? I need to run a simultanuous single player game (single player games that run under one server so basically each player can NOT see each other) and this createinstancearea is probably the last solution to do so because other ways I've tried all of them require impossible hardware resources.
Modifié par RPGBL777, 09 novembre 2010 - 08:46 .





Retour en haut






