News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse  (Read 3061 times)

0 Members and 5 Guests are viewing this topic.

Offline ConTresillo

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
I've always liked the fact that Jimmy isn't alone in the safehouse of the nerds also is it possible to add preps to Harrington and lighthouse safehouse, jocks inside the jock clubhouse since Jimmy didn't fight them like he did with the greasers and townies, Please help I tried editing pedpop and population for 4 hours still no luck.  :(
« Last Edit: March 01, 2022, 10:09:28 AM by ConTresillo »

Offline RBS ID

  • Jr. Member
  • **
  • Posts: 67
  • Gender: Male
  • I don't know.
    • View Profile
    • This is website title.
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #1 on: March 01, 2022, 09:50:46 AM »
You can use mod to spawn peds & props, or just script modding.

Offline ConTresillo

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #2 on: March 01, 2022, 10:20:01 AM »
You can use mod to spawn peds & props, or just script modding.

Oops preps was autocorrected as props, it was preps bro and why don't pedpop work? also there's a video on adding preps but there was no description to the mod. I want preps to spawn automatically without using ped spawners but normally just like the nerds. Is there a code or something to add a specific clique to spawn in interiors

Offline Altamurenza

  • Full Member
  • ***
  • Posts: 118
  • Gender: Male
  • I love cheat, unique, realistic, & expansion mod.
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #3 on: March 01, 2022, 11:41:24 PM »
You can use mod to spawn peds & props, or just script modding.

Oops preps was autocorrected as props, it was preps bro and why don't pedpop work? also there's a video on adding preps but there was no description to the mod. I want preps to spawn automatically without using ped spawners but normally just like the nerds. Is there a code or something to add a specific clique to spawn in interiors

It's because Nerd's Hideout actually registered as Store rather than SaveZone like others HQ did.
In Dragon's Wing Comics Store, the script is spawning people through "Ped Production" function whereas the SaveZone does not have it.

I believe PedPop.dat won't help in this case, it requires scripting in order to spawn NPCs naturally.
That was some kind of hypothesis came to the top of my mind when i looked at the source code.

Correct me if i'm wrong.


Offline ConTresillo

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #4 on: March 02, 2022, 07:29:55 AM »
You can use mod to spawn peds & props, or just script modding.

Oops preps was autocorrected as props, it was preps bro and why don't pedpop work? also there's a video on adding preps but there was no description to the mod. I want preps to spawn automatically without using ped spawners but normally just like the nerds. Is there a code or something to add a specific clique to spawn in interiors

It's because Nerd's Hideout actually registered as Store rather than SaveZone like others HQ did.
In Dragon's Wing Comics Store, the script is spawning people through "Ped Production" function whereas the SaveZone does not have it.

I believe PedPop.dat won't help in this case, it requires scripting in order to spawn NPCs naturally.
That was some kind of hypothesis came to the top of my mind when i looked at the source code.

Correct me if i'm wrong.

Thank you friend so how should i script the prep spawn? another doubt why don't harrington house spawn any npc i mean itsn't some save zone right

Offline Altamurenza

  • Full Member
  • ***
  • Posts: 118
  • Gender: Male
  • I love cheat, unique, realistic, & expansion mod.
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #5 on: March 03, 2022, 06:02:37 AM »
Thank you friend so how should i script the prep spawn?

It is a simple question that cannot be simply answered lol.
It depends on your Lua scripting knowledge.

If you haven't been introduced yet (to Lua scripting ofc), you should read some tutorials here on Bully-Board.

another doubt why don't harrington house spawn any npc i mean itsn't some save zone right

There are two answers on this particular question, you can decide which answer you'll likely to understand lol.


- SIMPLE ANSWER -
Simply because R* did not make it in the first place.
Some other areas did not have population either, so it wasn't only our HQ or this Harrington House.


- DETAILED ANSWER -
NPCs that spawn naturally are combination of Lua script + .DAT files (you can find that in Trigger.img). There is a population setting named 'populationdata' (indicated by 'haspopulationdata 1') within the .DAT file if the area meant to be inhabited regularly. Then, the 'populationdata' will be called in Lua script in order to control the population within a space world.

Sadly, most factions HQ (iSaveZones.DAT, SaveLocs.DAT, SP_iDropS.DAT, SP_iJockS.DAT, SP_iPrepS.DAT, and SP_iGrsrS.DAT) and Harrington House (PAn_Prep.DAT and SP_Prep_House.DAT) did not have 'populationdata'. Which means they are not supposed to have daily activities on that area.

Instead, the Dragon's Wing Comic store that we were talking about have 'populationdata' in Store.DAT which called ComicPopTrig. The ComicPopTrig is later found to be active in SStores.lua once you completed Nerd Challenge. That's why we can see some NPCs spawning there, it's still a store after all.

That may looks a little bit complex, but there are more beyond that.
And people still figuring more advanced way in area modding.
« Last Edit: March 03, 2022, 06:15:13 AM by Altamurenza »

Offline ConTresillo

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #6 on: March 04, 2022, 04:31:17 AM »
Thank you friend so how should i script the prep spawn?

