Forum

> > CS2D > General > Bind crashing my game
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Bind crashing my game

5 replies
To the start Previous 1 Next To the start

old Bind crashing my game

zazz
User Off Offline

Quote
Hey, i tried to make a bind to toggle from absolute to relative movement but idk why everytime i toggle the bind my game crashes.. any idea why or how to fix this?.. thanks
1
2
3
4
5
6
7
8
9
10
alias toggle_movement "toggle_movement_command"
alias toggle_movement_command "toggle_movement"

alias toggle_movement_absolute "cl_absolute 1; cl_relative 0; alias toggle_movement toggle_movement_relative"
alias toggle_movement_relative "cl_absolute 0; cl_relative 1; alias toggle_movement toggle_movement_absolute"

alias toggle_movement_absolute_command "toggle_movement_absolute"
alias toggle_movement_relative_command "toggle_movement_relative"

bind "mouse3" "toggle_movement_command"

old Re: Bind crashing my game

mrc
User Off Offline

Quote
WT* are you doing, just: bind "mouse3" "relativemovement"

But I'm not sure if CS2D recognizes mouse3 as a button.

old Re: Bind crashing my game

slimK
User Off Offline

Quote
user mrc has written
WT* are you doing, just: bind "mouse3" "relativemovement"

But I'm not sure if CS2D recognizes mouse3 as a button.


Actually you can bind mouse3 but not other buttons (unless you bind mouse buttons to keyboard). I use mouse3 for radio messages .

old Re: Bind crashing my game

DC
Admin Off Offline

Quote
btw: Classic infinite loop here. Pretty sure the first 2 lines are crashing CS2D
1
2
alias toggle_movement "toggle_movement_command"
alias toggle_movement_command "toggle_movement"

I'm not sure what you tried to express here but "alias A B" means: Define A so that running A will run B.

So what you wrote here in the first 2 lines means:
Running toggle_movement will run toggle_movement_command.
Running toggle_movement_command will run toggle_movement.

So toggle_movement will run toggle_movement_command. toggle_movement_command will run toggle_movement. toggle_movement will run toggle_movement_command. toggle_movement_command will run toggle_movement. toggle_movement will run toggle_movement_command. toggle_movement_command will run toggle_movement. toggle_movement will run toggle_movement_command. ... and so on ...

It never ends. It's an infinite loop which does nothing. CS2D will run it really often really quickly and nothing will happen. At some point CS2D will simply crash. It's most likely a stack overflow from calling so many functions.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview