Frictional Games Forum (read-only)
[SCRIPT] Teleporting-Naked-Guy Help - 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] Teleporting-Naked-Guy Help (/thread-25611.html)

Pages: 1 2 3


RE: Teleporting-Naked-Guy Help - PutraenusAlivius - 07-05-2014

PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""TeleportScript""NailThatSucker"true1);
}

void NailThatSucker(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("Naked_Guy"true);
    
AddPropForce("Naked_Guy", -1000000"world");
    
PlaySoundAtEntity("""24_iron_maiden.snt""Naked_Guy"0false)


It's int alState, not int alStates. Also, it doesn't have to be on the X axis, could be on the Z axis too.
Also, these kinds of jumpscares are sort of looked down on these forums. Since this is your first CS, some of us (including me) will let it pass, but try to not use these kinds of jumpscares.


RE: Teleporting-Naked-Guy Help - The chaser - 07-05-2014

Lol true, it's "alState"... See? Those are the kind of things you have to search for, but that can be easily overlooked.


RE: Teleporting-Naked-Guy Help - CQBgamer - 07-05-2014

Yeah that worked. Thanks to everyone who actually helped, and as far as the corpses being a "cliche" jump scare, I agree with you 100% and do not intend on using them (unless used with a proper building of anticipation that makes it actually scary) But as a first time CS maker I just figured that something as simple as that is something that I should know how to do.

Just one more question on this topic and I promise you will never have a thread from me again asking about these types of jump scares. I have played custom stories where the corpse actually comes out from inside say a cabinet or the iron maiden and the doors swing open as he comes out, when I try this he gets the doors open but remains inside the cabinet/iron maiden due to his hands/feet being collided with the walls of the object. How would I go about fixing this?


RE: Teleporting-Naked-Guy Help - PutraenusAlivius - 07-05-2014

There should be a magnet icon at the bottom corner of the LevelEditor. Click it and now move the corpse until he doesn't collide with anything (like his hands in the wall, etc.).


RE: Teleporting-Naked-Guy Help - MsHannerBananer - 07-05-2014

(07-05-2014, 09:59 AM)CQBgamer Wrote: Yeah that worked. Thanks to everyone who actually helped, and as far as the corpses being a "cliche" jump scare, I agree with you 100% and do not intend on using them (unless used with a proper building of anticipation that makes it actually scary) But as a first time CS maker I just figured that something as simple as that is something that I should know how to do.

Make your custom story how you want to make it. Smile There are people out there who don't mind the naked guys scares. I, for one, don't think they should be overused, however since I scare easily, it would be an easy scare for me every single time, haha. You could place 6 in a row with 4 second intervals and I'd probably pee myself every time.

There are people who don't mind the teleporting naked guys, but it's when they're used 50 times in one story that they start to get annoying. We won't name names but it's very obvious that some people absolutely despise the naked guys, but one or two placed very far apart from one another in the game isn't going to kill anyone, haha.

I believe it started with the mass creation of Pewdiepie maps, because I suppose it was amusing that he scared easy from the teleporting naked guys, but they became so overused that a lot of people on the forum came to absolutely loathe them.

I hope this experience hasn't left a bad taste in your mouth with the forums. We aren't all that bad. Big Grin

Also, welcome! Haha!!


----

As for having the cabinet doors open... I know that the metal cabinets have door names, but I'm sure it's the same for the fancy wood cabinet as well. You'd need to add a PropForce to each individual door, but this is easy.

PHP Code:
AddBodyForce("cabinet1_rightDoor"00, -900"world");
AddBodyForce("cabinet1_leftDoor"00, -900"world"); 

So, if you had a cabinet named "cabinet1" you add "_rightdoor" or "_leftdoor". Use both to open both doors, or just one.

The values (0, 0, -900) are the X, Y, and Z axis'. So you would adjust this to what axis you want the doors to swing open on and also adjust for the positive and negative values. You can play around a bit to see what gives you the best results. I also believe that the higher the value, the harsher the doors swing open, so -900 is naked guy jump scare value, haha.

EDIT: I assume "Harry Potter's" suggestion might work, never tried it myself though so I wouldn't know. Try either, and choose what's easiest, haha. Big Grin

EDIT EDIT: I'm an idiot, didn't read close enough. IT'S LATE OKAY!?!?! xD Yeah. Just click off the little magnet (which is the snap tool) so you can move around your guy so he isn't touching the walls. This would be a little more difficult for the iron maiden, however if you made the iron maiden big enough, it's fine. You could also shrink down the size of your naked guy. Who says all the bodies have to be the same size? It would be hilarious at the same time as it would be surprising.


RE: Teleporting-Naked-Guy Help - CQBgamer - 07-05-2014

(07-05-2014, 10:25 AM)MsHannerBananer Wrote: As for having the cabinet doors open... I know that the metal cabinets have door names, but I'm sure it's the same for the fancy wood cabinet as well. You'd need to add a PropForce to each individual door, but this is easy.

PHP Code:
AddBodyForce("cabinet1_rightDoor"00, -900"world");
AddBodyForce("cabinet1_leftDoor"00, -900"world"); 

So, if you had a cabinet named "cabinet1" you add "_rightdoor" or "_leftdoor". Use both to open both doors, or just one.

The values (0, 0, -900) are the X, Y, and Z axis'. So you would adjust this to what axis you want the doors to swing open on and also adjust for the positive and negative values. You can play around a bit to see what gives you the best results. I also believe that the higher the value, the harsher the doors swing open, so -900 is naked guy jump scare value, haha.

EDIT: I assume "Harry Potter's" suggestion might work, never tried it myself though so I wouldn't know. Try either, and chose what's easiest, haha. Big Grin

I dont have an issue getting the doors open, because the Addforce script on the corpse still pushes his feet foward thus opening the doors, but since the model spawns in T-Posed there is no way I can position him inside the cabinets that his hands wont be touching the sides. If there is no other way to fix that would it just be possible to disable collisions between the corpse and cabinet and then just use the code you provided to simulate him hitting the doors? If so what code would I use to disable the collision between the corpse and cabinet?


RE: Teleporting-Naked-Guy Help - The chaser - 07-05-2014

About the naked guys:

I, personally, hate them. I think that it's a very cheap, bad, overused and crappy jumpscare. If I'm in a story and I suddenly see one of these, I give it a margin of another one to quit (how ironic, my first story had those too... how much do I regret that story)

Anyways, welcome to the forum! Don't mind making more help threads, everyone needs help at some point, and we'll be glad to help you Smile

About your problem:

As Harry Potter said, there's a magnet icon: I'm pretty sure you'll have noticed that when you drag around an object, it moves along a grid. If you toggle off the magnet, it won't snap (be careful though, it's very hard to make things match if you don't use the grid, use this only to put some things, but never use it for structures!)

With that said:

Put the flying guy in a manner that it's floating inside the cabinet, and that it doesn't touch anything. I'm pretty sure that'll fix it.

I don't reccomend disabling collision for the cabinet, you can always resize the cabinet just a bit (the necessary space for the man).


RE: Teleporting-Naked-Guy Help - MsHannerBananer - 07-05-2014

(07-05-2014, 10:43 AM)CQBgamer Wrote:
(07-05-2014, 10:25 AM)MsHannerBananer Wrote: As for having the cabinet doors open... I know that the metal cabinets have door names, but I'm sure it's the same for the fancy wood cabinet as well. You'd need to add a PropForce to each individual door, but this is easy.

PHP Code:
AddBodyForce("cabinet1_rightDoor"00, -900"world");
AddBodyForce("cabinet1_leftDoor"00, -900"world"); 

So, if you had a cabinet named "cabinet1" you add "_rightdoor" or "_leftdoor". Use both to open both doors, or just one.

The values (0, 0, -900) are the X, Y, and Z axis'. So you would adjust this to what axis you want the doors to swing open on and also adjust for the positive and negative values. You can play around a bit to see what gives you the best results. I also believe that the higher the value, the harsher the doors swing open, so -900 is naked guy jump scare value, haha.

EDIT: I assume "Harry Potter's" suggestion might work, never tried it myself though so I wouldn't know. Try either, and chose what's easiest, haha. Big Grin

I dont have an issue getting the doors open, because the Addforce script on the corpse still pushes his feet foward thus opening the doors, but since the model spawns in T-Posed there is no way I can position him inside the cabinets that his hands wont be touching the sides. If there is no other way to fix that would it just be possible to disable collisions between the corpse and cabinet and then just use the code you provided to simulate him hitting the doors? If so what code would I use to disable the collision between the corpse and cabinet?

I edited my post, haha. I didn't read close enough, but I'll just paste what I said. Sorry man. I'm dumb, lolol.

Just click off the little magnet (which is the snap tool) so you can move around your guy so he isn't touching the walls. This would be a little more difficult for the iron maiden, however if you made the iron maiden big enough, it's fine. You could also shrink down the size of your naked guy (a little or a lot.) Who says all the bodies have to be the same size? It would be hilarious at the same time as it would be surprising.


RE: Teleporting-Naked-Guy Help - CQBgamer - 07-05-2014

(07-05-2014, 10:46 AM)MsHannerBananer Wrote: Who says all the bodies have to be the same size? It would be hilarious at the same time as it would be surprising.

It never once occurred to me to use the scale tool Tongue. And I dont remember what CS it was but the author made an obscenely large Iron Maiden and I expected it to be a giant corpse or something else that was very large that was meant to scare me, nope... he had like 50 tiny little corpse plopping out and was hands down the best use of the teleporting naked guy mechanic I have ever seen.


RE: Teleporting-Naked-Guy Help - PutraenusAlivius - 07-05-2014

(07-05-2014, 10:25 AM)MsHannerBananer Wrote:
PHP Code:
AddBodyForce("cabinet1_rightDoor"00, -900"world");
AddBodyForce("cabinet1_leftDoor"00, -900"world"); 

So, if you had a cabinet named "cabinet1" you add "_rightdoor" or "_leftdoor". Use both to open both doors, or just one.

That wouldn't work. If you open the model in the ModelEditor, you'll see that the main body and doors are seperate and you only specify the body of the doors, not the names of the doors.

So unless the Body your Right door is named rightDoor and Body of the Left door named leftDoor, your method won't work.
PHP Code:
AddBodyForce("cabinet1_Body_1"00, -900"world");
AddBodyForce("cabinet1_Body_2"00, -900"world"); 

That would work.