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


Author Topic: *TUTORIAL* Adding peds to interiors  (Read 44823 times)

0 Members and 1 Guest are viewing this topic.

Offline MadmaN

  • Bully-Board Admin Team
  • Moderator
  • Newbie
  • *****
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
*TUTORIAL* Adding peds to interiors
« on: September 29, 2011, 06:41:20 PM »
Ok...I know some of you have been wondering how to add peds to interiors...etc and now I will show you how to do it. It is very easy and once my Bully Editor is done it will be even easier. For now this is how to do it:

1. extract every file from trigger.img to a directory of your choosing. You can use any img editor you want for this.

2. open population.dat. Best app to use for this is notepad++ which keeps the scripting intact and allows for easier editing.

3. look in population.dat for the following line: POPULATIONDATA

you will see this line several times in population.dat. Each area with peds has this before the main ped code.

4. You should see somthing that looks about like this:
Code: [Select]
POPULATIONDATA
         BEGIN
            POPULATION_DAY
               BEGIN
                  TOTAL 60
                  PREFECT 5
                  NERD 5
                  JOCK 5
                  DROPOUT 5
                  GREASER 5
                  PREPPY 5
                  STUDENT 5
                  COP 5
                  TEACHER 5
                  TOWNPERSON 5
                  SHOPKEEP 5
                  BULLY 5
               END
            POPULATION_CLASS
               BEGIN
                  TOTAL 60
                  PREFECT 5
                  NERD 5
                  JOCK 5
                  DROPOUT 5
                  GREASER 5
                  PREPPY 5
                  STUDENT 5
                  COP 5
                  TEACHER 5
                  TOWNPERSON 5
                  SHOPKEEP 5
                  BULLY 5
               END
            POPULATION_NIGHT
               BEGIN
                  TOTAL 60
                  PREFECT 5
                  NERD 5
                  JOCK 5
                  DROPOUT 5
                  GREASER 5
                  PREPPY 5
                  STUDENT 5
                  COP 5
                  TEACHER 5
                  TOWNPERSON 5
                  SHOPKEEP 5
                  BULLY 5
               END
            POPULATION_CURFEW
               BEGIN
                  TOTAL 60
                  PREFECT 5
                  NERD 5
                  JOCK 5
                  DROPOUT 5
                  GREASER 5
                  PREPPY 5
                  STUDENT 5
                  COP 5
                  TEACHER 5
                  TOWNPERSON 5
                  SHOPKEEP 5
                  BULLY 5
               END
         END

5. edit the following parts in each interior you want to add peds to:
Code: [Select]
TOTAL 60
                  PREFECT 5
                  NERD 5
                  JOCK 5
                  DROPOUT 5
                  GREASER 5
                  PREPPY 5
                  STUDENT 5
                  COP 5
                  TEACHER 5
                  TOWNPERSON 5
                  SHOPKEEP 5
                  BULLY 5

change each number to the number of peds you want for each cliche to spawn in that interior...make sure you add all the values together and put the result of that for the total which is the first value in the listing. otherwise the game will likely crash.

6. once you have the population.dat file edited however you like either replace the population.dat file in trigger.img or use my img editor and make a new file...name it trigger.img in the same dir as the old one. and Add all the extracted files back in...save and then you are done.


As always. if I have missed anything please let me know in this thread and I will update the tutorial accordingly. :)

*UPDATE*

Here is a list of the trigger names of all the interiors and what they are so you can use this as a reference when changing the population data for each interior.

RichArea = Rich area of town where the preppies generally live.
DownTown = Self Explanatory
PoorArea = This is generally where the dropouts live at
IndustrialArea_DropOutEnclave = This is the dropouts hideout in the industrial area
DT_GASSTATION = This is for the gas stations (all of them)
POOR_TENEMENTS = The tenements near the poor area
Rich_Area_Corner_Courtyard = I think this is around where derby lives.
Industrial_Sawmill = The sawmill in the industrial area
Carnival = The Carnival
Industrial_Docks = The docks in the industrial area
SchoolArea = Inside the school
RichArea_DownTown = This is the rich area of downtown where the preppy type shops are
DT_ComicShop = The Comic books shop
DT_DropOutAlley = The alley that the dropouts hang out in
DT_GreaserAlley = The alley that the greasers hang out in
Rich_GreaserAlley = Same as above but in the rich area of town
Poor_DropTurf1 = The dropout's turf in the poor area of town
GraveYard = The old graveyard
Jocks = Jocks savepoint - thx to Insanitygames
Nerds = Nerds savepoint - thx to  Insanitygames
Preps = preps savepoint - thx to Insanitygames
Greasers = greasers savepoint -  thx to Insanitygames
FieldOverride = This overrides the population settings for the football field
Jocks_FootballField = Football field population settings. Can be overridden by the above setting
School_Basketball_Court = The basketball court/gym
PopRoads1 = Controls the population on the roads
BullyTurf = The bully's turf
BadPlaceTrigger = Not sure what this one is atm.
OutsideSchool1 = Outside the school in the schoolyard
SchoolBikeTrig = This controls how many if any at all bikes spawn around the schoolyard

