Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Virtual gardener
staff: administrator
Original Poster
#1 Old 3rd Jun 2017 at 3:58 PM Last edited by Greenplumbbob : 3rd Jun 2017 at 4:13 PM.
Default New Role NPC - How did EA assign them to the world?
Hi all!

Don't think I'll actually get a reply on this, but it's worth a try! I got the script ready for a "HumanStatue" NPC role I've been working on for a few days and I actually got to the very first test. However, it turns out that the game doesn't recognises it as a NPC role, or at least, according to NRaas, it isn't. Which makes me wonder, how did EA get their NPC roles to:

- Be assigned to a specific locations (I looked at the ITUN file 'goToLotThatSatisfiedMyRole' already, couldn't find something like it pointing to a location.)
- Get it to appear in the world in the first place. Or at least, created/assigned.

I've been looking around in the actual roles, and the rolesmanager scripts and it seems like it should recognize it. I've also made a NPCRoles XML file, and used arsil's geneticRoleDesk as a XML reference just to see if I was doing it right. Though I guess the issue of it not reading it right is due to giving it the same name as you would with a regular XML file (Namespace+Class).

Here's the script itself if anyone's interested in taking a look at it(Still gotta clear out the using namespaces though):



And here's the XML file in case there's interest in seeing it:



I'm planning on giving it a custom uniform so that's why I left it in there. Same for the servobots.

EDIT: By "specific location"I kinda meant as in, making it always visit a park and let it do their thing without having to create a custom object to "trick" the sim in going there. If uhm... that makes any sense at all
Advertisement
Virtual gardener
staff: administrator
Original Poster
#2 Old 4th Jun 2017 at 1:58 PM
Hmm it seems like there's no way to get it to spawn without getting it an actual location to come from, and to go to. So, I'll go with plan B which means... More scripting!

Basically, I guess I'll go with this platform thingy, and hope that will fix the whole assigning issue.
Field Researcher
#3 Old 10th Jun 2017 at 8:14 PM
Quote: Originally posted by Greenplumbbob
Hmm it seems like there's no way to get it to spawn without getting it an actual location to come from, and to go to. So, I'll go with plan B which means... More scripting!

Basically, I guess I'll go with this platform thingy, and hope that will fix the whole assigning issue.


I haven't done much with NPCs but I do think it needs to be attached to a role-giving object if you want it to be assigned. Perhaps you can use some kind of nearly-invisible floor marker like Arsil did with the generic role marker object.
Virtual gardener
staff: administrator
Original Poster
#4 Old 11th Jun 2017 at 8:22 AM
I think i'll indeed go with a floor marker first just for testing purposes, I did see that even the tourists in-game where assigned to a lot, which I guess EA scripted differently compared to, say, a park I guess if I did manage to do it that way, the poor fellow would probably be doing his thing 24/7! I've actually decided to approach things a little differently, as adding custom animations and making the object the NPC will use, also usable for sims to preform.

Thanks for your reply!
Back to top