It is a simple question that cannot be simply answered lol.
It depends on your Lua scripting knowledge.

If you haven't been introduced yet (to Lua scripting ofc), you should read some tutorials here on Bully-Board.

another doubt why don't harrington house spawn any npc i mean itsn't some save zone right

There are two answers on this particular question, you can decide which answer you'll likely to understand lol.


- SIMPLE ANSWER -
Simply because R* did not make it in the first place.
Some other areas did not have population either, so it wasn't only our HQ or this Harrington House.


- DETAILED ANSWER -
NPCs that spawn naturally are combination of Lua script + .DAT files (you can find that in Trigger.img). There is a population setting named 'populationdata' (indicated by 'haspopulationdata 1') within the .DAT file if the area meant to be inhabited regularly. Then, the 'populationdata' will be called in Lua script in order to control the population within a space world.

Sadly, most factions HQ (iSaveZones.DAT, SaveLocs.DAT, SP_iDropS.DAT, SP_iJockS.DAT, SP_iPrepS.DAT, and SP_iGrsrS.DAT) and Harrington House (PAn_Prep.DAT and SP_Prep_House.DAT) did not have 'populationdata'. Which means they are not supposed to have daily activities on that area.

Instead, the Dragon's Wing Comic store that we were talking about have 'populationdata' in Store.DAT which called ComicPopTrig. The ComicPopTrig is later found to be active in SStores.lua once you completed Nerd Challenge. That's why we can see some NPCs spawning there, it's still a store after all.

That may looks a little bit complex, but there are more beyond that.
And people still figuring more advanced way in area modding.

Wow thank you friend for answering so I know a little python but no lua coding, can I manually edit those .DAT files to have population spawning??

Offline ConTresillo

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #7 on: March 04, 2022, 05:29:54 AM »
Thank you friend so how should i script the prep spawn?

It is a simple question that cannot be simply answered lol.
It depends on your Lua scripting knowledge.

If you haven't been introduced yet (to Lua scripting ofc), you should read some tutorials here on Bully-Board.

another doubt why don't harrington house spawn any npc i mean itsn't some save zone right

There are two answers on this particular question, you can decide which answer you'll likely to understand lol.


- SIMPLE ANSWER -
Simply because R* did not make it in the first place.
Some other areas did not have population either, so it wasn't only our HQ or this Harrington House.


- DETAILED ANSWER -
NPCs that spawn naturally are combination of Lua script + .DAT files (you can find that in Trigger.img). There is a population setting named 'populationdata' (indicated by 'haspopulationdata 1') within the .DAT file if the area meant to be inhabited regularly. Then, the 'populationdata' will be called in Lua script in order to control the population within a space world.

Sadly, most factions HQ (iSaveZones.DAT, SaveLocs.DAT, SP_iDropS.DAT, SP_iJockS.DAT, SP_iPrepS.DAT, and SP_iGrsrS.DAT) and Harrington House (PAn_Prep.DAT and SP_Prep_House.DAT) did not have 'populationdata'. Which means they are not supposed to have daily activities on that area.

Instead, the Dragon's Wing Comic store that we were talking about have 'populationdata' in Store.DAT which called ComicPopTrig. The ComicPopTrig is later found to be active in SStores.lua once you completed Nerd Challenge. That's why we can see some NPCs spawning there, it's still a store after all.

That may looks a little bit complex, but there are more beyond that.
And people still figuring more advanced way in area modding.

Wow thank you friend for answering so I know a little python but no lua coding, can I manually edit those .DAT files to have population spawning??

Update:

Ok so i have copied the population code an pasted it in sp_prep_house but still it doesn't work

NTRIGGERS 1
TRIGGER
   BEGIN
      TRIGGERNAME "PrepHouse_MainRoom"
      AREACODE 32
      POSITION -540.947998, 132.498001, 46.199902
      YAWPITCHROLL 0.000000, 0.000000, 0.000000
      YAW 0.000000
      ZHEIGHT 1.000000
      ISMISSIONSPECIFIC FALSE
      ISLOCKED FALSE
      AMBIENT 0, 0, 0
      USETIMECYCLE FALSE
      HASPOPULATIONDATA 1
      FORCEPOPREAD FALSE
      POPULATIONDATA
         BEGIN
            POPULATION_DAY
               BEGIN
                  TOTAL 5
                  PREFECT 0
                  NERD 0
                  JOCK 0
                  DROPOUT 0
                  GREASER 0
                  PREPPY 5
                  STUDENT 0
                  COP 0
                  TEACHER 0
                  TOWNPERSON 0
                  SHOPKEEP 0
                  BULLY 0
               END
            POPULATION_CLASS
               BEGIN
                  TOTAL 5
                  PREFECT 0
                  NERD 0
                  JOCK 0
                  DROPOUT 0
                  GREASER 0
                  PREPPY 5
                  STUDENT 0
                  COP 0
                  TEACHER 0
                  TOWNPERSON 0
                  SHOPKEEP 0
                  BULLY 0
               END
            POPULATION_NIGHT
               BEGIN
                  TOTAL 5
                  PREFECT 0
                  NERD 0
                  JOCK 0
                  DROPOUT 0
                  GREASER 0
                  PREPPY 5
                  STUDENT 0
                  COP 0
                  TEACHER 0
                  TOWNPERSON 0
                  SHOPKEEP 0
                  BULLY 0
               END
            POPULATION_CURFEW
               BEGIN
                  TOTAL 5
                  PREFECT 0
                  NERD 0
                  JOCK 0
                  DROPOUT 0
                  GREASER 0
                  PREPPY 5
                  STUDENT 0
                  COP 0
                  TEACHER 0
                  TOWNPERSON 0
                  SHOPKEEP 0
                  BULLY 0
               END
         END
      HASAMBIENTVEHICLEDATA 0
      FORCEVEHREAD FALSE
   END




