Skip to content

Can you SetCreatureSize via script?

I know you can GetCreatureSize, but can you set it.

I have resized an NPC via script, but would like it to also be set as Large or Huge so it can dual wield morning star's. really just to be able to match the size category with the visual size of creatures in general.


Is this possible via an OnSpawn script

Comments

  • ShadowMShadowM Member Posts: 573
    edited November 2018
    Quilistan said:

    I know you can GetCreatureSize, but can you set it.

    I have resized an NPC via script, but would like it to also be set as Large or Huge so it can dual wield morning star's. really just to be able to match the size category with the visual size of creatures in general.


    Is this possible via an OnSpawn script

    In basic nwn there is currently no function for changing a creatures size, but I did edit the apperance.2da and made a custom function in my hr base that allows you to change the visual size and mechanically size of creatures and it can be applied on spawning. I do not think there are any other base module have this function, there might be a nwnx function for it though. I noticed in basic nwn there is a bug with large creatures not being able to duel wield some medium size weapons like morning stars, test a orge and you will see they can dual wield long swords (medium weapon) but they cannot dual wield morning stars. There is some de-sync with the weapons animation on humanoids in my system and looking on how to improve this. I hope BD introduces and SetSize function.
  • DerpCityDerpCity Member, Moderator Posts: 303
    Ever since they added SetVisualTransform I've wanted them to let us change the size category of creatures by script or by toolset. A system like the Movement Speed dropdown, with a default option that goes to the creature's default size and then having the other size categories selectable, would be good I think, as size category affects how things can be equipped. I had the same thoughts while messing around with the NWN2 editor; whats the point in having a tiny spider if he's considered a large creature and can't be knocked down by halflings without Improved Knockdown?

    @ShadowM Its not restricted to large creatures - you can't dual wield whips or morningstars as a medium character like you can hold two longswords, either. I think this is because they're animated weapons, and their animations were made for only one type of attack, so they set their equip entries to only being usable one handed. I'm pretty sure its its fixable by copying the "EquipableSlots" entry of a longsword or similar item to the morningstar and whip in the baseitems.2da, but I don't think I've actually tried it despite finding the idea of a Dual-Whipper appealing.
  • QuilistanQuilistan Member Posts: 186
    Thanks for the replies you two.

    I have thought about DerpCity's idea about the toolset setting myself, that would be cool and needed at this point.

    I will mess with the 2da file. If it is an animation thing, perhaps we need some off hand animations for the weapons that don't have them.

    I am passing off a scripted enlarged half orc with undead head as a Deathbringer, but two morning stars would really help with the feel.
  • ShadowMShadowM Member Posts: 573
    edited November 2018
    I did some testing , it hardcoded by 2da line. If you copy the moningstar line and place a copy down lower in the baseitem.2da and make a new item with that base item you can equip the morning star dual wield. I tested how it look and it ok to me. It the same thing with the whips. This might be a trello ask, for animation support for dual wield whips and morning stars and to unlock them. The animation look ok to me, but they could be made better with a new specific dual wield animation slot for each.
  • QuilistanQuilistan Member Posts: 186
    Name label InvSlotWidth InvSlotHeight EquipableSlots
    1 166 longsword 1 4 0x00030
    47 1541 morningstar 1 3 0x00030


    It was already listed as the same in the 2da file, and I am not seeing anything else there that would matter?
  • ShadowMShadowM Member Posts: 573
    Quilistan said:

    Name label InvSlotWidth InvSlotHeight EquipableSlots
    1 166 longsword 1 4 0x00030
    47 1541 morningstar 1 3 0x00030


    It was already listed as the same in the 2da file, and I am not seeing anything else there that would matter?

    Yeah they are the same like I said it hardcoded by saying x line in the baseitem.2da we are blocking duel wield on. So copy and paste it down and make a new weapon and test it.
Sign In or Register to comment.