Announcements: Please turn off your adblock for Bullymods.net! Advertisements help us pay for the site, which allows you to use it--
*Also make sure to Introduce yourself, in the below section! Say Hi, and tell us who you are!* ~quinn

Specific NPCs In Boy's Dorm

User avatar
DreadedGhoul575
Getting Somewhere
Getting Somewhere
Posts: 57
Joined: Sat Aug 12, 2017 10:54 pm

Specific NPCs In Boy's Dorm

Postby DreadedGhoul575 » Tue Nov 28, 2017 10:41 pm

Anyone know how to spawn Sheldon in the boy's dorm? Since, I assume something on the line of code tells him not too (like townie Zoe).

I don't mean with mods, I mean with the objects folder and editing there.

Help is appreciated.

User avatar
quinnsane
Administrator
Administrator
Posts: 559
Joined: Wed Aug 09, 2017 4:36 pm
Contact:

Re: Specific NPCs In Boy's Dorm

Postby quinnsane » Wed Nov 29, 2017 12:43 am

I mean, BDorm.lua is the LUA file that prevents other factions from spawning inside the Boys dorm. The only way around that would be to modify that file, and put it back into scripts.img.

User avatar
DreadedGhoul575
Getting Somewhere
Getting Somewhere
Posts: 57
Joined: Sat Aug 12, 2017 10:54 pm

Re: Specific NPCs In Boy's Dorm

Postby DreadedGhoul575 » Wed Nov 29, 2017 1:36 am

Ah ok, and how would I edit it, with notepad++?

User avatar
quinnsane
Administrator
Administrator
Posts: 559
Joined: Wed Aug 09, 2017 4:36 pm
Contact:

Re: Specific NPCs In Boy's Dorm

Postby quinnsane » Thu Nov 30, 2017 9:25 pm

Yes. You'd edit it, if you know basic LUA, and then recompile it to a .lur file.

User avatar
DreadedGhoul575
Getting Somewhere
Getting Somewhere
Posts: 57
Joined: Sat Aug 12, 2017 10:54 pm

Re: Specific NPCs In Boy's Dorm

Postby DreadedGhoul575 » Thu Nov 30, 2017 10:28 pm

Ok, what parts would I need to edit? I looked in the code for Sheldon and restrictions and nothing. Would appreciate the help.

User avatar
derpy54320
New Kid
New Kid
Posts: 44
Joined: Tue Aug 15, 2017 7:14 am
Contact:

Re: Specific NPCs In Boy's Dorm

Postby derpy54320 » Fri Dec 01, 2017 2:30 pm

/Config/dat/PedPop.dat is actually what determines which factions spawn in each interior. This is the case for most default areas, however missions can override this, as can any script.

BDorm.lur as pointed out by Quinn is the area script for the boy's dorm (duh), and actually disables specific ped models using PedSetUniqueModelStatus. A ped's unique model status is if it can spawn, and if so if it can spawn multiple times. It is the -1, 1, or 2 found in default.ide (and therefor ide.img when you make freeroam peds spawn).

So it first loads PedPop.dat and that says generic students (such as Sheldon) should spawn, but the boy's dorm script says that Sheldon specifically should not spawn (as well as all the other little kids), and then says they should spawn again when you exit. The cleanest way to do this would be to modify the script itself, since then it sticks to the script that is actually responsible. However an easier way would be to make an STimeCycle.lur script (since this script is a lot easier to mod) and make it repeatedly set Sheldon's unique model status to true when you're in the dorm.
Attachments
sheldon.zip
(1.33 MiB) Downloaded 40 times
sheldon.zip
(1.33 MiB) Downloaded 40 times

User avatar
DreadedGhoul575
Getting Somewhere
Getting Somewhere
Posts: 57
Joined: Sat Aug 12, 2017 10:54 pm

Re: Specific NPCs In Boy's Dorm

Postby DreadedGhoul575 » Fri Dec 01, 2017 4:17 pm

I'm guessing that allows Sheldon to spawn in the boy's dorm. Hope this doesn't annoy you, but are there any other characters restricted? (Like Pedro). Also, feel free to guide me on what to edit, if it's troubling you (just in case, you're busy).

Edit: The file you posted, is causing me lag in-game by the way, with 60 fps bully.

User avatar
derpy54320
New Kid
New Kid
Posts: 44
Joined: Tue Aug 15, 2017 7:14 am
Contact:

Re: Specific NPCs In Boy's Dorm

Postby derpy54320 » Mon Dec 04, 2017 6:04 pm

Yes, the boy's dorm script also disables all other little kids by setting their unique model status to -1. If you want to bring them back, you can make the source.lua provided also set the unique model status of the other kids to 1 repeatedly, forcing them to always spawn. Again, it'd be better to just do it once in a modified boy's dorm script, but this is a lot easier for a simple patch in my opinion. Just take the source.lua I provided and add whatever lines you want, recompile to STimeCycle.lur using luac and put it back in Scripts.img using some img tool. I'll give you some tools and a little tutorial so you can try it yourself. <3

Image
Attachments
tools.zip
(101.27 KiB) Downloaded 42 times
tools.zip
(101.27 KiB) Downloaded 42 times

User avatar
DreadedGhoul575
Getting Somewhere
Getting Somewhere
Posts: 57
Joined: Sat Aug 12, 2017 10:54 pm

Re: Specific NPCs In Boy's Dorm

Postby DreadedGhoul575 » Mon Feb 26, 2018 3:46 pm

derpy54320 wrote:
Mon Dec 04, 2017 6:04 pm
Yes, the boy's dorm script also disables all other little kids by setting their unique model status to -1. If you want to bring them back, you can make the source.lua provided also set the unique model status of the other kids to 1 repeatedly, forcing them to always spawn. Again, it'd be better to just do it once in a modified boy's dorm script, but this is a lot easier for a simple patch in my opinion. Just take the source.lua I provided and add whatever lines you want, recompile to STimeCycle.lur using luac and put it back in Scripts.img using some img tool. I'll give you some tools and a little tutorial so you can try it yourself. <3

Image
I extracted the bdorm.lur and tried to edit it with notepad++ and nothing about pedstatus. Any help? Since, I'd like to enable all the models (I've noticed that Mr. Huntingdon never spawns for me with the 'females as males' mod (was uploaded by AuraShadow, but he longer has it in uploads for me for some reason).

User avatar
derpy54320
New Kid
New Kid
Posts: 44
Joined: Tue Aug 15, 2017 7:14 am
Contact:

Re: Specific NPCs In Boy's Dorm

Postby derpy54320 » Mon Mar 05, 2018 4:33 pm

That is because bdorm.lur is a compiled lua script, it is not meant to be easily modified and put back in. Actually modifying it would require you decompile the script to get the source lua script again, then fix it because the decompiler won't do it perfectly, then compile it again and put it back in the game. Simpler than this though due to decompilers not being great, would be to use STimeCycle.lur instead. It is an extremely simple file compared to bdorm.lur, plus I've already provided you with a version of it you can use in my attachment to my post. This script runs as soon as the game starts, so it will work well to call the unique model status functions and set certain models to spawn.

Ped spawning is based on faction (pedpop.dat controls where factions spawn by default, though scripts can override it), based on sex (I'm not sure where this is configured, it might just be built into the game and not a config file), and also on the unique model status (which is set in default.ide from the ide.img archive, but can also be done with scripting, as we've been talking about).

Try rereading my post, the attached image, and looking at the attached files. I guide you how to make a new script and replace STimeCycle.lur with it, not having to change bdorm.lur at all.


Who is online

Users browsing this forum: No registered users and 0 guests