[SCRIPT] Furniture - messing up and random filling - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [SCRIPT] Furniture - messing up and random filling (/thread-18891.html) |
Furniture - messing up and random filling - craven7 - 10-23-2012 Hi I tried to mess up furniture like in 10_daniels_room, but nothing happens when using this script: Code: AddBodyImpulse("chest_of_drawers_simple_1_Body_1",0,0,-3,"world"); Also I wonder if there's a way to generate random stuff like books, clothes, bottles etc inside the drawers, desktop's and cabinets by script. Thx RE: Furniture - messing up and random filling - FlawlessHappiness - 10-23-2012 I would you AddPropImpulse, since they are all props... And 30 is very much, when you use impulse RE: Furniture - messing up and random filling - craven7 - 10-23-2012 But in daniels_room by FG these functions are used too... Code: //----ROOM MESS SETUP----// RE: Furniture - messing up and random filling - FlawlessHappiness - 10-23-2012 FG did a lot of stuff that i don't understand either. F.x. All of their scripts areas has PlayerLookAtAutoRemoveCallback checked... Anyway: Give it a try with AddPropImpulse RE: Furniture - messing up and random filling - Mackiiboy - 10-23-2012 Yea, there is probably many different ways to generate random entities. I have figured out one way to make it possible with a short, simple script: Code: void OnStart() Image of script areas: Spoiler below!
You can simply add more entity types by adding more LocalVarStrings, remember to name the strings with the correct name and update the integer for the amount of different entities. You can also add more script areas in your map, they should be named: (SpawnArea_i), where i is the index. Do not forget to update the integer for the amount of entities to be spawned. You can rotate the script areas if you want the entities to spawn with different angles. There is probably better ways to spawn random entities, but this is one, simple and possible way to do it . (10-23-2012, 12:45 PM)craven7 Wrote: Also I wonder if there's a way to generate random stuff like books, clothes, bottles etc inside the drawers, desktop's and cabinets by script. RE: Furniture - messing up and random filling - craven7 - 10-23-2012 Hi, thanks for your solution, but I was looking for a more automatic way to do this... I mean if I have to place scriptAreas in every furniture in my map I can as well place the items instead. It would be nice if there was a way to do this only with scripthing and without having to use the leveleditor. As it seems possible to address each part of a furniture (drawers) I thought there may be a way to spawn items inside these. RE: Furniture - messing up and random filling - Mackiiboy - 10-23-2012 You do just have to place script-areas inside one drawer. After that, you could just combine and create a compound of the drawer and the script-areas and duplicate the compound and place it somewhere else. It will not take much time after you have created the first compound. (int afSpawnAmount will then be X*Y where X is the amount of areas inside one drawer, and Y the amount of drawers). It is still a bit time-consuming, but it takes much less time than placing random entities by hand in all drawers . (10-23-2012, 07:09 PM)craven7 Wrote: Hi, thanks for your solution, but I was looking for a more automatic way to do this... I mean if I have to place scriptAreas in every furniture in my map I can as well place the items instead. RE: Furniture - messing up and random filling - craven7 - 10-23-2012 Yeah you're right with this, I didn't think about this method. It's jstu because I already placed many drawers etc and now I'd have to replace them^^ |