[Solved] help me with .dll

Started by dniwe_kore, February 23, 2017, 03:37:30 AM

Previous topic - Next topic

dniwe_kore

so i created .dll by Haplo's tutorial/example(thanks!), just added two new verbs
using System;
using Verse;

namespace CombatMove
{
    public class Verb_LaunchProjectileOneUse : Verb_LaunchProjectile
    {
        protected override bool TryCastShot()
        {
            if (base.TryCastShot())
            {
                if (this.burstShotsLeft <= 1)
                {
                    this.SelfConsume();
                }
                return true;
            }
            if (this.burstShotsLeft < this.verbProps.burstShotCount)
            {
                this.SelfConsume();
            }
            return false;
        }

        public override void Notify_EquipmentLost()
        {
            base.Notify_EquipmentLost();
            if (this.state == VerbState.Bursting && this.burstShotsLeft < this.verbProps.burstShotCount)
            {
                this.SelfConsume();
            }
        }

        private void SelfConsume()
        {
            if (this.ownerEquipment != null && !this.ownerEquipment.Destroyed)
            {
                this.ownerEquipment.Destroy(DestroyMode.Vanish);
            }
        }
    }
}
- one use grenade projectile
and
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Verse;
using Verse.Sound;
using RimWorld;
using UnityEngine;

namespace CombatMove
{
    public class Verb_MeleeAttackCoMo : Verb_MeleeAttack
    {
        protected override int ShotsPerBurst
        {
            get
            {
                return this.verbProps.burstShotCount;
            }
        }
    }
}
- same as default melee attack verb, but not ignoring <burstShotCount>, just for test.
Added .dll in my mod, added new verbs to weapons, but game can't find verbs(red errors in debugger).

So can you help me? https://www.dropbox.com/sh/bjt7ohqbx6iqpnw/AABRlbYmz_MRlR0nIc3s1iVSa?dl=0
i know, my english not so ugly as mine

RawCode

it was fun to manually check your def's for one, that using custom verb, but sadly, your "items" folder contains bodyparts and shells, that have no verb definition.

probably you want to show error log and defs that actually use your custom verb?

and probably you hit same issue like everyone and forgot to specify namespace inside verb declaration

dniwe_kore

wow thanks for your time
i added new verbs for weapons, for melee greatsword and grenade flashbang bomb, both in misc folder
namespace inside verbs calls CombatMove, dll calls CombatMove, mod calls CombatMove

[attachment deleted by admin due to age]
i know, my english not so ugly as mine

RawCode

copypaste def that contain's reference to your custom code here AS TEXT, reading text from image is waste of time.

dniwe_kore

  <ThingDef ParentName="BaseMeleeWeapon_Sharp">
    <defName>MeleeWeapon_GreatSword</defName>
    <label>greatsword</label>
    <description>Ultimate two handed weapon of knights. Cut off heads for holy order.</description>
    <graphicData>
      <texPath>Things/Item/GreatSword</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>InteractPistol</soundInteract>
    <costStuffCount>240</costStuffCount>
    <statBases>
      <WorkToMake>44000</WorkToMake>
      <Mass>4.9</Mass>
      <MeleeWeapon_DamageAmount>34</MeleeWeapon_DamageAmount>
      <MeleeWeapon_Cooldown>4.2</MeleeWeapon_Cooldown>
    </statBases>
    <equippedAngleOffset>-25</equippedAngleOffset>
    <stuffCategories>
      <li>Metallic</li>
    </stuffCategories>
    <verbs>
      <li>
        <verbClass>Verb_MeleeAttackCoMo</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <meleeDamageDef>Cut</meleeDamageDef>
      </li>
    </verbs>
   <equippedStatOffsets>
      <MoveSpeed>-1.2</MoveSpeed>
      <WorkSpeedGlobal>-0.12</WorkSpeedGlobal>
   </equippedStatOffsets>
  </ThingDef>
i know, my english not so ugly as mine

RawCode

Verb_MeleeAttackCoMo
to
%NAMESPACEOFTYPE%.Verb_MeleeAttackCoMo

dniwe_kore

THANKS! you saved alot of my neurons. Sadly, but you sacrificed some of yours. Truly heroic act.

problem now doesn't exist, but anyway burst-melee and one-use nades both doesn't work. Amen.
i know, my english not so ugly as mine