Horse Grenadier

Can you drop me a link? I don't have too much time to work on this stuff these days but if you do I'll look for a fix.
 
Yeah, it's directly in the post I quoted, click through this link, it has the files attached if needed. Thank you.
 
Working on it. Expect a reply in a day or two real life permitting.
 
Great! There's no need to hurry, take your time.
 
I have managed to reproduce the issue but no idea why or how it's happening. So I just went ahead and created a whole new kfm. Try this one and please give me a report back so I can know if it's fixed. I don't have the time to do extensive testing.
 

Attachments

  • Horse_Grenadier_Neu.7z
    624.6 KB · Views: 95
Last edited:
Sure, I'll give it a try. Thanks!
 
Using the new kfm resulted in a C++ exception (read access violation) when selecting the unit. Not sure what is going on. Sorry for the trouble.
 
That is very odd because it works for me just fine. I clicked on it and had it fight other units and everything. Here is the XML I used for testing. Try and compare it with yours. Also make sure to completely replace the unit entirely and not just the kfm file. Best thing to do is just delete the whole folder and use the one I just uploaded.
Code:
       <UnitArtInfo>
            <Type>ART_DEF_UNIT_GRENADIER</Type>
            <Button>Art/Units/Horse_Grenadier_Neu/BotonGranadero.dds</Button>
            <fScale>0.44</fScale>
            <fInterfaceScale>0.8</fInterfaceScale>
            <bActAsLand>0</bActAsLand>
            <bActAsAir>0</bActAsAir>
            <NIF>Art/Units/Horse_Grenadier_Neu/Horse_Grenadier.nif</NIF>
            <KFM>Art/Units/Horse_Grenadier_Neu/Horse_Grenadier.kfm</KFM>
            <ShadowDef>
                <ShadowNIF>Art/Units/01_UnitShadows/HorseShadow.nif</ShadowNIF>
                <ShadowAttachNode>HorseBip Spine1</ShadowAttachNode>
                <fShadowScale>1.0</fShadowScale>
            </ShadowDef>
            <fBattleDistance>0.35</fBattleDistance>
            <fRangedDeathTime>0.31</fRangedDeathTime>
            <bActAsRanged>1</bActAsRanged>
            <TrainSound>AS2D_UNIT_BUILD_UNIQUE_UNIT</TrainSound>
            <AudioRunSounds/>
        </UnitArtInfo>
 
That's odd, to make sure I explicitly deleted the existing Horse_Grenadier directory before placing the new one (I copied the entire folder before but just let it override), and also used your art defines.

Here's the diff:
Code:
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   Assets/Art/Units/Horse_Grenadier/Horse_Grenadier.kfm
        deleted:    Assets/Art/Units/Horse_Grenadier/Horse_Grenadier_MD_RunDie.kf
        deleted:    Assets/Art/Units/Horse_Grenadier/knight.nif
        modified:   Assets/XML/Art/CIV4ArtDefines_Unit.xml

And the error message:
Spoiler :
pyex2.png


That line of code is drawing the smaller unit model in the bottom left (as you can see it's missing). It also seems like the flames of the grenades are not rendered correctly. I also noticed your art defines did not have a shadernif defined, if that matters (adding it changed nothing). The problem is present on low and high graphics settings, by the way.
 
The shadeniff missing is not accidental. My unit does not have one and thus the line should be deliberately left out. As for the rest I'll see what I missed and post back.
 
Thanks again.
 
Try this one. I redid the unit again. I am going to get this one right even if it means I drop dead.
Sadly one thing I can't get right is the fuse. It's a blending issue that I can't control or at least don't know how to.
 

Attachments

  • Horse_Grenadier.7z
    643.3 KB · Views: 96
This time everything is working, so no need to drop dead. Thanks for the perseverance.

The fuse is a minor issue only imo. Thank you for this great unit! Trying new animations is rare and commendable.
 
Dear PPQ_Purple, I downloaded the Horse Grenadier you made and tried to transform it into an Arambai cavalry, but now some problems have arisen, I don't know how to solve them, I can only come and ask for advice you:
I replaced all the grenades in the NIF with darts, but the cavalry still throws grenades when throwing attacks, how can I modify the grenades in the throwing animation?
The cavalryman appears in the game with a dart, but the dart in his hand disappears after an attack?
 
Dear PPQ_Purple, I downloaded the Horse Grenadier you made and tried to transform it into an Arambai cavalry, but now some problems have arisen, I don't know how to solve them, I can only come and ask for advice you:
I replaced all the grenades in the NIF with darts, but the cavalry still throws grenades when throwing attacks, how can I modify the grenades in the throwing animation?
The cavalryman appears in the game with a dart, but the dart in his hand disappears after an attack?
It's been a while since I did any units but if I recall correctly this is what you need to understand and do.

The projectile, in this case grenade, seen in the unit model is only related to the animations of that model. So things like fidgeting with the grenade, hiding it when in melee etc. The projectile effects are not part of the model but their own separate thing which the game engine attaches to the animation when required. And the link between those is in the Horse_Grenadier_md_rangedstrike.kf file. Open that up and scroll down to find NiTextKeyExtraData. In there you'll find this line: Effect:Grenade_Throw_Effect:EFFECT_GRENADE_THROW.

The way to read that is that the game takes the special effect defined in CIV4EffectInfos.xml by the name of EFFECT_GRENADE_THROW and attaches it to the animated node Grenade_Throw_Effect in the NIF file. So you want to change that line in the .kf file to Effect:Grenade_Throw_Effect:NAME_OF_YOUR_DART_EFFECT.

You will also have to either find an existing dart/javelin effect from the main game (I would suggest EFFECT_MALISPEAR which is the throwing spear from the Mali Skirmisher) or make your own to use.

Save your changes to the .kf file and you are all done.
 
It's been a while since I did any units but if I recall correctly this is what you need to understand and do.

The projectile, in this case grenade, seen in the unit model is only related to the animations of that model. So things like fidgeting with the grenade, hiding it when in melee etc. The projectile effects are not part of the model but their own separate thing which the game engine attaches to the animation when required. And the link between those is in the Horse_Grenadier_md_rangedstrike.kf file. Open that up and scroll down to find NiTextKeyExtraData. In there you'll find this line: Effect:Grenade_Throw_Effect:EFFECT_GRENADE_THROW.

The way to read that is that the game takes the special effect defined in CIV4EffectInfos.xml by the name of EFFECT_GRENADE_THROW and attaches it to the animated node Grenade_Throw_Effect in the NIF file. So you want to change that line in the .kf file to Effect:Grenade_Throw_Effect:NAME_OF_YOUR_DART_EFFECT.

You will also have to either find an existing dart/javelin effect from the main game (I would suggest EFFECT_MALISPEAR which is the throwing spear from the Mali Skirmisher) or make your own to use.

Save your changes to the .kf file and you are all done.
Thank you for your reply, I'll try to fix it
 
Did you manage to change the effect to what you need?
Hi PPQ_Purple, sorry for taking so long to get back to you.
I modified the text, but only the grenade disappeared, the Malian javelin did not appear, do I need to copy the Malian animation to this folder?
 
You shouldn't need to change anything. Changing the text inside the .kf file (assuming you are linking to it properly in the XML) should change the projectile animation when firing. But you will only see the changes in game. You won't see them in NIFScope or anything like that.
 
Top Bottom