Common Code Locations

From VbGORE Visual Basic Online RPG Engine

This page is missing information or incomplete - Go ahead, write some more!
You can extend this page by editing it. Relevant information may be found at the talk page.

This page is to help those who are looking for quick references to pieces of code that might commonly be changed, because searching through the forums is not very efficient. Although this page is aimed for those less experienced in VB6, it can obviously be used for anyone. Those of you who are looking to contribute, please follow the guidelines.

Contents

Guidelines

This information should be included in every entry - in its respective order.

  1. Find the file name by searching through the sub-headers under the 'Contributed Code' section. If the file name is not there, start your own sub-header using the exact file name as the title.
  2. Find the exact Sub name (not including parameters) within that file's sub-sub headers. Again, if not found - which will usually be the case - then start your own.
  3. Give a brief explanation for what the code does. Make sure it is easily understood how to change what it is that you're changing in the code, and why.
  4. The original code (with <---- (id#) arrows pointing to important values/variables). The (id#) allows you to reference it within your explanation.
  5. Your changed code (please still include the arrows)

When pasting your code, make sure it is succinct without being a single line of code. This allows for code that might be very similar, to be distinguishable.
Also, in case you didn't know, code is tagged using <vb></vb>. Bullets are notated using the * prefix.
Finally, these guidelines are just a start. If anyone has any suggestions for changes, please use the discussion board.

Example Entry

GameClient.vbp

Sound_Play

This piece of code controls the volume of weather sound effects (NOT 3d sound effects such as the waterfall). The zero that label 1 is pointing to is the default, and maximum volume. Sound_Volume can take anywhere from -10000 to 0 (-10000 being no sound, 0 being maximum). In my code, I chose -500 as a temporary fix because 0 seemed too loud.

Original Code

<vb>'Confirm the buffer exists

   If Not SoundBuffer Is Nothing Then

       'Reset the sounds values (in case they were ever changed)
       SoundBuffer.SetCurrentPosition 0
       Sound_Pan SoundBuffer, 0
       Sound_Volume SoundBuffer, 0 '<----- 1  

       'Play the sound
       SoundBuffer.Play flags

   End If</vb>

Edited Code

<vb>'Confirm the buffer exists

   If Not SoundBuffer Is Nothing Then

       'Reset the sounds values (in case they were ever changed)
       SoundBuffer.SetCurrentPosition 0
       Sound_Pan SoundBuffer, 0
       Sound_Volume SoundBuffer, -500 '<----- 1  

       'Play the sound
       SoundBuffer.Play flags

   End If</vb>


Contributed Code

Personal tools