You can also control vehicle spawning as well. The vehicle spawning is done in the same file (population.dat) and it edited for each area with vehicles as follows:

search for AMBIENTVEHICLEDATA and under it a few lines you will see somthing similar to the following:
Code: [Select]
AMBIENTVEHICLEDATA
         BEGIN
            AMBIENTVEHICLES_DAY
               BEGIN
                  TOTAL 30
                  CAR 10
                  BIKE 20
                  POLICECAR 0
               END
            AMBIENTVEHICLES_CLASS
               BEGIN
                  TOTAL 30
                  CAR 10
                  BIKE 20
                  POLICECAR 0
               END
            AMBIENTVEHICLES_NIGHT
               BEGIN
                  TOTAL 30
                  CAR 10
                  BIKE 20
                  POLICECAR 0
               END
            AMBIENTVEHICLES_CURFEW
               BEGIN
                  TOTAL 30
                  CAR 10
                  BIKE 20
                  POLICECAR 0
               END
         END

Simply edit this part like you did for the ped population by putting how many for each vehicle type you want and add all of them together and put that value where total is.

NOTE: Do not add too many vehicles or peds to a area or it will lag your game bad. If you have a very high end system then you should be ok but I wouldnt use more then what I have already used in my code examples.

Feel free to experiment with this and come up with your own ped spawn variations.
« Last Edit: September 30, 2011, 12:44:37 PM by |XF|-MadmaN[AR] »

Offline Carlosvc92

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #1 on: September 29, 2011, 10:57:02 PM »
Question, how do you add them to interiors not listed in pedpop.dat? Like the Greaser HO just like governmentman123 did??

Offline MadmaN

  • Bully-Board Admin Team
  • Moderator
  • Newbie
  • *****
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #2 on: September 29, 2011, 11:05:17 PM »
Add them how I described in my tutorial above. Everything controlling the peds spawning in interiors is in your population.dat file located in trigger.img.

If you need help with editing that file, or if my tutorial is a little hard to follow, I can explain to you on xfire what to do. I have not tested every single interior but every interior I have tested so far by editing population.dat seems to work. This is most likely how governmentman123 did this unless he edited the files using a hex editor.

Insanitygames is working with me on this as well.

Offline Carlosvc92

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #3 on: September 29, 2011, 11:39:26 PM »
Add them how I described in my tutorial above. Everything controlling the peds spawning in interiors is in your population.dat file located in trigger.img.

If you need help with editing that file, or if my tutorial is a little hard to follow, I can explain to you on xfire what to do. I have not tested every single interior but every interior I have tested so far by editing population.dat seems to work. This is most likely how governmentman123 did this unless he edited the files using a hex editor.

Insanitygames is working with me on this as well.

But how do I know the name of the interiors? Is it just Preps, Jocks, Greasers??

Offline MadmaN

  • Bully-Board Admin Team
  • Moderator
  • Newbie
  • *****
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #4 on: September 30, 2011, 12:08:55 AM »
At the bottom of my tutorial I posted a list of the interiors that have the ability to spawn peds. This is the list of the names of each interior as used in population.dat
Quote
*UPDATE*

Here is a list of the trigger names of all the interiors and what they are so you can use this as a reference when changing the population data for each interior.

RichArea = Rich area of town where the preppies generally live.
DownTown = Self Explanatory
PoorArea = This is generally where the dropouts live at
IndustrialArea_DropOutEnclave = This is the dropouts hideout in the industrial area
DT_GASSTATION = This is for the gas stations (all of them)
POOR_TENEMENTS = The tenements near the poor area
Rich_Area_Corner_Courtyard = I think this is around where derby lives.
Industrial_Sawmill = The sawmill in the industrial area
Carnival = The Carnival
Industrial_Docks = The docks in the industrial area
SchoolArea = Inside the school
RichArea_DownTown = This is the rich area of downtown where the preppy type shops are
DT_ComicShop = The Comic books shop
DT_DropOutAlley = The alley that the dropouts hang out in
DT_GreaserAlley = The alley that the greasers hang out in
Rich_GreaserAlley = Same as above but in the rich area of town
Poor_DropTurf1 = The dropout's turf in the poor area of town
GraveYard = The old graveyard
Jocks = not sure
Nerds = not sure
Preps = not sure
Greasers = not sure
FieldOverride = This overrides the population settings for the football field
Jocks_FootballField = Football field population settings. Can be overridden by the above setting
School_Basketball_Court = The basketball court/gym
PopRoads1 = Controls the population on the roads
BullyTurf = The bully's turf
BadPlaceTrigger = Not sure what this one is atm.
OutsideSchool1 = Outside the school in the schoolyard
SchoolBikeTrig = This controls how many if any at all bikes spawn around the schoolyard

