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

I need some help coding


Matt
 Share

Recommended Posts

I'm trying to make a system when you equip a shield, the players sprite changes to a shield holding sprite, when you equip a weapon that is two handed, the sprite changes to a two handed stance, and if there are neither, then the sprite changes to the regular one which is arms free. I have this all taken care of, but then i realized that the paperdolls would not work. So i set to work on making two more pic boxes for the paperdolls.

My problem is, i dont know what goes into adding this pic box, so im somewhat lost. I tried copying what goes into (at least what i assume goes into) the paperdolls, but it didnt work.

If anyone could help me understand what goes into it, or show me what to do **and** explain what was done and why, that would be great. :)

Im also assuming that the code to make sure that there is specific equipment and change the paperdoll would go in either one of these two bellow. If i'm wrong, please tell me.

```
            ' Paperdolls
            If NumPaperdolls > 0 Then
                For i = 1 To NumPaperdolls    'Check to unload surfaces
                    If PaperdollTimer(i) > 0 Then 'Only update surfaces in use
                        If PaperdollTimer(i) < Tick Then  'Unload the surface
                            Call ZeroMemory(ByVal VarPtr(DDSD_Paperdoll(i)), LenB(DDSD_Paperdoll(i)))
                            Set DDS_Paperdoll(i) = Nothing
                            PaperdollTimer(i) = 0
                        End If
                    End If
                Next
            End If
```
```
    ' check for paperdolling
    For i = 1 To UBound(PaperdollOrder)
        If GetPlayerEquipment(Index, PaperdollOrder(i)) > 0 Then
            If Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll > 0 Then
                Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
            End If
        End If
    Next
```
Link to comment
Share on other sites

  • 2 weeks later...
For example, if the weapon is a two handed weapon, the paperdoll for all the equipped items is changed. Same for shields. You would have three different paperdolls for one item that can be equipped.
Link to comment
Share on other sites

I'm rather confused.
Do you understand what a paperdoll is? It's an image that gets places over the sprite.. You just need the paperdoll images in the \paperdoll\ file and then assign them in the ItemEditor to the item you want.

I think you're making this far more complicated than it needs to be.
Or, I'm being stupid and misunderstanding what you mean.
Link to comment
Share on other sites

@TheSoljah:

> i think he means when you equip a two handed weapon the sprite changes to a two handed weapon stance, its the same with a shield.
>
> you will need seperate sprites if you want them to change stance

I've already done the separate sprites. I'll give you an example with images.

![](http://i45.tinypic.com/10q9iis.png)

1) My sprite
2) My sprite with a shield wielded
3) Shield paperdoll
4) Armor paperdoll

I already made it so that if there is a shield, the sprite changes to a shield sprite and if there isnt a shield, the sprite is normal.

5) Equipping a shield. The paperdoll fits, and the sprite changes.
6) I equip armor and it doesnt fit.

I know i need 2 seperate armor paperdolls for this to work, but i dont know how to make the paperdoll change according to if there is a shield or not. I could probably do this if i hard coded it, but i'm not interested in doing that.

7) what i'm trying to achieve.

Hopefully now you understand what i'm trying to do. Any help?
Link to comment
Share on other sites

@Synergy:

> I'm rather confused.
> Do you understand what a paperdoll is? It's an image that gets places over the sprite.. You just need the paperdoll images in the \paperdoll\ file and then assign them in the ItemEditor to the item you want.
>
> I think you're making this far more complicated than it needs to be.
> Or, I'm being stupid and misunderstanding what you mean.

I've been working with EO for about two years. I think i know what a paperdoll is ;)
I probably didnt explain it very well, so above i included an example.
Link to comment
Share on other sites

Ah, right, I think I understand.
Because the paperdoll for the shield wouldn't look correct on the standard sprite, you want to change the sprite when a shield is equipped.
Is that right?

I understand the problem now, but I'm struggling to think of a way to do it.
You effectively need to have two paperdolls that can be called from one item, depending on if there's a shield equipped.
Unless you just have a different sprite with the armour on, and it would change if a shield is equipped?
Link to comment
Share on other sites

@Synergy:

> Ah, right, I think I understand.
> Because the paperdoll for the shield wouldn't look correct on the standard sprite, you want to change the sprite when a shield is equipped.
> Is that right?
>
> I understand the problem now, but I'm struggling to think of a way to do it.
> You effectively need to have two paperdolls that can be called from one item, depending on if there's a shield equipped.
> Unless you just have a different sprite with the armour on, and it would change if a shield is equipped?

Yes. I've got the sprite switching all done, but the only problem is the paperdolls. I was thinking of something like this

```
If the shield is equipped then
if a helmet is wielded then
getplayerequipment(index, helmet).paperdoll = paperdoll + 1

```
and so on with the other armor types.

You would have to organize the paperdolls in way so its, 1.bmp = no shield, 1.bmp = with shield, 2.bmp = no shield, 2.bmp = with shield etc.

This is just an idea. I didn't test it.
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...