Solved (Walking + Shooting), stopping movement after finishing?

Question that is answered or resolved.

MysticalMist

Active member
Based off @Bloodbane's template for walking + shooting, I have just finished implementing it into my character. The player uses MP as "ammo" as he both stands and walks. However, when he finishes after walking, he still moves briefly as the animation ends.

Here is the FREESPECIAL animation alongside the FOLLOW1 that the player uses for walking:
Code:
anim freespecial2
    offset 47 95
    delay 8
bbox.position.x 32
    bbox.position.y 44
    bbox.size.x 30
    bbox.size.y 51
    sound    data/sounds/guncock1.wav
    frame data/chars/Moxxie/pidle/0.png
    @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
    frame data/chars/Moxxie/pidle/1.png
    frame data/chars/Moxxie/pidle/3.png
    delay   10
    @cmd    keyflip 0
    sound    data/sounds/pistol1.wav
    @cmd    shooter "mbul1" 25 40 0 0 0
    @cmd    mpcost 5
        @cmd    Jalan "ANI_FOLLOW1" 0 1.2 0.8
    frame data/chars/Moxxie/pidle/4.png
    @cmd    keyflip 0
    @cmd    keyint "ANI_FREESPECIAL2" 4 "A4" 5
    frame data/chars/Moxxie/pidle/5.png
    @cmd    keyflip 0

    sound    data/sounds/pistol1.wav
    @cmd    mpcost 5
    @cmd    shooter "mbul1" 25 35 0 0 0
        @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
            @cmd    Jalan "ANI_FOLLOW1" 0 1.2 0.8
    frame data/chars/Moxxie/pidle/6.png
    @cmd    keyflip 0
    @cmd    keyint "ANI_FREESPECIAL2" 2 "A4" 0
    frame data/chars/Moxxie/pidle/3.png
    delay    18
    frame data/chars/Moxxie/pidle/1.png
    frame data/chars/Moxxie/pidle/0.png

anim follow1
    loop 1
    offset 50 95
    delay 10
bbox.position.x 35
    bbox.position.y 44
    bbox.size.x 30
    bbox.size.y 51
    frame data/chars/Moxxie/pwalk/0.png
    @cmd    keyflip 0
    @cmd    keymove 1.2 0.8
    @cmd    Henti "ANI_FREESPECIAL2" 2 1 1
    @cmd    keyintV "ANI_FREESPECIAL2" 7 "A4" 1 0 0
    @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
        sound    data/sounds/pistol1.wav
    @cmd    shooter "mbul1" 25 40 0 0 0
    @cmd    mpcost 5
    @cmd    keyflip 0
    @cmd    keymove 1.2 0.8
    @cmd    Henti "ANI_FREESPECIAL2" 2 1 1
    @cmd    keyintV "ANI_FREESPECIAL2" 7 "A4" 1 0 0
    @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
    frame data/chars/Moxxie/pwalk/1.png
    @cmd    keyflip 0
    @cmd    keymove 1.2 0.8
    @cmd    Henti "ANI_FREESPECIAL2" 2 1 1
    @cmd    keyintV "ANI_FREESPECIAL2" 7 "A4" 1 0 0
    @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
    frame data/chars/Moxxie/pwalk/2.png
    @cmd    keyflip 0
    @cmd    keymove 1.2 0.8
    @cmd    Henti "ANI_FREESPECIAL2" 2 1 1
    @cmd    keyintV "ANI_FREESPECIAL2" 7 "A4" 1 0 0
    @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
        sound    data/sounds/pistol1.wav
    @cmd    shooter "mbul1" 25 35 0 0 0
    @cmd    mpcost 5
        @cmd    keyflip 0
    @cmd    keymove 1.2 0.8
    @cmd    Henti "ANI_FREESPECIAL2" 2 1 1
    @cmd    keyintV "ANI_FREESPECIAL2" 7 "A4" 1 0 0
    @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
    frame data/chars/Moxxie/pwalk/3.png

I'm assuming it has to do with directly stopping the velocity but I'm not exactly sure how to do that.
 
Solution
Hmmm... you use another function to return to FREESPECIAL2 from FOLLOW1 (walk shoot), this is the cause of not stopping cause that function is most likely not doing that.
I suggest declaring dasher function like shown below to stop the movement.
Code:
...
@cmd    keyflip 0
    sound    data/sounds/pistol1.wav
    @cmd    mpcost 5
    @cmd    shooter "mbul1" 25 35 0 0 0
        @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
            @cmd    Jalan "ANI_FOLLOW1" 0 1.2 0.8
    frame data/chars/Moxxie/pidle/6.png
    @cmd    keyflip 0
    @cmd    keyint "ANI_FREESPECIAL2" 2 "A4" 0
    frame data/chars/Moxxie/pidle/3.png
    delay    1
    frame data/chars/Moxxie/pidle/3.png
    delay    18
    @cmd    dasher 0 0 0
    frame...
@cmd changeentityproperty getlocalvar ("self") "velocity" 0 0 0
Hmm I didn't know that the changeentityproperty can be used this way with @cmd directly in the animation, like the projectile command. Thanks buddy!

Please show us both the log and the model text with @danno's suggestion included.
I tested the function and it crashed too, but the problem is in the space between getlocalvar and ("self") and after removing it works fine.

1708491894894.png
 
@MysticalMist,

Please show us both the log and the model text with @danno's suggestion included.

DX

Here's where I put the @cmd

Code:
anim freespecial2
	offset 47 95
	delay 8
