Mirage Engine
Stop Running - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Stop Running (/showthread.php?tid=2439)



Stop Running - jsventor - 18-12-2008

2 problems..

1. I want it so that when I RUN and RUn only it takes away SP, it takes away when I walk as well..
2. It doesnt stop moving when SP reaches 0..

In sub PlayerMove I added,
Code:
If GetPlayerSP(index)  0 Then
        Call SetPlayerSP(index, GetPlayerSP(index) - 1)
        Call SendSP(index)
      End If
    End If



Re: Stop Running - Nean - 18-12-2008

For
Code:
If Moved = YES Then
    'reduce SP by 1 when moving
    ' Drop the SP
    If GetPlayerSP(index) > 0 Then
        Call SetPlayerSP(index, GetPlayerSP(index) - 1)
        Call SendSP(index)
      End If
    End If

You should do a check to see if shift is pressed as well. Otherwise it'll just see if you're moving altogether, not running.

Something like this:
Code:
If Player(Index).Moving = MOVING_RUNNING Then



Re: Stop Running - Tony - 18-12-2008

[code]If Player(Index).Moving = MOVING_RUNNING and GetPlayerSP(index) > 0 then
Call SetPlayerSP(index, GetPlayerSP(index) - 1)
Call SendSP(index)
elseif GetPlayerSP(index)