Frictional Games Forum (read-only)
[SCRIPT] can someone explain me this? - 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] can someone explain me this? (/thread-30134.html)



can someone explain me this? - NotASkrub - 06-18-2015

Hi, I am DefinitelyNotASkrub, and I'm here to ask you this:
Is there a way, that I can script the following:
I have a room with mansion base wall default02.
I want to be able to change that wall with a script to a door_way, door_frame and level door.. Is there any way to do this?
If you need pictures to understand it, I can make them and show them to you ;d


RE: can someone explain me this? - Amnesiaplayer - 06-18-2015

(06-18-2015, 03:00 PM)NotASkrub Wrote: Hi, I am DefinitelyNotASkrub, and I'm here to ask you this:
Is there a way, that I can script the following:
I have a room with mansion base wall default02.
I want to be able to change that wall with a script to a door_way, door_frame and level door.. Is there any way to do this?
If you need pictures to understand it, I can make them and show them to you ;d

So you want to change a wall, into a Doorway, doorframe and door...
I don't think that's possible.
Since the wall is a Static_Object.
Best way to do this, is change the static objects into Entities.
(I really don't know how for now...)
Be creative with those kinda things Smile
I just made a ground, that moves up and down. so It kinda works like a mini elevator.

And for the scripting, if You changed them into entities (door way and door frame and the wall)
Then simply use the SetEntityActive Smile


RE: can someone explain me this? - Mudbill - 06-18-2015

I have a video on nearly this exact scenario. I'm not sure if LevelDoors can be enabled and disabled though, so you might need to create a "dummy" LevelDoor entity and enable a script area over it which has an interaction callback enabled, which should trigger a ChangeMap event.






RE: can someone explain me this? - Darkfire - 06-18-2015

To change something into entity:
1. Open modeleditor
2. From menu: import a mesh.
3. You'll have a model appear. Now you need to add a body. Body is a thing stops player and objects from going through the model, so you need to cover it all. That is done by creating a block box- pink thingy button on the left. Add as many as you need, shape and position them, mark them by clicking shift+left mouse button and click 'create body'. Now it's a one piece and you can adjust some things on the right.
4. Most important part. Click on settings>user defined variables. Here choose type:object and then subtype static.
5. Make sure to save the file with a different name and as an .ent file, or else you can screw up big time.
6. Pretty easy, ay ? Now you can use the file as an entity<=>deactivate and activate it when necessary

EDIT: Crap. Mudbill outran me when I was writing D:


RE: can someone explain me this? - FlawlessHappiness - 06-18-2015

(06-18-2015, 03:36 PM)Mudbill Wrote: I'm not sure if LevelDoors can be enabled and disabled

They definitely can!
I'm pretty sure the only entity type that cannot be disabled is 'StaticProp'


RE: can someone explain me this? - Darkfire - 06-18-2015

Yup. Almost every entity can be deactivated.


RE: can someone explain me this? - NotASkrub - 06-18-2015

Amnesiaplayer Wrote:So you want to change a wall, into a Doorway, doorframe and door...
I don't think that's possible.
Since the wall is a Static_Object.
Best way to do this, is change the static objects into Entities.
(I really don't know how for now...)
Be creative with those kinda things Smile
I just made a ground, that moves up and down. so It kinda works like a mini elevator.

And for the scripting, if You changed them into entities (door way and door frame and the wall)
Then simply use the SetEntityActive Smile
Yes! That was my idea at first, I've been thinking for it whole day at school Big Grin
But when I got home, I saw that it can't be done, and so I came here..
==================
Mudbill Wrote:I have a video on nearly this exact scenario. I'm not sure if LevelDoors can be enabled and disabled though, so you might need to create a "dummy" LevelDoor entity and enable a script area over it which has an interaction callback enabled, which should trigger a ChangeMap event.
I was just watching one of your vids, and I feel kinda happy, that you, kind sir posted here, lol.
==================
"Darkfire Wrote:EDIT: Crap. Mudbill outran me when I was writing D:
I know the feel bro..


RE: can someone explain me this? - Amnesiaplayer - 06-19-2015

(06-18-2015, 08:39 PM)NotASkrub Wrote: [quote="Amnesiaplayer"]So you want to change a wall, into a Doorway, doorframe and door...
I don't think that's possible.
Since the wall is a Static_Object.
Best way to do this, is change the static objects into Entities.
(I really don't know how for now...)
Be creative with those kinda things Smile
I just made a ground, that moves up and down. so It kinda works like a mini elevator.

And for the scripting, if You changed them into entities (door way and door frame and the wall)
Then simply use the SetEntityActive Smile
Yes! That was my idea at first, I've been thinking for it whole day at school Big Grin
But when I got home, I saw that it can't be done, and so I came here..
==================

Haha that happens to me to! Exactly!
I'm always thinking about something really good, at school.
And when i'm home. it doesn't work somehow haha