Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripts
Icaab2608 Offline
Member

Posts: 85
Threads: 37
Joined: Jul 2013
Reputation: 0
#1
Scripts

Is it possible to do so,to activate the script,on time a crouching and jumping?
01-12-2015, 07:57 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Scripts

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.

(This post was last modified: 01-12-2015, 09:24 PM by Mudbill.)
01-12-2015, 09:11 PM
Find
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#3
RE: Scripts

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.

01-13-2015, 08:32 AM
Find
Icaab2608 Offline
Member

Posts: 85
Threads: 37
Joined: Jul 2013
Reputation: 0
#4
RE: Scripts

(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!
01-13-2015, 09:52 PM
Find




Users browsing this thread: 1 Guest(s)