Frictional Games Forum (read-only)
Scripts - 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: Scripts (/thread-29490.html)



Scripts - Icaab2608 - 01-12-2015

Is it possible to do so,to activate the script,on time a crouching and jumping?


RE: Scripts - Mudbill - 01-12-2015

I don't think there's any easy way to do that. Only manual way I can think of at the moment is to make a big area above the player that will be the jump collision trigger, and another in the middle that the player is always in, but stops colliding with when crouching that can be the crouching trigger (on exit of the area).

Here's an example:
[Image: 9yXJEAJ.png]

The top red box is the jumping area. Trigger the jumping callback when the player collides with it.
The red box in the middle is the crouching one. When the player crouches (3rd green box), they fall out of the area so you can trigger the crouching callback.

The green boxes are the player (obviously).

Now, this of course has some drawbacks and might fail depending on level layout. It's only simulating these callbacks. If your level changes in height the player can move, it might be tricky to get it working in that area (but it is possible by making diagonal areas there). Good luck.


RE: Scripts - MrBehemoth - 01-13-2015

For jumping, you could use a looped timer to monitor GetPlayerYSpeed() for sudden increases. Again, this gets tricky depending on map layout, eg. running up stairs could trigger it too.


RE: Scripts - Icaab2608 - 01-13-2015

(01-12-2015, 09:11 PM)Mudbill Wrote: I don't think there's any easy way to do that. Only manual way I can think of at the moment is to make a big area above the player that will be the jump collision trigger, and another in the middle that the player is always in, but stops colliding with when crouching that can be the crouching trigger (on exit of the area).

Here's an example:
[Image: 9yXJEAJ.png]

The top red box is the jumping area. Trigger the jumping callback when the player collides with it.
The red box in the middle is the crouching one. When the player crouches (3rd green box), they fall out of the area so you can trigger the crouching callback.

The green boxes are the player (obviously).

Now, this of course has some drawbacks and might fail depending on level layout. It's only simulating these callbacks. If your level changes in height the player can move, it might be tricky to get it working in that area (but it is possible by making diagonal areas there). Good luck.
Thank you!