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

Two paperdolls for one item


Eevee204
 Share

Recommended Posts

Okay so in my design I didn't want classes so I made Male/Female the classes, but I didn't want to make two different items (1 item per class) to work on male/female, so I created two folders in paperdolls 'male' and 'female'

Now my problem is that it won't read both depending on the class type.

The code I'm using to read different folder directory is this;

```

If Player(MyIndex).Class = "Male" Then

gender = "male\"

Else

gender = "female\"

End If

ReDim Tex_Paperdoll(1)

While FileExist(GFX_PATH & "paperdolls\" & gender & i & GFX_EXT)

ReDim Preserve Tex_Paperdoll(NumPaperdolls)

NumTextures = NumTextures + 1

ReDim Preserve gTexture(NumTextures)

Tex_Paperdoll(NumPaperdolls).filepath = App.Path & GFX_PATH & "paperdolls\" & gender & i & GFX_EXT

Tex_Paperdoll(NumPaperdolls).Texture = NumTextures

NumPaperdolls = NumPaperdolls + 1

i = i + 1

Wend

```

I don't really know any other method to take from here, any one able to guide me?

Thanks

- Sythnet
Link to comment
Share on other sites

check if this code works

```

if Player(MyIndex).Class = "Male" then

gender = "male\"

Else

gender = "female\"

End If

NumTextures = 0

NumPaperdolls = 0

i = 1

While FileExist(App.Path & GFX_PATH & "paperdolls\" & gender & i & GFX_EXT)

NumTextures = NumTextures + 1

NumPaperdolls = NumPaperdolls + 1

ReDim Preserve Tex_Paperdoll(NumPaperdolls)

ReDim Preserve gTexture(NumTextures)

Tex_Paperdoll(NumPaperdolls).filepath = App.Path & GFX_PATH & "paperdolls\" & gender & i & GFX_EXT

Tex_Paperdoll(NumPaperdolls).Texture = NumTextures

i = i + 1

Wend

```

If it gives you a type missmatch error in this line

```
If Player(MyIndex).Class = "Male" Then
```
its because i thing .Class is a byte and not a string. I am not sure though and i cant look into the code right now
Link to comment
Share on other sites

we cant help you if you dont give us enough information. Are you using EO 3 or EA? Where are you putting this code? Does it gives you any errors? Have you even tried the code i gave you? If yes what errors did it gave you? And whats the different method you are trying?
Link to comment
Share on other sites

looking at the sub i can see that this code runs once and only loads the folder witch is the same as the players class. try this code instead

```

Public Sub CheckPaperdolls()

Dim i As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

i = 1

NumPaperdolls = 1

ReDim Tex_Paperdoll(1)

While FileExist(GFX_PATH & "paperdolls\" & "male\" & i & GFX_EXT)

ReDim Preserve Tex_Paperdoll(NumPaperdolls)

NumTextures = NumTextures + 1

ReDim Preserve gTexture(NumTextures)

Tex_Paperdoll(NumPaperdolls).filepath = App.Path & GFX_PATH & "paperdolls\" & "male\" & i & GFX_EXT

Tex_Paperdoll(NumPaperdolls).Texture = NumTextures

NumPaperdolls = NumPaperdolls + 1

i = i + 1

Wend

While FileExist(GFX_PATH & "paperdolls\" & "female\" & i & GFX_EXT)

ReDim Preserve Tex_Paperdoll(NumPaperdolls)

NumTextures = NumTextures + 1

ReDim Preserve gTexture(NumTextures)

Tex_Paperdoll(NumPaperdolls).filepath = App.Path & GFX_PATH & "paperdolls\" & "female\" & i & GFX_EXT

Tex_Paperdoll(NumPaperdolls).Texture = NumTextures

NumPaperdolls = NumPaperdolls + 1

i = i + 1

Wend

NumPaperdolls = NumPaperdolls - 1

' Error handler

Exit Sub

errorhandler:

HandleError "CheckPaperdolls", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

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