I hope this helps somewhat  8)

Offline InsanityGames

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #5 on: September 30, 2011, 07:32:35 AM »
Jocks = Jock save point,Prep = Beach house,Greaser= Blueballs,Nerds= comic shop, or the hq i think this is right but i am not sure :)

Offline MadmaN

  • Bully-Board Admin Team
  • Moderator
  • Newbie
  • *****
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #6 on: September 30, 2011, 12:45:34 PM »
@InsanityGames

Thx for the info for those. Updated the tut with that.

Offline Red Blaster

  • The BB Arab
  • More Than Halfway There
  • *****
  • Posts: 5,649
  • Gender: Male
  • Hi
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #7 on: October 03, 2011, 04:09:48 AM »
But how are the blue collar workers spawned in the factory within New Coventry and all over Blue Skies?

It's strange, because in the ide, just about all of them are under the TOWNPERSON faction, with the only exception being Chuck, who's listed as a SHOPKEEP. Not to mention, all of them are set not to spawn in the ide. If I do spawn them, the TOWNPERSON peds walk with all the other rich folks, whereas Chuck, who's listed as SHOPKEEP, hangs out in New Coventry.

If this is what controls their spawning everywhere, then the rich townsfolk and New Coventry townsfolk should spawn alongside the Blue Skies people...but they don't.

Something is missing here.

Offline MadmaN

  • Bully-Board Admin Team
  • Moderator
  • Newbie
  • *****
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #8 on: October 03, 2011, 03:23:14 PM »
Well...some peds may be hardcoded to only spawn certain places and may bypass the normal game scripting (the so far editable part) totally.


Offline Red Blaster

  • The BB Arab
  • More Than Halfway There
  • *****
  • Posts: 5,649
  • Gender: Male
  • Hi
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #9 on: October 03, 2011, 06:15:06 PM »
Where do you think this hard coding would be located?

Would be really awesome if we can do custom spawn points.

Offline MadmaN

  • Bully-Board Admin Team
  • Moderator
  • Newbie
  • *****
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #10 on: October 03, 2011, 07:51:28 PM »
some of the hardcoding is located in bully.exe which I can share the .asm source file of from what I managed to decompile but since it is in assembly language and not the full source...atm I cannot compile that...but if someone wants to take a look at it to see if they can spot somthing that I have not just ask and I will post a link to it on my server. I will warn everyone or anyone that wants to take a look that you will need somthing that can load and edit a 505mb text file such as vim for windows which you can find on google quite easily or you can load it using visual studio which I have and compile if its the entire source. The other place the ped spawn points is coded is in the .lur scripts which are compiled luap scripting. Luap is basicly compiled lua with a few things changed in it for use in game scripting where luac is generic compiled lua...if ntauthority is listening or reading any of my threads...I really would like to have some help from him or maybe team up with him since he is the only one that managed to make some headway with decompiling lua into some usable form. I do know hes a busy guy and all that but some help at this point with the lua portion of bully would greatly be appreciated since us modders working together is the only way we can move forward with figuring this game out. anyone just showing mods off but refusing to share or explain how they were done will just be the downfall of this great little community which would be a darn shame.

deadpoolXYZ

  • Guest
Re: *TUTORIAL* Adding peds to interiors
« Reply #11 on: October 06, 2011, 04:53:05 PM »
The savepoint locations where peds spawn are inside or outside of them?
Because I checked the population dat and it says that there should spawn 15 peds of that clique but you can't see anyone inside.

Offline MadmaN

  • Bully-Board Admin Team
  • Moderator
  • Newbie
  • *****
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #12 on: October 06, 2011, 06:00:25 PM »
Some are inside and some are outside. I havent had time to make a list of which is inside and which is outside just yet since I have been busy helping steman with the vehicle spawner. I will compile a list of whats inside and whats outside....also population.dat doesnt control every area the peds spawn..since some of the interior spawn points for peds are in different files...which I will post a proper list of what file goes to what area or what part of what file goes to which area....gimme a day or two and I will get somthing posted...I will just update my original post rather then make a new one...saves ppl time looking for things.

deadpoolXYZ

  • Guest
Re: *TUTORIAL* Adding peds to interiors
« Reply #13 on: October 06, 2011, 06:23:29 PM »
Take your time you are already doing a good job ;)

Offline MadmaN

  • Bully-Board Admin Team
  • Moderator
  • Newbie
  • *****
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: *TUTORIAL* Adding peds to interiors
« Reply #14 on: October 06, 2011, 07:07:32 PM »
Thx for the support ...it means a lot :biggrin: