Allas的最近内容

  1. WB Coding Can't tune a ti_on_weapon_attack trigger for weapon reloading

    If you read through it, the first thing you do is subtract the cost, then check to see if you can use it. This will make you unable to use it since it will fail the check when it should have passed it.

    You really should do the opposite. Subtract the cost last, after actually using it, and if you cannot, dequip the item.

    Also, by using gt instead of ge you will make your player dequip the item when the values are equal and they should have been able to use it.

    插入代码块:
    ["lightning_bolt", "Lightning Bolt", [("empty", 0), ("light_beam", ixmesh_flying_ammo), ("icon_lightning", ixmesh_inventory)], itp_type_thrown|itp_primary|itp_can_penetrate_shield|itp_crush_through|itp_extra_penetration, itcf_throw_stone, 23, weight(0.23)|difficulty(0)|spd_rtng(60)|shoot_speed(60)|thrust_damage(70, pierce)|max_ammo(100)|weapon_length(7, imodbits_thrown,
    [(ti_on_weapon_attack, [
            (play_sound,"snd_lightning"),
            (get_player_agent_no,":agent"),
          
            (try_begin),
                    (ge, "$mana", "$curcost"),
                    (agent_set_ammo, ":agent", "$curspell", 2),
                    (val_sub, "$mana", "$curcost"),
                (else_try),
                    (agent_unequip_item,":agent","$curspell"),
            (try_end),
              
            ])]],

    disclaimer: I have not checked to see the viability of this and haven't done a script in WB for a few months so I may be wrong.
    Jesus Christ, turns out it's like the easiest, most obvious fix ever. Thanks:smile:
  2. WB Coding Can't tune a ti_on_weapon_attack trigger for weapon reloading

    So I've set up a magic system that, if you become a mage in camp menu, allows you to open a spell book in battle that gives you spells - itcf_throw_stone throwing weapons (with 2 ammo, because the character unwields the weapon as soon as there is no ammo). And it works fine except for the...
后退
顶部 底部