[MOD]Ambidexterity Module (Shield Module Branch)

Show off your mod creations or just a work in progress.
Post Reply
l3lessed
Posts: 621
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Pushed fixed scripts and df mod file.

Removed particle system and fixed bow equip issues.

Should be in a stable state again.
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

Legendoflight44
Posts: 9
Joined: Tue Oct 20, 2020 3:55 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by Legendoflight44 »

Yay so this should almost be ready now for a 27 stable version aside from

Parry animation shows slight artwork clipping for certain weapons. This is a result of the devs never expecting the artwork to move on screen. I'll fix this through some offsetting or an updated parry animation.

Bug

l3lessed
Posts: 621
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Yes. Believe any mod/game breaking bugs have been hammered out.

The code still sloppier than it can be and there are pieces of unfinished feature attempts straggling around in the script files, but there shouldn't be any bugs that produce null errors and bring the mod and FPS Weapons to a halt.

Thanks everyone for all the playtesting. I hope you enjoy this, and it gives Daggerfall a new feel and playability.

I'll continue work on fancy additional features from my old Combat Overhaul Project and getting in a particle system for combat effects, like sparks.

Also, I'll get up a nexus page with patches and documentation, especially for modders.
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
TheLacus
Posts: 1275
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by TheLacus »

l3lessed wrote: Tue Oct 20, 2020 11:05 pm Thanks for all the information. You're always amazing with it.

The error is directly on the getasset line, so it is not finding the prefab for some reason. I know I'm just being short sighting and overlooking something about the compile process.

Should the prefab be in any specific director before compiling the mod? I have tried it in the resource/prefab folder and in the folder where the mod script files are.

I also believe it is missing, because is shows none in the object window in the editor script object. And, it doesn't show anywhere in the scene or scene directory search.

But, it seems to be compiling it. Also the particle system, it shows as a component of the prefab.

And, it doesn't seem to be nested. The prefab has the gameobject in it with the particle system component attached to it. I created the prefab directly from a particle system object.
Let's make sure you did all the following:
  • Created a prefab named "Spark_Particles". The location is not important, but it must be somewhere inside Assets (for example Assets/Game/Mods/Ambidexterity Module/Spark_Particles).
  • Added the prefab to the list of assets (Add Selected Asset button in Mod Builder).
  • Clicked save button and/or build button in Mod Builder.
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

l3lessed
Posts: 621
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

I named the prefabbed particle system "Spark_Particles"; the file is "Spark_Particles.prefab".

I am putting the prefab in the asset/prefab directory, like explained for models in documentation. This works, as the material is automatically pulled into the mod build assets, as explained in the asset injection documentation. So, the mod builder shows both the prefab and the emissions material for the particle system. I click save, then build, and it seems to build without any issue.

then, I create a blank gameobject to hold the prefab within the script.

Code: Select all

public GameObject ParticleSystemGo;
Then I try to load the compiled prefab to the blank gameobject and use a ToString() to check if the object filled with anything, like so:

Code: Select all

            ParticleSystemGo = mod.GetAsset<GameObject>("Spark_Particles");
            Debug.Log(ParticleSystemGo.ToString());
I also tried it like so:

Code: Select all

            var ParticleSystemGo = mod.GetAsset<GameObject>("Spark_Particles");
            Debug.Log(ParticleSystemGo.ToString());
Do we need to include the directory path in the name, starting as the asset directory as the base?

Do i need to do anything with the LoadAsset objects?
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

Legendoflight44
Posts: 9
Joined: Tue Oct 20, 2020 3:55 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by Legendoflight44 »

The prefab should be automatically added and that should let you build it without any errors from reading the model prefab extensively so you probably don't need to set a directory and I don't see anything that you need with loadasset

(not sure if I am correct but from reading TheLacus's model prefab and checking your own code this should be right)

You could also try asking from the discord users as well for this if you need to

l3lessed
Posts: 621
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Thanks for the feedback. I'll hit them up over there.

Could I be initated the mod wrong? The getasset object says it loads the assetbundle for you. Is there anything special that needs to be done when initiating the mod to ensure the asset bundle gets pulled in with it.
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

Legendoflight44
Posts: 9
Joined: Tue Oct 20, 2020 3:55 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by Legendoflight44 »

here's the link btw

http://discord.gg/HXMrKU6

Legendoflight44
Posts: 9
Joined: Tue Oct 20, 2020 3:55 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by Legendoflight44 »

ok so after extensive testing this specific code
this one
ParticleSystemGo = mod.GetAsset<GameObject>("Spark_Particles");
Debug.Log(ParticleSystemGo.ToString());

likes to work after right here

//converts string key setting into valid unity keycode. Ensures mouse and keyboard inputs work properly.
offHandKeyCode = (KeyCode)Enum.Parse(typeof(KeyCode), offHandKeyString);
ParticleSystemGo = mod.GetAsset<GameObject>("Spark_Particles");
Debug.Log(ParticleSystemGo.ToString());
OffHandFPSWeapon.WeaponType = WeaponTypes.Melee;
OffHandFPSWeapon.MetalType = MetalTypes.None;
AltFPSWeapon.WeaponType = WeaponTypes.Melee;
AltFPSWeapon.MetalType = MetalTypes.None;

anywhere else the mod does not like loading the off-hand then again this is the non patched one so yours could be different

also I put your public GameObject ParticleSystemGo;
near this text not that I think it matters

//particle system empty objects.
public ParticleSystem system;
public GameObject ParticleSystemGo;
static Texture2D particleTex;
public Light lightPrefab;
private Gradient gradient = new Gradient();
ParticleSystem SparkParticles;

imsobadatnicknames
Posts: 259
Joined: Sun Jun 02, 2019 4:28 pm
Location: Colombia

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by imsobadatnicknames »

I feel like I should have mentioned this a while ago but I think I forgot. Any plans on tweaking the way this mod handles bows when you have the "Equip bows in left hand only" setting activated?
Bows are normally equipped as a two-handed weapon, but the DFU launcher offers an option to make them equippable as one-handed. Without Ambidexterity Mod, this setting was a huge convenience to me, because it meant that I could have a bow equipped, and quickly use the "switch hand" key to switch to a melee weapon when I ran out of arrows without having to open my inventory. However, since I started playingwith Ambidexterity Mod I had to deactivate this setting bcause it looks like you're wielding your bow and your seconary weapon at the same time and whil it makes sense because it' consistent with the way this mod handles other one-handed weapons, it just looks really odd. Maybe you could make it so that when you have one-handed bows activated, the mod makes an exception for them and handles them like vanilla one-handed weapons (meaning that you have to use H to switch between one weapon and the other instead of having both of the at the same time)
Idk if I explained that properly, English isn't my first language and there are some days when I just find it harder to express myself clearly.
Released mods: https://www.nexusmods.com/users/5141135 ... files&BH=0
Daggerfall isn't the only ridiculously intrincate fantasy world simulator with the initials DF that I make mods for: http://www.bay12forums.com/smf/index.php?topic=177071.0

Post Reply