bbox.position.x 32
	bbox.position.y 44
	bbox.size.x 30
	bbox.size.y 51
	sound	data/sounds/guncock1.wav
	frame data/chars/Moxxie/pidle/0.png
	@cmd	aniLimit "ANI_FREESPECIAL2" 7 5
	frame data/chars/Moxxie/pidle/1.png
	frame data/chars/Moxxie/pidle/3.png
	delay   10
	@cmd	keyflip 0
	sound	data/sounds/pistol1.wav
	@cmd	shooter "mbul1" 25 40 0 0 0
	@cmd	mpcost 5
		@cmd	Jalan "ANI_FOLLOW1" 0 1.2 0.8
	frame data/chars/Moxxie/pidle/4.png
	@cmd	keyflip 0
	@cmd	keyint "ANI_FREESPECIAL2" 4 "A4" 5
	frame data/chars/Moxxie/pidle/5.png
	@cmd	keyflip 0

	sound	data/sounds/pistol1.wav
	@cmd	mpcost 5
	@cmd	shooter "mbul1" 25 35 0 0 0
		@cmd	aniLimit "ANI_FREESPECIAL2" 7 5
			@cmd	Jalan "ANI_FOLLOW1" 0 1.2 0.8
	frame data/chars/Moxxie/pidle/6.png
	@cmd	keyflip 0
	@cmd	keyint "ANI_FREESPECIAL2" 2 "A4" 0
	frame data/chars/Moxxie/pidle/3.png
	@cmd changeentityproperty getlocalvar ("self") "velocity" 0 0 0
	delay	18
	frame data/chars/Moxxie/pidle/1.png
	frame data/chars/Moxxie/pidle/0.png

And here's what the log had as an error:

Code:
Script compile error in 'Moxxie': getlocalvar line 492, column 33

********** An Error Occurred **********
*            Shutting Down            *

Can't compile script 'Moxxie' Data/Chars/Moxxie/Moxxie.txt
Total Ram: 68600729600 Bytes ( 65422 MB )
 Free Ram: 48653615104 Bytes ( 46399 MB )
 Used Ram:   156217344 Bytes (   148 MB )

Release level data...........
Done!

Release graphics data........	Done!
Release game data............


Release game data............	Done!
Release timer................	Done!
Release input hardware.......	Done!
Release sound system.........	Done!
Release FileCaching System...	Done!

**************** Done *****************

Can't compile script 'Moxxie' Data/Chars/Moxxie/Moxxie.txt
 
Hmm I didn't know that the changeentityproperty can be used this way with @cmd directly in the animation, like the projectile command. Thanks buddy!


I tested the function and it crashed too, but the problem is in the space between getlocalvar and ("self") and after removing it works fine.

View attachment 7304

Ah ok, now it doesn't crash for me anymore (coincidentally, I just saw this post the moment I posted my last reply), thank you! However the problem is still there for some strange reason. The player maintains his movement for those last two frames when holding down the movement key regardless.
 
Hmmm... you use another function to return to FREESPECIAL2 from FOLLOW1 (walk shoot), this is the cause of not stopping cause that function is most likely not doing that.
I suggest declaring dasher function like shown below to stop the movement.
Code:
...
@cmd    keyflip 0
    sound    data/sounds/pistol1.wav
    @cmd    mpcost 5
    @cmd    shooter "mbul1" 25 35 0 0 0
        @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
            @cmd    Jalan "ANI_FOLLOW1" 0 1.2 0.8
    frame data/chars/Moxxie/pidle/6.png
    @cmd    keyflip 0
    @cmd    keyint "ANI_FREESPECIAL2" 2 "A4" 0
    frame data/chars/Moxxie/pidle/3.png
    delay    1
    frame data/chars/Moxxie/pidle/3.png
    delay    18
    @cmd    dasher 0 0 0
    frame data/chars/Moxxie/pidle/1.png
    frame data/chars/Moxxie/pidle/0.png

HTH

[couple time later]

I misunderstood couple things so I've fixed couple things, sorry about that. I also realized something, it's possible that when returning to FREESPECIAL2, the stopping script was skipped causing him to keep moving. I suggested adding quick frame as returning frame declared just before stopping script.
 
Last edited:
Solution
Hmmm... you use another function to return to FREESPECIAL2 from FOLLOW1 (walk shoot), this is the cause of not stopping cause that function is most likely not doing that.
I suggest declaring dasher function like shown below to stop the movement.
Code:
...
@cmd    keyflip 0
    sound    data/sounds/pistol1.wav
    @cmd    mpcost 5
    @cmd    shooter "mbul1" 25 35 0 0 0
        @cmd    aniLimit "ANI_FREESPECIAL2" 7 5
            @cmd    Jalan "ANI_FOLLOW1" 0 1.2 0.8
    frame data/chars/Moxxie/pidle/6.png
    @cmd    keyflip 0
    @cmd    keyint "ANI_FREESPECIAL2" 2 "A4" 0
    frame data/chars/Moxxie/pidle/3.png
    delay    1
    frame data/chars/Moxxie/pidle/3.png
    delay    18
    @cmd    dasher 0 0 0
    frame data/chars/Moxxie/pidle/1.png
    frame data/chars/Moxxie/pidle/0.png

HTH

[couple time later]

I misunderstood couple things so I've fixed couple things, sorry about that. I also realized something, it's possible that when returning to FREESPECIAL2, the stopping script was skipped causing him to keep moving. I suggested adding quick frame as returning frame declared just before stopping script.

Works like a charm! Thank you!
 
Back
Top Bottom