Most scenes are written around 1-5 actors. It can be hard to juggle a lot of NPCs for a scene. But you can have maybe up to 20 NPCs. I have a scene that has over 10 actors but all they do is function as background while I engage with only one actor.
It all depends on how much work you want to put into it.
A bit of code I use for one of my scenes.
Code:
Helper = getPersonHere()
While !Helper.isInterestedIn(Player)
Helper = getPersonHere()
endWhile
If !Helper.isValid() || !Helper.isInterestedIn(Player)
Helper = generatePersonTemporary()
While !Helper.isInterestedIn(Player) || Helper:age > 35
Helper = generatePersonTemporary()
endWhile
Helper.randomizeRace()
Helper.randomizeHairs()
Helper.randomizeFace()
Helper.dress()
Helper.show(2)
Endif
Thanks for your input Ravenger6660, I have your entire mod collection and have used them both as inspiration and to learn from, so thank you. When i get some time to write some scenes i'll play around with this code.
I notice the .randomise etc, would that not change the actor? selected by getPersonHere() ive not seen that or understood it yet so plenty of gaps in my knowledge
However i feel i might of explained myself slightly wrong by using the word "scene". What i mean is you enter a place, it generates background temporary actors, some are visiting, some work there.
Is that also defined as a scene or; My query being 1) can you increase the number of background actors generated in a location (scene?). 2) And using said code you've shared here, can i use it to grab background characters whos appearance and clothes are already shown, or is this the only way to generate and display actors once an actual .lpscene loads? lack of experience working with lifeplay here lol
To help explain what im going for here, an example: my character enters a pub that ive never been in before (no contacts, no permanent actors), the game currently loads in 3-5 people, i wish to make it generate say 3-20. potientially based on time of day (somewhere being closed already does this via 0 people). These being inworld actors i can select and interact with normally, but I then decide say, to be a thieving dipshit and pickpocket someone, i fail a sneak test minigame for example and get caught. as part of that scene being caught it pulls in everyone present. using said present actors i run a series of what if elses on each character (or perhaps only a random number of them) allocated as witness1. witness2. witness3. etc; via either thier masochist stat (pity npcs dont have karma) or rapportwithplayer to determine thier general reaction, ignore/call cops/kick my ass (via martial i guess) leaving me to either flee, fight or negotiate. Probably end up in an alley knocked out or in jail because my guys are usually rubbish in thier martial stats
Realising that would be rather extensive to write for possibly upto 20 people but hey..
A simpler example would be, I enter a pub, 5 people there, i want to grab everyone present and start a scene, for example (vin_base/scenes/social/house_party.lpscene) but using existing background actors, and obviously not set at home, a pub background.
Or another, i go to work with 3 known contacts, one whos number i dont have, 2 actors not visibily present or tempactors and my boss, during a "work.lpaction" theres a chance for a scene to trigger that then takes everyone present, and say plays a scene where my boss demands everyone in thier office because someones decided to idk fuck with the coffee machine or something, or maybe just a meeting..