Slide Mechanic: Difference between revisions

From Unofficial EFPSE wiki Extended
Jump to navigation Jump to search
(add Note)
mNo edit summary
 
Line 1: Line 1:
'''Note:'''
'''Note:'''


'''This script cannot be used in Alpha 47 or later.'''
'''This script can only be used in Alpha 47 or later.'''
 
Note from Clark:
 
"Before alpha 47, the 'player check rotation' command unintentionally added 90 to x and y.
 
When this was fixed in alpha 47, any old scripts which used that command broke.
 
To update scripts to work with 47 and newer, all you have to do is add 90 to both the x and y result of any 'player check rotation' commands."




Line 10: Line 18:
bind space dash
bind space dash
player check rotation rotx roty
player check rotation rotx roty
rotx+=90 //fix for alpha 47+
roty+=90 //fix for alpha 47+
degtorad=$roty
degtorad=$roty
degtorad+=90
degtorad+=90

Latest revision as of 12:17, 30 September 2025

Note:

This script can only be used in Alpha 47 or later.

Note from Clark:

"Before alpha 47, the 'player check rotation' command unintentionally added 90 to x and y.

When this was fixed in alpha 47, any old scripts which used that command broke.

To update scripts to work with 47 and newer, all you have to do is add 90 to both the x and y result of any 'player check rotation' commands."


Put this to your loop_script:

//DASH LOGIC//
bind space dash
player check rotation rotx roty
rotx+=90 //fix for alpha 47+
roty+=90 //fix for alpha 47+
degtorad=$roty
degtorad+=90
degtorad*=0.0174533
dashy=COS($degtorad)
dashx=SIN($degtorad)
 
degtorad=$rotx
degtorad-=90
degtorad*=0.0174533
dashz=SIN($degtorad)
dash_reduct=COS($degtorad)
 
dash_speed=900

dashz*=$dash_speed
dashy*=$dash_speed
dashx*=$dash_speed
dashy*=$dash_reduct
dashx*=$dash_reduct

if $global.player_dash == 1 {
player velocity set $dashx $dashy $dashz
height walk 32
global.player_dash=2
}

if $global.player_dash == 2 {
dash_time+=$global.deltaTime
if $dash_time >= 1 {
global.player_dash=0
dash_time=0
height walk 42
}
}

Make a script named "dash.script" and put this inside:

if $global.player_dash == 0 {
global.player_dash=1
}

map quickreturn 2`

Now every 0.5 seconds you press space key, the player is launched with a force of 900 units per second to the direction you look at. It doesn't ignores gravity like regular dash should do but disabling gravity while giving player any velocity results in player flying out of bounds on cosmic speeds.