Scripters needed

General Discussion is for anything related to Blackstone not covered in the other forums.

Moderators: DM_eaze, Luceran, DM_Jaydaan, ST_DM_Myle, dm_xeen1, DM Nexus, DM_TrainWrek, Carpe_DM1, DM_Unicorn, DM_Griphon, DM_Shadowlands, dm_zane, DM_Centaur, DM_Mystic, DM Rendyll, DM_Avalon

User avatar
Blackrain
Commoner
Commoner
Posts: 10
Joined: Wed Jul 11, 2007 7:48 pm
Location: no where for very long

Scripters needed

Post by Blackrain »

I need a scripter who thinks they can fix my mod it opens in toolset but not in nwn for a long time it was corrupted but i managed to find a set aside copy so anyone who can help would be greatly needed and at the moment i don't have the internet but should have it back soon and can pay said person 100k
In these winds i lay my dead and in these sins i hold my head
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

I hope you are not serious, try this:

This is based on the PM you sent me that said you could load it in the toolset but not play it.

1.Make a new area and put the start in it.
2.Rebake all the areas.
3.Go to file->select->area and export each area to a file.
Make a new module and import them one by one.

-driller
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

oh jesus really? I just had this problem with my mod...maybe I'll try importing
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

driller wrote:I hope you are not serious, try this:

This is based on the PM you sent me that said you could load it in the toolset but not play it.

1.Make a new area and put the start in it.
2.Rebake all the areas.
3.Go to file->select->area and export each area to a file.
Make a new module and import them one by one.

-driller
I've isolated the problem to a single area. Module loads with all but this area. Add the area. Test crashes NWN. Remove area. Module loads. Lol. wtf? What could be doing this, driller, you think? I can remake the area, but it'll take 2 hours or so, because it happens to be the main floor of the dungeon...so that's a last resort...
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

Look for placeables causing problems with the walkmesh. Remove or reposition the last few placeables you recently added before it started crashing.

Turn on baked and surface mesh. Enable wireframe mode and look for placeables hidden beneath the ground.

-driller
Dugaru327 wrote:
driller wrote:I hope you are not serious, try this:

This is based on the PM you sent me that said you could load it in the toolset but not play it.

1.Make a new area and put the start in it.
2.Rebake all the areas.
3.Go to file->select->area and export each area to a file.
Make a new module and import them one by one.

-driller
I've isolated the problem to a single area. Module loads with all but this area. Add the area. Test crashes NWN. Remove area. Module loads. Lol. wtf? What could be doing this, driller, you think? I can remake the area, but it'll take 2 hours or so, because it happens to be the main floor of the dungeon...so that's a last resort...
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

driller wrote:Look for placeables causing problems with the walkmesh. Remove or reposition the last few placeables you recently added before it started crashing.

Turn on baked and surface mesh. Enable wireframe mode and look for placeables hidden beneath the ground.

-driller
Wait a second, I'm getting somewhere. Now the module loads but crashes when I enter the area. Give me a few minutes.
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

Aha! It is this script:

Code: Select all

void main()
{
if (GetLocalInt(OBJECT_SELF,"reset")==1)
 {
 SetLocalInt(OBJECT_SELF,"reset",0);
 object oWaypoint=GetFirstObjectInArea(OBJECT_SELF);
 while (GetIsObjectValid(oWaypoint))
  {
  if (GetObjectType(oWaypoint)==OBJECT_TYPE_WAYPOINT)
   {
   if (GetTag(oWaypoint)=="spn_LesserShadow")
    {
    CreateObject(OBJECT_TYPE_CREATURE,"lessershadow",GetLocation(oWaypoint));
    }
   if (GetTag(oWaypoint)=="spn_Shadow")
    {
    CreateObject(OBJECT_TYPE_CREATURE,"shadow",GetLocation(oWaypoint));
    }
   if (GetTag(oWaypoint)=="spn_Heartless")
    {
    CreateObject(OBJECT_TYPE_CREATURE,"heartless",GetLocation(oWaypoint));
    }
   if (GetTag(oWaypoint)=="spn_DeathsShadow")
    {
    CreateObject(OBJECT_TYPE_CREATURE,"deathsshadow",GetLocation(oWaypoint));
    }
   }
  oWaypoint=GetNextObjectInArea(OBJECT_SELF);
  }
 }
}
I'm checking now if it's the monsters that spawn or the script.
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

