logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
JumpToLimbo
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Nov 17, 2008 18:08    Post subject: Reply with quote

Extreme wrote:
Is JumpToLimbo() supposed to remove the creature from the area? In my loop, it is still reading them as valid in the area
It does not destroy the object, so why should it be invalid?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Mon Nov 17, 2008 18:08    Post subject: Reply with quote

i assumed that when the creature is jumped to limbo, that the creature would be removed from the area
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Nov 17, 2008 18:28    Post subject: Reply with quote

Extreme wrote:
i assumed that when the creature is jumped to limbo, that the creature would be removed from the area
GetIsObjectValid returns false only when an object does not exist in the game at all.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Mon Nov 17, 2008 18:32    Post subject: Reply with quote

i didnt realize that. Well knowing that the function is not removing them, i am going to run a loop in the area to remove the creatures after the jump happens. That way i just have the local objects to work off of. Thats the point of using the function. spawning in the creatures from local objects and not having them in game to fill the palette and not having them in game to have script fires.

That is when i can get my loop to work right. For some reason it doesnt want to grab all the creatures in a cell it leaves out one. With the knowledge that the creatures are not removed, im back trying to figure out why

Code:
{
if( !GetIsObjectValid( oArea) || (GetArea( oArea) != oArea)) return;
int      iWP   = 1;
location lALoc = Location( oArea, Vector( 5.0, 5.0, 0.0), 0.0);//creature holding room
object   oObj  = GetNearestObjectToLocation( OBJECT_TYPE_WAYPOINT, lALoc);
while( GetIsObjectValid( oObj)){
    int n = 1;int i;
    int nCount = GetLocalInt(oObj, "CreatureCount");
    for(i = 0; i < nCount; i++){
        object oSpawn = GetNearestCreature( CREATURE_TYPE_IS_ALIVE, TRUE, oObj, n);
        if(GetDistanceBetween( oSpawn, oObj) < 4.5){
            WriteTimestampedLogEntry( "Storing #"+IntToString(n)+" - "+GetName( oSpawn)+" in "+GetName(oArea));
            SetLocalObject( oArea, GetTag( oObj) +"_" +IntToString(n), oSpawn);
            JumpToLimbo(oSpawn);
            ++n;
            }
        }
    oObj = GetNearestObjectToLocation( OBJECT_TYPE_WAYPOINT, lALoc, ++iWP);
    }
}
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Tue Nov 18, 2008 21:18    Post subject: Reply with quote

i finally got this script to loop thru all the creatures in an area and grab them all. I ahve been working on that for over a week now. but now that it will cycle thru the areas, it wont spawn anything in. I am not sure if i tinkered with the jump to limbo too much tho. the loop now works finally, but no creatures are spawned Crying or Very sad All the debug messages fire fine. its like the JumpToLimbo is just now bring the creatures out anymore.

Is there anything in these scripts to break the jumptolimbo?

Storage
Code:
void RemoveCreatures(object oCreature)
{
WriteTimestampedLogEntry( "Destroying  - "+GetName(oCreature));
DestroyObject(oCreature);
}
////////////////////////////////////////////////////////////////////////////////
void StoreCreatures( object oArea)
{
if(!GetIsObjectValid(oArea) || (GetArea(oArea) != oArea)) return;
int iWP = 1;int i;
location lALoc = Location(oArea, Vector(5.0, 5.0, 0.0), 0.0);//creature holding room
object oObj = GetNearestObjectToLocation(OBJECT_TYPE_WAYPOINT, lALoc);
while(GetIsObjectValid(oObj)){
    int nCount = GetLocalInt(oObj, "CreatureCount");
    int n = 1;
    for(i = 0; i < nCount; i++){
        object oSpawn = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oObj, 1);
        if(GetLocalInt(oSpawn, "Stored")){
            oSpawn = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oSpawn, 1);
            }
        if(GetDistanceBetween(oSpawn, oObj) < 4.5){
            WriteTimestampedLogEntry( "Storing #"+IntToString(n)+" - "+GetName(oSpawn)+" in "+GetName(oArea));
            SetLocalObject(oArea, GetTag(oObj)+"_" +IntToString(n), oSpawn);
            SetLocalInt(oSpawn, "Stored", 1);
            JumpToLimbo(oSpawn);
            ++n;
            DelayCommand(0.1, DeleteLocalInt(oSpawn, "Stored"));
            DelayCommand(5.0, RemoveCreatures(oSpawn));
            }
        }
    oObj = GetNearestObjectToLocation(OBJECT_TYPE_WAYPOINT, lALoc, ++iWP);
    }
}


