Hey Eclipse, This is my first tutorial. In this tutorial you will be able to hide paperdolls by command and save. This feature doesn’t do anything special but if your game is mostly based on customization then this can be pretty useful. Andur Engine 1.3.0 will already have this so if you have that version or higher, you don’t need to follow this tutorial. I will also explain what the codes does so hopefully beginners can understand it.

Ok so this is all client side:


First search for

Public Sub SaveOptions()

and after

Options.Windowed = GetVar(FileName, "Options", "Windowed")

and add in:

    Options.helmet_show = GetVar(FileName, "GameSettings", "helmet_show")
    Options.armor_show = GetVar(FileName, "GameSettings", "armor_show")
    Options.shield_show = GetVar(FileName, "GameSettings", "shield_show")
    Options.weapon_show = GetVar(FileName, "GameSettings", "weapon_show")

This tells us where to save the value in the config file.


now go to Public Sub LoadOptions()

and after

Options.Windowed = 1

Add in:

    Options.helmet_show = 1
    Options.armor_show = 1
    Options.shield_show = 1
    Options.weapon_show = 1

This will set these as the default values so if the values dosen’t exist on the config file then the client will create it and insert the default value which is 1


then after

Options.Windowed = GetVar(FileName, "Options", "Windowed")

add in:

        Options.armor_show = GetVar(FileName, "GameSettings", "armor_show")
        Options.shield_show = GetVar(FileName, "GameSettings", "shield_show")
        Options.weapon_show = GetVar(FileName, "GameSettings", "weapon_show")

This loads the value from the config file


After that search for

Private Type OptionsRec and after
Windowed As Byte

add in:

helmet_show As Byte
armor_show As Byte
shield_show As Byte
weapon_show As Byte

This loads in the string stored on the options


Now search for

/help

and after all the call AddTexts
add in

              Case "/ShowHelmet"
               Options.helmet_show = 1
               SaveOptions
               Case "/HideHelmet"
               Options.helmet_show = 0
               SaveOptions
               Case "/ShowArmor"
               Options.armor_show = 1
               SaveOptions
               Case "/HideArmor"
               Options.armor_show = 0
               SaveOptions
               Case "/ShowShield"
               Options.shield_show = 1
               SaveOptions
               Case "/HideShield"
               Options.shield_show = 0
               SaveOptions
               Case "/ShowWeapon"
               Options.weapon_show = 1
               SaveOptions
               Case "/HideWeapon"
               Options.weapon_show = 0
               SaveOptions

This adds commands so if you type it in on the chatbox then it would save the data to the config files.


If you are in Andur Engine, look for

Call DrawPlayerAccessories(Index, Armor, X, Y, Sprite, rec, Anim, spritetop)
Call DrawPlayerAccessories(Index, Helmet, X, Y, Sprite, rec, Anim, spritetop)
Call DrawPlayerAccessories(Index, Shield, X, Y, Sprite, rec, Anim, spritetop)
Call DrawPlayerAccessories(Index, Weapon, X, Y, Sprite, rec, Anim, spritetop)

Replace it with

If armor_show = True Then
 Call DrawPlayerAccessories(Index, Armor, X, Y, Sprite, rec, Anim, spritetop)
    End If
    
    If Options.helmet_show = 1 Then
Call DrawPlayerAccessories(Index, Helmet, X, Y, Sprite, rec, Anim, spritetop)
    End If
    
    If Options.shield_show = 1 Then
Call DrawPlayerAccessories(Index, Shield, X, Y, Sprite, rec, Anim, spritetop)
    End If
    
    If Options.weapon_show = 1 Then
Call DrawPlayerAccessories(Index, Weapon, X, Y, Sprite, rec, Anim, spritetop)
    End If

If you are in EO 3.0

search for If GetPlayerEquipment(Index, helmet) > 0 Then

and above it add: if Options.Show_helmet = 1 then
and below

GetPlayerEquipment(Index, helmet) > 0 Then

add end if

do this for all the other equipment

If you are in ER search for

Call SetPlayerEquipment(MyIndex, buffer.ReadLong, armor)
Call SetPlayerEquipment(MyIndex, buffer.ReadLong, Weapon)
Call SetPlayerEquipment(MyIndex, buffer.ReadLong, helmet)
Call SetPlayerEquipment(MyIndex, buffer.ReadLong, shield)

and add an if Options.show_XXX = 1 then above each one of them and add 4 end if after that

This checks if the paperdolls in the config is 1 if it is then it will display the items.

And lastly open configs.ini from the data files and after all the other options add the following:

[GameSettings]
helmet_show = 1
armor_show = 1
shield_show = 1
weapons_show = 1

And that’s it. This is my first tutorial and I’m still learning vb6 and thought this would be useful to people so I decided to make this a tutorial. Thanks and yes I know the code sucks and there are far better ways I can do this. I first did it by adding booleans but since on load all the paperdoll show = true it would annoy the players so I then decided to go like this.