Vert-I-Go

Member
ServUO Version
Publish Unknown
Ultima Expansion
None
Ok I am trying to create a custom mobile for tamed pets since trying to do a different type of trainable pets so i made a custom mobile scrip I think i did everything correct but getting a weird error not sure what's causing it not a great scripter but this one stumps me i uploaded the script itself and the test mobile and here is the error.

Errors:
+ Mobiles/Animals/Felines/TestLion.cs:
CS1729: Line 16: 'Server.Mobiles.BaseTameable' does not contain a constructor that takes 6 arguments
 

Attachments

  • BaseTameable.cs
    6.3 KB · Views: 7
  • TestLion.cs
    2.3 KB · Views: 5
Last edited:
Ok the issue can be easily explained (I hope I can write a good explanation though)

in your BaseTameable.cs line 45 you only have an empty constructor (not taking any parameter)
Code:
public BaseTameable() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )

since TestLion is a child of BaseTameable, it wont have access to the BaseCreatures Constructor (the one you call with base(..) at the line above)
what you are basically trying to call there is
Code:
BaseTameable(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed)

in this case you would want line 45 to look something like
Code:
public BaseTameable(AIType ai = AIType.AI_Mage, FightMode mode = FightMode.Closest, int iRangePerception = 10, int iRangeFight = 1, double dActiveSpeed = 0.2, double dPassiveSpeed = 0.4) : base( ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed )

Since it is also the base class I would recommend removing [Constructable] from line 44,
additionally I would use line 15, public abstract class instead of non abstract.

That would prevent creating BaseTameable's, but allow all non abstract children. So your TestLion would still be allowed to be created
 
Ok ya that seemed to worked great tested and worked with gaining points compiled ran tested yay now i can move forward with creating a new type of training pet type thank you so much for the help
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back