Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Almost got animations on map working


damian666
 Share

Recommended Posts

yeah, like i said in title, i got it almost working, btw, most code is allready there xd

```
'  send animations
            'For x1 = 0 To Map(MapNum).MaxX
                'For y1 = 0 To Map(MapNum).MaxY
                    'If Map(MapNum).Tile(x1, y1).Type = TILE_TYPE_ANIM And Map(MapNum).Tile(x1, y1).Data1 > 0 Then
                        'Call SendAnimation(MapNum, Map(MapNum).Tile(x1, y1).Data1, x1, y1, 0, 0)
                    'End If
                'Next
            'Next

```
this is in conjunction with a tiletype i made.

problem im having is, i cant find the right spot to send it from, i tried serverloop, but that just kept sending, and index clientside kept rising, so not good >.<

so question is, does anybody know where the hell i could place this piece of code?

ofcourse i know i have to only send when there are players on map.

Any suggestions are welcome :)

Dami
Link to comment
Share on other sites

in theory, if done properly no matter where is the code (because you have a defining) "For x1 = 0 To Map (MapNum). MaxX"
there is still an option to remove:
'For x1 = 0 To Map (MapNum). MaxX
                'For y1 = 0 To Map (MapNum). MaxY
and put it in PlayerMove
```
With Map (GetPlayerMap (index)). Tile (GetPlayerX (index), GetPlayerY (index))
If .Type = TILE_TYPE_ANIM And Map (GetPlayerMap (index)). Tile (GetPlayerX (index), GetPlayerY (index)). Data1> 0 Then
Call SendAnimation (GetPlayerMap (index), Map (GetPlayerMap (index)). Tile (GetPlayerX (index), GetPlayerY (index)). Data1, GetPlayerX (index), GetPlayerY (index), 0, 0)
End If

```If your code is correct in theory it should work)
Link to comment
Share on other sites

+ For this to work you can create your procedure(you can put in modGameLogic):
```
Public Sub Animation(ByVal MapNum As Long)
dim x1 as  long
dim y1 as long
            'For x1 = 0 To Map(MapNum).MaxX
                'For y1 = 0 To Map(MapNum).MaxY
                    'If Map(MapNum).Tile(x1, y1).Type = TILE_TYPE_ANIM And Map(MapNum).Tile(x1, y1).Data1 > 0 Then
                        'Call SendAnimation(MapNum, Map(MapNum).Tile(x1, y1).Data1, x1, y1, 0, 0)
                    'End If
                'Next
            'Next
End Sub

she can look at PlayerMove

Sub PlayerMove(ByVal index As Long, ByVal Dir As Long, ByVal movement As Long, Optional ByVal sendToSelf As Boolean = False)
at the very end
call Animation (MapNum)
End Sub

```
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...