The monsters are fine, and I don't think there's anything wrong with the script. Could it be the fact that all the waypoints are next to the walls and perhaps one is too close?
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

This is NWN1 btw...i don't know of any walkmesh thingy...I know what it is, but how can i see it...does NWN1 even use it?
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

I thought you where talking about NWN2. Give me a sec and I will check it out in NWN1, it probably has something to with spawning in an invalid location.

-driller
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

The act of spawning your creatures is resetting the GetFirst/Next objects.
It causes your script to count the same objects over and over. But it really should just TMI, not crash.

-driller
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

Here is the fix...

Code: Select all

//adjust if needed
const float DELAY_SPAWN = 0.0f;

//this is to get around the GetFirst/Next problem
void ActionSpawn(string sTag, object oWaypoint)
{
/*
If you keep your spawner waypoint tags standardized 
then you do not have to modify your script 
to add more creatures as the waypoint tag 
will detemine what will spawn
*/
CreateObject(OBJECT_TYPE_CREATURE,GetStringRight(sTag,GetStringLength(sTag)-4),GetLocation(oWaypoint));
}

void main()
{
object oWaypoint;
string sTag;

if (GetLocalInt(OBJECT_SELF,"reset")==1)
 {
 SetLocalInt(OBJECT_SELF,"reset",0);
 oWaypoint=GetFirstObjectInArea(OBJECT_SELF);

 while (GetIsObjectValid(oWaypoint))
   {
   if (GetObjectType(oWaypoint)==OBJECT_TYPE_WAYPOINT)
   {
   sTag = GetTag(oWaypoint);
   if (sTag=="spn_LesserShadow")
    {
    DelayCommand(DELAY_SPAWN,ActionSpawn(sTag,oWaypoint));
    }
   if (sTag=="spn_Shadow")
    {
    DelayCommand(DELAY_SPAWN,ActionSpawn(sTag,oWaypoint));
    }
   if (sTag=="spn_Heartless")
    {
    DelayCommand(DELAY_SPAWN,ActionSpawn(sTag,oWaypoint));
    }
   if (sTag=="spn_DeathsShadow")
    {
    DelayCommand(DELAY_SPAWN,ActionSpawn(sTag,oWaypoint));
    }
   }
  oWaypoint=GetNextObjectInArea(OBJECT_SELF);
  }
 }
}
Thanks,
-driller
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

driller wrote:The act of spawning your creatures is resetting the GetFirst/Next objects.
It causes your script to count the same objects over and over. But it really should just TMI, not crash.

-driller
Well it freezes more than crashing, really. I just called it crashing
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
User avatar
Dugaru327
Baron
Baron
Posts: 96
Joined: Mon Jan 22, 2007 7:23 pm
Location: University of Maryland

Post by Dugaru327 »

lol your code is neater than mine...but both do the same thing...i mean if i add the delay. Yeah I didn't know that it resets it, that's weird. I thought it might count them, but it should just pass over them, right? Nope! >< Except I say

Code: Select all

CreateObject(OBJECT_TYPE_CREATURE,GetStringRight(GetStringLowerCase(sTag),GetStringLength(sTag)-4),GetLocation(oWaypoint));
but maybe I'm being picky. resrefs are lower case ;)
Sincerely,
Father Unen E'lie
Founding elven warrior-stealth monk of the Shining Order Monastery
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

The case is irrelevant. The good thing about doing it my way is that you will never have to edit your code to add new monster resrefs.

You just plop down waypoints properly named and it will spawn the mob based on the tag.

-driller
Dugaru327 wrote:lol your code is neater than mine...but both do the same thing...i mean if i add the delay. Yeah I didn't know that it resets it, that's weird. I thought it might count them, but it should just pass over them, right? Nope! >< Except I say

Code: Select all

CreateObject(OBJECT_TYPE_CREATURE,GetStringRight(GetStringLowerCase(sTag),GetStringLength(sTag)-4),GetLocation(oWaypoint));
but maybe I'm being picky. resrefs are lower case ;)
Locked