Offline RBS ID

  • Jr. Member
  • **
  • Posts: 67
  • Gender: Male
  • I don't know.
    • View Profile
    • This is website title.
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #8 on: March 04, 2022, 06:09:43 AM »
It's because R* didn't add the control spawn of npcs in some area & script.

Like Altamurenza said, the NPCs will spawn automatically because the combination of Lua script & the .dat files. The Lua script control the spawn of npcs. The .dat files is just a source of the cordinates, and other data, then the value will be called it in the Lua script to control the npcs to spawn or to control other things.

cmiiw

Offline ConTresillo

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #9 on: March 05, 2022, 01:48:31 AM »
It's because R* didn't add the control spawn of npcs in some area & script.

Like Altamurenza said, the NPCs will spawn automatically because the combination of Lua script & the .dat files. The Lua script control the spawn of npcs. The .dat files is just a source of the cordinates, and other data, then the value will be called it in the Lua script to control the npcs to spawn or to control other things.

cmiiw

Ok friend but can we add ??

Offline Altamurenza

  • Full Member
  • ***
  • Posts: 118
  • Gender: Male
  • I love cheat, unique, realistic, & expansion mod.
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #10 on: March 05, 2022, 05:28:58 AM »
the NPCs will spawn automatically because the combination of Lua script & the .dat files. The Lua script control the spawn of npcs. The .dat files is just a source of the cordinates, and other data, then the value will be called it in the Lua script to control the npcs to spawn or to control other things.

Yep, that's how the game works.

Update:

I also did the same thing before, but in faction HQ (modified SaveZones.lua + modified SP_iJockS.DAT).
But still, no luck. I'm not an expert in those kind of things :biggrin:.

So i decided to spawn people there by hooking my code into PrepHouse.lur, i used the npc spawn points on 2_08.DAT (Weed Killer) and managed to populate the house with 6 npcs. After all it still looks better than empty. Moreover, there are only 9 people on prep factions, so 6 people are kinda realistic imo.

Here you go: https://www.mediafire.com/file/g99ahef4kuwcd1f/Harrington_House_-_Population_Script.7z/file

Offline ConTresillo

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #11 on: March 05, 2022, 12:07:21 PM »
the NPCs will spawn automatically because the combination of Lua script & the .dat files. The Lua script control the spawn of npcs. The .dat files is just a source of the cordinates, and other data, then the value will be called it in the Lua script to control the npcs to spawn or to control other things.

Yep, that's how the game works.

Update:


I also did the same thing before, but in faction HQ (modified SaveZones.lua + modified SP_iJockS.DAT).
But still, no luck. I'm not an expert in those kind of things :biggrin:.

So i decided to spawn people there by hooking my code into PrepHouse.lur, i used the npc spawn points on 2_08.DAT (Weed Killer) and managed to populate the house with 6 npcs. After all it still looks better than empty. Moreover, there are only 9 people on prep factions, so 6 people are kinda realistic imo.

Here you go: https://www.mediafire.com/file/g99ahef4kuwcd1f/Harrington_House_-_Population_Script.7z/file

Wow dude it really works Thanks A Ton :) :) :biggrin:, also can u explain whats hooking by the way  :laugh:

Offline Altamurenza

  • Full Member
  • ***
  • Posts: 118
  • Gender: Male
  • I love cheat, unique, realistic, & expansion mod.
    • View Profile
Re: Need Help in Adding Npcs Inside Safehouse Like Nerd Safehouse
« Reply #12 on: March 07, 2022, 05:57:17 AM »
also can u explain whats hooking by the way  :laugh:

Well.. I'll take the chance from my understanding.

As far as i know, 'hook' is a method used in programming to redirect or add some new lines of script into an existing function. Usually, we injected our script before or after the function is being executed. The purpose of this action is pretty much obvious, whether you add a few things, change some of them, or completely overhaul the function itself.

My top two reasons of function hooking are:
1) I don't have the source code, so 'hook' is only my chance to have an access in that script.
2) I do have the source code, but i am just lazy to tidy up the script. For that reason, i prefer to modify the function in my current script that would be called in my destination script. So, i save a lot of my time and energy with the same final results lol.
« Last Edit: March 07, 2022, 06:04:16 AM by Altamurenza »