Author Topic: Jump NPC to random area. Is it possible?  (Read 991 times)

Legacy_Cursed Eclipse

  • Full Member
  • ***
  • Posts: 132
  • Karma: +0/-0
Jump NPC to random area. Is it possible?
« Reply #15 on: March 15, 2016, 07:28:18 pm »


               

about waypoint...you are right but im looking to keep the module the lightest that i can.


I know that WP it is very light object,
but that's how I work, avoiding the superfluous as much as possible,
and trying to recycle what is already there.


 


Would be approximately 230 WP to to be placed.One for each area.


 


However I'm still undecided on what to do;


there is still the problem of avoiding the NO_PVP areas,like shops and city.



               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Jump NPC to random area. Is it possible?
« Reply #16 on: March 15, 2016, 07:51:49 pm »


               

By not placing a waypoint in an area, there is no chance of spawning the "Bounty Boss" in that area. I agree with Meaglyn - 20 waypoints is more than enough for a random chance. When you take into account other factors- "believable action" for instance, would the Boss, go to that area to hide? Is the area that spawns this Boss, hard enough to get to- to make searching for it there realistic? I doubt you want the boss to spawn in the main room of the local inn- that would be a rather short quest, with at least a shorter trek back to turn in the head- or whatever is used to identify the boss has been killed. I guess it depends on what you are after, I have learned over the years that random in NWN isn't really random- I seem to roll a lot more 1's than 20's. I would say start with 20 existing waypoints in your mod to use for this and test it. See if it is something you want to go full out 230 options, or if 20 will do.



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Jump NPC to random area. Is it possible?
« Reply #17 on: March 15, 2016, 07:55:55 pm »


               

I'm not telling you how to do it. I just said that's how I'd do it. I'd be done with the feature by now '<img'>


 


Whether its superfluous or not ... dunno that I'd call it that if it implements a feature you want. 



               
               

               
            

Legacy_Cursed Eclipse

  • Full Member
  • ***
  • Posts: 132
  • Karma: +0/-0
Jump NPC to random area. Is it possible?
« Reply #18 on: March 16, 2016, 06:51:59 am »


               

Incredible,work! O_O"


 


And it worked on the first try! '<img'>


 


 


 


 


Here is the place where I found the boss:


http://imgur.com/iy3OXgE


 


 


Which is far from his usual residence.


 


 


I  do not have placed any wp.




In order to avoid unwanted areas i have enriched my script (fix'd by Thayan) with some additional line:



while(GetIsObjectValid(Area)==TRUE)//while (oArea != OBJECT_INVALID)
                {
//these lines below prevent areas ,on which was set a local variable, to be counted.
                 if(!GetLocalInt(Area, "autorespawn") || (!GetLocalInt(Area, "ARENA"))
                 {
////////////////////////////end of the addition/////////////////////////////////////////////////
                 SetLocalObject(oMod,"Area_"+IntToString(i),Area);
                 i++;
                 }
                 Area = GetNextArea();
                }
               SetLocalInt(oMod,"MAX_AREAS",i);
               }


add this code to the bounty system made by Blasco-Yang, and the job is done.

 




 


Thank Thayan, for correction to my script.
And thanks to everyone for the advice...and the patience.



               
               

               
            

Legacy_dunahan_schwerterkueste_de

  • Jr. Member
  • **
  • Posts: 66
  • Karma: +0/-0
Jump NPC to random area. Is it possible?
« Reply #19 on: March 16, 2016, 06:53:17 pm »


               

Im im pretty sure that this function isn't present on linux version of nwnx_funcs.

And so this option it is not available for me.



I think I have the source code for the dll from Terra's codings... If I find them, I'll link them.


 


Here is the source code as 7zip-file: http://s000.tinyuplo...630667587878600


I had some code too, for placing placeables randomly in a area, without any waypoint. It even sets the right height and looks, if the new position is valid. I use it for a random builded dungeon, with some prebuilded areas, whitch are randomly connected. I have not finished this properly, due some other things on my PW.