When I start my server, ever since day one, it says something about no vb scripts, type -vb to activate.
When did we use VB scripts?
And are they any better or useful?
 
VB.net capability has been in the engine for quite some time. I don't recall many people ever using it though.

The problem is that at compilation c# scripts are compiled first and then vb.net scripts. What this means is you can reference c# in your VB.net scripts but not VB.net in your c# scripts. It's better to stick with c#.

Here is an example of a weapon in VB.net. No idea if it will compile.

Code:
Imports System
Imports Server.Network
Imports Server.Items

Namespace Server.Items

<FlipableAttribute( &H13B9, &H13Ba )> _
Public Class VBVikingSword
Inherits BaseSword

Public Overrides ReadOnly Property PrimaryAbility As WeaponAbility
Get
Return WeaponAbility.CrushingBlow
End Get
End Property

Public Overrides ReadOnly Property SecondaryAbility As WeaponAbility
Get
Return WeaponAbility.ParalyzingBlow
End Get
End Property

Public Overrides ReadOnly Property AosStrengthReq As Integer
Get
Return 40
End Get
End Property

Public Overrides ReadOnly Property AosMinDamage As Integer
Get
Return 15
End Get
End Property

Public Overrides ReadOnly Property AosMaxDamage As Integer
Get
Return 17
End Get
End Property

Public Overrides ReadOnly Property AosSpeed As Integer
Get
Return 28
End Get
End Property

Public Overrides ReadOnly Property OldStrengthReq As Integer
Get
Return 40
End Get
End Property

Public Overrides ReadOnly Property OldMinDamage As Integer
Get
Return 6
End Get
End Property

Public Overrides ReadOnly Property OldMaxDamage As Integer
Get
Return 34
End Get
End Property

Public Overrides ReadOnly Property OldSpeed As Integer
Get
Return 30
End Get
End Property

Public Overrides ReadOnly Property DefHitSound As Integer
Get
Return &H237
End Get
End Property

Public Overrides ReadOnly Property DefMissSound As Integer
Get
Return &H23A
End Get
End Property

Public Overrides ReadOnly Property InitMinHits As Integer
Get
Return 31
End Get
End Property

Public Overrides ReadOnly Property InitMaxHits As Integer
Get
Return 100
End Get
End Property

<Constructable> _
Sub New()
MyBase.New(&H13B9)
Name = "VB viking sword"
Weight = 6.0
End Sub 'New

Public Sub New(serial As Serial)
MyBase.New(serial)
End Sub 'New

Public Overrides Sub Serialize(writer As GenericWriter)
MyBase.Serialize(writer)
writer.Write(CInt(0))
End Sub 'Serialize

Public Overrides Sub Deserialize(reader As GenericReader)
MyBase.Deserialize(reader)
Dim version As Integer = reader.ReadInt()
End Sub 'Deserialize

End Class 'VBVikingSword
End Namespace 'Server.Items
 
Wow huge difference from a C# script :)

Yeah the syntax is way different. I used to develop in basic many years ago and made a few small games. It's super easy to learn but super hard to perfect.

VB.net can do just about everything C# can do but it's just way nicer to use C#.
 
Back