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

[EO 3.0] Paperdoll based on gender


lcarens
 Share

Recommended Posts

This allows you to use the same item on multiple genders, since the paperdoll will be dependent on the players gender.

How it works is that you pick the paperdoll image that you wish to use for the male character, for example, I'll use '3'.

The system will take that number, and if it's equipped on a male, it will use paperdoll image #3.

HOWEVER, if it's equipped on a female, it will add +1 to that number, so it will use paperdoll image #4.

How I'm using this is making all male paperdolls have odd image numbers, and female paperdolls have even image numbers.

(Heavily based off bits of code written by blkcrow.)

Client Side Edits:

At the bottom of ModDatabase, add:

```

Function GetPlayerSex(ByVal Index As Long) As Byte

If Index > MAX_PLAYERS Then Exit Function

GetPlayerSex = Player(Index).sex

End Function

Sub SetPlayerSex(ByVal Index As Long, ByVal sex As Byte)

If Index > MAX_PLAYERS Then Exit Sub

Player(Index).sex = sex

End Sub

```

In modHandleData, in HandlePlayerData, add

```
Call SetPlayerSex(i, buffer.ReadLong)
```
right below

```
Call SetPlayerClass(i, buffer.ReadLong)
```

In modTypes, in PlayerRec, add

```
sex As Byte
```
right below

```
PK As Byte
```

In modGraphics, in DrawPlayer, replace:

```

' 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 DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, anim, spritetop)

End If

End If

Next

```
with

```

' 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

If GetPlayerSex(Index) = 0 Then

Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, anim, spritetop)

ElseIf GetPlayerSex(Index) = 1 Then

Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll + 1, anim, spritetop)

End If

End If

End If

Next

```

Server Side Edits:

At the bottom of ModPlayer, add:

```

Function GetPlayerSex(ByVal index As Long) As Byte

If index > MAX_PLAYERS Then Exit Function

GetPlayerSex = Player(index).sex

End Function

```

In modServerTCP, in PlayerData, add:

```
Buffer.WriteByte GetPlayerSex(index)
```
right below

```
buffer.WriteLong GetPlayerClass(index)
```

In modTypes, in PlayerRec, add:

```
sex As Byte
```
right below

```
PK As Byte
```
Link to comment
Share on other sites

I just spent all morning trying to fix a glitch where all of the stats would show as 255.

If anyone else is having that issue, the problem is because of this tutorial.

In modHandleData, in HandlePlayerData, change:

```
Call SetPlayerSex(i, buffer.ReadByte)
```
to

```
Call SetPlayerSex(i, buffer.ReadLong)
```

Sorry for any issues this caused. >_<

I was actually just about to open a topic to ask for help with this.

The tutorial has been updated to reflect this.
Link to comment
Share on other sites

Yea something like that.

> if so, then you would just set both gender's paperdolls to the same image…
>
> Does that mean making 2 paperdolls just so that you can use it for 2 genders? (I mean common item paperdolls like swords, kinves and stuff that souldn't change even if a diff gender)
Link to comment
Share on other sites

even swords and such arent going to line up across 2 paperdolls anyway, it would be better 2 have two seperate ones than 2 that dont match one of the sprites. if you wanna make common paperdolls just add a common paperdoll as boolean and put a check box in frmeditor item, then in where it says```
' 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

If GetPlayerSex(Index) = 0 Then

Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, anim, spritetop)

ElseIf GetPlayerSex(Index) = 1 Then

Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll + 1, anim, spritetop)

End If

End If

End If

Next
```add in a check like if item.common paperdoll = true then end if. just gimme a sec ill give ya a step by step.
Link to comment
Share on other sites

it should be something like this

OK here is how to add common paperdolls to the items.

in modtypes add```
commonpdoll as boolean
```
then add a check box to frmeditor item named ChkCommon

double click that and add```
If Chkcommon.Value Then

.Item(EditorIndex).commonpdoll = True

Else

Item(EditorIndex).commonpdoll = False

End If
```
now go to modgameeditors and itemeditor init

below

```
frmEditor_Item.scrlProjectileSpeed.Value = .speed
```
add

```
If Item(EditorIndex).commonpdoll Then

frmEditor_Item.chkTwoh.Value = 1

Else

frmEditor_Item.chkTwoh.Value = 0

End If
```

lastly go to mod graphics draw player and replace```
' 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

If GetPlayerSex(Index) = 0 Then

Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, anim, spritetop)

ElseIf GetPlayerSex(Index) = 1 Then

Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll + 1, anim, spritetop)

End If

End If

End If

Next
```with this```
' 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

If GetPlayerSex(Index) = 0 Then

Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, anim, spritetop)

ElseIf GetPlayerSex(Index) = 1 Then

if getplayerequipment(index).commonpdoll < 1 then

Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll + 1, anim, spritetop)

End If

End If

End If

end if

Next
```i havent actually tried this code yet but it should be about right.
Link to comment
Share on other sites

my previous post pretty much explains exactly how to do it.

woah Abhi2011 i hadnt realized you already made a tutorial for this, i knew there was an old tutorial that i first saw but it didnt have avy options, it just said if your gender is female paperdoll = paperdoll+1 and thats kinda what i thought you where refrencing lol. yea your tutorial wouldnt take much to get it to work with dx8
Link to comment
Share on other sites

  • 3 weeks later...

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...