|
Post by Buzz Carols on Oct 29, 2013 22:15:01 GMT
I recently discovered this thread: www.marbleblast.proboards.com/index.cgi?board=mbppublic&action=display&thread=3238I played around with a lot of the codes because I was looking for something specific. I was trying to find a way to make it so that when W, A, S, or D is hit, the marble rolls, but immediately stops right when the key is lifted. I was also curious to find something that makes it so that when a key is hit, the marble would roll at a constant pace rather than starting slowly and then gaining more and more speed. In other words, the code in mind is one that could make the marble roll at a constant pace, and not move unless a key is being held down. This includes the times when the marble is in the air, and I hope it works with Big Marble 1 because that's how the level's going to be. If there's a code for this, please tell me.
|
|
|
Post by Jeff on Oct 30, 2013 3:06:57 GMT
I'm not sure if the physics allows it. However, don't quote me on that, I might be able to find you a way.
|
|
|
Post by IsraeliRD on Oct 30, 2013 3:26:31 GMT
Well, it would be possible by detecting key input and if none are pressed, just ApplyImpulse 0 0 0 (which would automatically stop the marble). Now from what I know you can have the marble momentum kept for one direction, and stopped on another, so basically say 0 0 0 = FB LR UD (forwards/backwards, left/right, up/down). This way if one stops pressing FB but is still LR then his marble would move LR and any FB momentum stopped.
Regarding constant pace you'd have to set ApplyImpulse at the speed you want and at the same time you'd have to set the movement keys to that same speed so that you don't have acceleration (but linear movement).
Now because a marble is mid-air, you can grab the current vel value and apply it to the UD part and set the other two to 0.
This is rather hackish, trigger-based and may take a few hours of work, but AFAIK would be possible.
|
|
|
Post by Buzz Carols on Oct 30, 2013 4:23:18 GMT
Thanks for the help, Matan. To be honest, the constant pace is not the top-priority, so if it's as hard as it sounds, I could settle for the immediate stops alone. What kind of thing would I put the code in? Would it be the .mis file or some sort of custom trigger (since you said it might be trigger-based)?
|
|
|
Post by IsraeliRD on Oct 30, 2013 5:13:52 GMT
Trigger based with the command of ApplyImpulse(0,0,0); (note that code is completely wrong, get someone else to tell you how to do this proper). This will halt the marble instantly and then you can use whatever direction key you want to move it again.
Note that if the third number is 0 then it stops the marble in mid-air, literally, where next thing is gravity taking over again so the marble starts constantly accelerating downwards again.
|
|
|
Post by Jeff on Oct 30, 2013 20:00:23 GMT
matan:
applyIMpulse is not setvelocity, that just adds velocity, so it wont stop.
|
|