Spawning
Code:
////////////////////////////////////////////////////////////////////////////////
object SpawnInCreature(object oArea)
{
string sAreaTag = GetLocalString(oArea, "SpawnCell");
int nCount = GetLocalInt(GetWaypointByTag(sAreaTag), "CreatureCount");
object oSpawnRoom = GetObjectByTag("EncounterStorage");
    DebugServer("We are in SpawnInCreature()");
object oSpawn = GetLocalObject(oSpawnRoom, sAreaTag + "_" + IntToString(TrueRandom(nCount+1)));
return CopyObject(oSpawn, GetLocation(GetWaypointByTag(sAreaTag)));
}
////////////////////////////////////////////////////////////////////////////////
void CreateCreatures(object oCreature, object oArea, int nSpawnCount)
{
DebugServer("Firing the CreateCreatures()");
while( --nSpawnCount >= 0){
    DebugServer("Inside the loop to begin placing Random Encounters");
    location lSpawnPoint = GetRandomSpawnPoint(oArea, oCreature);//FIX ME
    object oMonster = SpawnInCreature(oArea);
    AssignCommand(oMonster, JumpToLocation(lSpawnPoint));
    DebugServer("Creating a creature in CreateCreature()");
    }
PlaceMandatoryCreatures(oCreature, oArea);
if((GetLocalInt(oArea, "RandomSpecial") == TRUE)&&(d100(1) <= GetLocalInt(oArea, "SpecialChance"))){
    RunRandomSpecial(oArea, oCreature);
    }
}
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Wed Nov 19, 2008 13:45    Post subject: Reply with quote

Should creatures that are put into limbo thru this function appear in the DM Client under Limbo?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Nov 19, 2008 13:57    Post subject: Reply with quote

Extreme wrote:
Should creatures that are put into limbo thru this function appear in the DM Client under Limbo?
Yes.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Wed Nov 19, 2008 13:58    Post subject: Reply with quote

weird...now they are not there.

this is not putting them there
Code:
void StoreCreatures( object oArea)
{
if(!GetIsObjectValid(oArea) || (GetArea(oArea) != oArea)) return;
int iWP = 1;int i;
location lALoc = Location(oArea, Vector(5.0, 5.0, 0.0), 0.0);//creature holding room
object oObj = GetNearestObjectToLocation(OBJECT_TYPE_WAYPOINT, lALoc);
while(GetIsObjectValid(oObj)){
    int nCount = GetLocalInt(oObj, "CreatureCount");
    int n = 1;
    for(i = 0; i < nCount; i++){
        object oSpawn = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oObj, 1);
        if(GetLocalInt(oSpawn, "Stored")){
            oSpawn = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oSpawn, 1);
            }
        if(GetDistanceBetween(oSpawn, oObj) < 4.5){
            WriteTimestampedLogEntry( "Storing #"+IntToString(n)+" - "+GetName(oSpawn)+" in "+GetName(oArea));
            SetLocalObject(oArea, GetTag(oObj)+"_" +IntToString(n), oSpawn);
            SetLocalInt(oSpawn, "Stored", 1);
            JumpToLimbo(oSpawn);
            ++n;
            DelayCommand(0.1, DeleteLocalInt(oSpawn, "Stored"));
            DelayCommand(5.0, RemoveCreatures(oSpawn));
            }
        }
    oObj = GetNearestObjectToLocation(OBJECT_TYPE_WAYPOINT, lALoc, ++iWP);
    }
}
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Nov 19, 2008 14:01    Post subject: Reply with quote

Extreme wrote:
Is there anything in these scripts to break the jumptolimbo?
Yes. You're destroying the creature 5 seconds after putting it into Limbo. If you try to spawn after 5 seconds have passed, there will be no object to copy from, and the spawn script will not work.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Wed Nov 19, 2008 14:02    Post subject: Reply with quote

I thought it was said that once they are put in limbo, they are still in the area. Which kinda kills my purpose. I want to avoid an area that has all the creatures and thri scripts firing and have them in limbo and their scipts not firing

is that what this does?
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Wed Nov 19, 2008 14:07    Post subject: Reply with quote

the goal is to ahve an area with the creatures placed and not in the pallette. then cycle thru the area and store the creatures in limbo and have it so that they are ready to be pulled several times over, but their events are not triggering because they are not present in an area. As in if they are in limbo, their events wont fire. then have the area full of nothing but local objects that will identify the creatures in limbo and by copying them, spawn them in however many times the loop runs.

But to doi thise, i would ahve to remove the creature thru scripting from the area, but not from limbo. see what im saying
?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Nov 19, 2008 14:08    Post subject: Reply with quote

JumpToLocation (if the lLocation is in another area) moves the creature to another area.
JumpToLimbo does the same, but it moves the creature to a pseudo-area (Limbo), where the creature becomes inactive.
In both cases the creature will be removed from the area, but not from the game.
DestroyObject permanently removes the object from the game, and you won't be able to do anything with it after that.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Wed Nov 19, 2008 14:10    Post subject: Reply with quote

virusman wrote:
Extreme wrote:
i assumed that when the creature is jumped to limbo, that the creature would be removed from the area
GetIsObjectValid returns false only when an object does not exist in the game at all.


i think i didnt take the right understand from this. I thought that this meant that the creature would still be in the area and in limbo
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Wed Nov 19, 2008 14:12    Post subject: Reply with quote

so, it sounds like once they are in limbo, there are no actuall creatures left in the area. And the area just is a sea of local objects.

I had this working before i got the loop to grab all the creatures in an area. But once that was fixed, i began to ahve probs. But if your saying that there is no creature in the area after being placed in limbo, and there are just the local objects, there is no reason to delete anything
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Nov 19, 2008 14:13    Post subject: Reply with quote

Extreme wrote:
i think i didnt take the right understand from this. I thought that this meant that the creature would still be in the area and in limbo
Try logging in with a DM client and moving any creature to Limbo (it's in the radial menu) - you will see how it works.
JumpToLimbo works exactly the same way as the DM client's "Jump to Limbo" button.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
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