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

(CS:DE) Working blood


tslusny
 Share

Recommended Posts

Hello. This is tutorial for making blood work in CS:DE.

SO lets get started  ;)
only Client side

**CLIENT SIDE**

Find:
```
Private Sub HandleBlood
```In this sub find:
```
Set Buffer = Nothing
```Under it add:
```
    If BloodCount = 0 Then
        BloodCount = D3DT_TEXTURE(Tex_Blood).width / 32
    End If
```Now add this at bottom of **modDirectX8**
```
Public Sub DrawBlood(ByVal Index As Long)
Dim rec As GeomRec

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    With Blood(Index)
        ' check if we should be seeing it
        If .timer + 20000 < GetTickCount Then Exit Sub
        rec.top = 0
        rec.height = 32
        rec.left = (.Sprite - 1) * 32
        rec.width = 32

        RenderTexture Tex_Blood, ConvertMapX(.X * PIC_X, ConvertMapY(.Y * PIC_Y), rec.left, rec.top, rec.width, rec.height, rec.width, rec.height
    End With

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "DrawBlood", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```Now in
```
Public Sub Render_Graphics()
```Find this:
```
' render lower tiles
    If Count_Tileset > 0 Then
        For X = TileView.left To TileView.Right
            For Y = TileView.top To TileView.bottom
                If IsValidMapPoint(X, Y) Then
                    Call DrawMapTile(X, Y)
                End If
            Next
        Next
    End If
```And add this under it:
```
' render the decals
    For i = 1 To MAX_BYTE
        Call DrawBlood(i)
    Next
```
**OPTIONAL**
And if u want to draw blood everytime you attack (not only if tile is empty), this will remove blood from tile and place another (this is usefull, when you have better blood in game, not that small shit original blood)

In **Private Sub HandleBlood**
Replace For under
```
' make sure tile doesn't already have blood
```With this:
```
For i = 1 To MAX_BYTE
        If Blood(i).X = X And Blood(i).Y = Y Then
            With Blood(i)
                .X = 0
                .Y = 0
                .Sprite = 0
                .timer = 0
            End With
            ' already have blood :(
        End If
    Next
```And voila… You are finished for now  :P
Report any bugs found.
Link to comment
Share on other sites

It doesnt render in the right place or the right size  :O or its only for me XD

its rendering a square of 4*4(i think) tiles with blood.

this fixed mine….
```
RenderTexture Tex_Blood, ConvertMapX((.x * PIC_X)), ConvertMapY((.y * PIC_Y)), rec.left, rec.top, rec.Width, rec.height, rec.Width, rec.height
```
Link to comment
Share on other sites

@Ariel:

> It doesnt render in the right place or the right size  :O or its only for me XD
>
> its rendering a square of 4*4(i think) tiles with blood.
>
> this fixed mine….
> ```
> RenderTexture Tex_Blood, ConvertMapX((.x * PIC_X)), ConvertMapY((.y * PIC_Y)), rec.left, rec.top, rec.Width, rec.height, rec.Width, rec.height
> ```

Thx for post i have hi res blood in my game so i forgot to change *128 to * 32

FIXED, not only what you writed will fix that thing, you must change that 128 in sub drawblood to 32, added to main post
Link to comment
Share on other sites

@Ariel:

> is you blood is that big?? lol how does things fit on your game?

Yea my blood is that big :cheesy: but i have standard 32x32 graphics in my game i just changed draw position for blood and downloaded some realistic blood images and resized them to 128x128 and maked them semi-transparent, so now when someone attack me or when i attack some1 i will have bigger splash under me :P
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...