View previous topic :: View next topic |
Author |
Message |
rpgbl
Joined: 01 Oct 2009 Posts: 30
|
Posted: Wed Sep 22, 2010 19:44 Post subject: Area Instances for NWNX4 |
|
|
Hi guys,
I want to create area instances (including objects in it) for each player so basically the players will play under one server but cant see or meet other players. Maybe I can do it using area instances ? is there any area instances script for nwnx4 ? Any suggestion please ? Thank you.
ps: im using nwn4 and mysql to store some game information. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
|
Back to top |
|
|
rpgbl
Joined: 01 Oct 2009 Posts: 30
|
Posted: Tue Nov 09, 2010 21:54 Post subject: |
|
|
Hi Virusman,
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) :
Code: |
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. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|