Replies: 1 (Who?), Viewed: 1846 times.
Test Subject
Original Poster
#1 Old 2nd Jun 2020 at 6:35 PM
Attaching an already existing NPC to an object?
Hi! So this is my very first post and probably too ambitious, but given the modded objects I've seen, it sounds possible. So basically what I want to create is an object that looks identical to the career reward podiums, which spawns a sims 2 university professor (the way shinytyme spawns a cook and cash registers spawn cashiers). I want it to spawn already existing professors, and make them just keep talking on the podium autonomously. Basically I wanna use it on community lots to create fake lecture halls (I have ideas to make it more real, like idk being able to listen in and have your study meter go up but that's too ambitious).

So for now, how do you make an existing NPC spawn with an object? I imagine SimPE is involved, and I saw one post talking about it being possible but they never mentioned how.
Advertisement
Inventor
#2 Old 7th Jun 2020 at 7:25 AM
Quote:
Originally Posted by Mercaptan
Hi! So this is my very first post and probably too ambitious, ...

If you only "imagine SimPE is involved" then it probably is a bit ambitious, SimPE is definitely required.

Global op-code 0x0314 'NPC - Create OOW - Only if Available' is all that's needed to ensure it'll only use an existing NPC, not generate a new one. Probably the reason "they never mentioned how" is because it is too obvious.

A&N does have an item that is almost exactly what you want, in A&N it'll spawn a preacher to give a sermon at a place of worship. It was a very simple process to extract it, change the GUID and change it to use a professor at community lots instead. You will need to change and tweak a couple of bits.
LecturerPodium.zip (574.8 kB)

If the lot is a community lot then this will spawn a professor immediately, that is a function of the 'Function - Main' op-code, the 'Function - Load' notifies the main out of idle to unsure it runs immediately each time the lot loads.
When the professor is spawned the podium id is placed into the professor's attribute 0x0016. When a sim first runs if there is an item in that attribute the sim will run op-code ‘CT - Alternate Visitor Controller’ by name if it exists on the item, so in this item that is the op-code the professor is running all of the time.
The professor is spawned as a normal sociable sim, other sims will be able to interact with her/him whenever she/he is not lecturing. That does mean the professor can be sent off the lot, to change that you’d need to make the professor spawn as an on the job service sim. The 'Function - Main' will confirm the professor is still around every hour and bring her/him back if she/he leaves, you may want to shorten that time.
The professor will start the first lecture after one hour, the lecture runs for two hours and the professor will take a two hour break between lectures, that timing is in ‘CT - Alternate Visitor Controller’, you may want to change the timing or even remove the timing and just have the lecture run continuously.
All other visitors are pushed to listen to the lecture and YAs will get a Grade gain of 50 at the beginning and again at the end of listening, the grade gain is in the op-code ‘Sub - Boost Grade’ and will probably need tweaking.

If you change the GUID (you don’t need to as this is an unused, registered on the SimPE database GUID) then you must also change line 8 on CT - Alternate Visitor Controller.
If you wish to use a different mesh then just change the CRES name in the text list called ‘Model – Name’.
Feel free to use, alter, re-texture and generally make this your own in any way you like.
Back to top