RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Customizable WeaponAbilities

weapon abilities are not intigers

might want to do them not as flags, but as regular variables being writen/read

and to the constructor
WeaponAbility PrimaryAbility = WeaponAbility.InfectiousStrike;
is wrong - try this:
PrimaryAbility = WeaponAbility.InfectiousStrike;
 

Miller.

Wanderer
Lord_Greywolf;785991 said:
might want to do them not as flags, but as regular variables being writen/read
Can you give me an example of how to get that done? I've read the sticky and other posts on serialization and I can't figure it out. I would think that since it's not an integer or a number field, that it's a string field. However, the errors I keep getting seem to say otherwise. (can't implicitly convert string to Server.Items.WeaponAbilities.etc or something like that) So "writer.Write(m_Primary);" isn't working.

(By the way, I commented out the "public virtual WeaponAbility PrimaryAbility{ get{ return null; } }" in the Virtuals region and added in "private WeaponAbility m_Primary;" to the Var declarations region of baseweapon.cs. I can't remember if I relayed that in my posts above or not.)
 
that works for setting up the properties in base weapon (just do secondary also lol - if you didn't do it all ready)

as for how to serialize that variable, that i am not for certain on
i know for sure you will have to make the WeaponAbility table public
then sould be able to convert it to intigers

write
(int)WeaponAbility
read
primary = (WeaponAbility)readint
repeat for 2nd

should do it

might want to do this in the script support section, so more people read and answer to it
 

Jeff

Lord
Lord_Greywolf;786037 said:
that works for setting up the properties in base weapon (just do secondary also lol - if you didn't do it all ready)

as for how to serialize that variable, that i am not for certain on
i know for sure you will have to make the WeaponAbility table public
then sould be able to convert it to intigers

write
(int)WeaponAbility
read
primary = (WeaponAbility)readint
repeat for 2nd

should do it

might want to do this in the script support section, so more people read and answer to it

WeaponAbility is not an enum.
 

x2man

Sorceror
This is a few months old but Lord_Greywolf has always been super helpful, so I'll give it a shot. Any ways I'm converting this on my test server trying to use it for a live server eventually. Any one have a clue has to why the gump would only show 3 of the 5 skills? The only thing I changed from the orginal work showed here is forth to fourth and I changed the skill references. Ie 160 = 120 140 = 115 130= 110 I did that in all cases in these scripts and it loads up fine but the gump only shows 3 skills. Not sure why. Any possilbe reasons?
 

Gargouille

Sorceror
Hi, have you try a from.SendMessage(abilities.ToString()); in the gump constructor ? In order to know if your problem is checking the abilities or diplaying it ?
 
is your base skill to those numbers high enough? - it is set up to use base skill and not value
so you need to use a power scroll and raise the skills up to see them then
 

x2man

Sorceror
Gargouille first thanks for the response. When I added this to the gumps scripts I get the number 3 on screen. Is that what is suppose to happen? If so, what does this indicate. Thanks again.

I presume the 3 means its reading 3 abilities, my question then would be is it the 3 on the weapon or 3 that the character is suppose to have due to skill. I have placed 5 abilities on this test weapon in its cs as follows:

public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.DoubleStrike; } }
public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ArmorIgnore; } }
public override WeaponAbility ThirdAbility{ get{ return WeaponAbility.ParalyzingBlow; } }//NEW
public virtual WeaponAbility FourthAbility{ get{ return WeaponAbility.BleedAttack; } }//NEW
public virtual WeaponAbility FifthAbility{ get{ return WeaponAbility.WhirlwindAttack; } }//NEW

As long is this is correct then perhaps somewhere its not registering my skill level or even through I've checked like 10x maybe there is somewhere I missed adjusting the skills?

Lord_Greywolf the base skill is high enough on the character I am testing with. My test server actually is a copy of our live server and the character there has used the correct powerscrolls. So, he has 120 base skill before adding jewels or anything.

ps sorry the above code is not wrapped with a code tag, I edited this post and added it and couldn't find the option for code when editing a post.
 

x2man

Sorceror
Sorry guys I think I may have found my problem, going to test as soon as I can.

Code:
public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.DoubleStrike; } }
public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ArmorIgnore; } }
public override WeaponAbility ThirdAbility{ get{ return WeaponAbility.ParalyzingBlow; } }//NEW
public [COLOR="Red"]virtual [/COLOR]WeaponAbility FourthAbility{ get{ return WeaponAbility.BleedAttack; } }//NEW
public [COLOR="red"]virtual [/COLOR]WeaponAbility FifthAbility{ get{ return WeaponAbility.WhirlwindAttack; } }//NEW

those words in red are wrong from my weapon so that is most likely why I'm not reading the final two skills. Sorry guys, I kept checking all the new scripts, baseweapon.cs, and ability.cs to try to find my problem when it looks like it could have been in the weapon, I messed up the scripting there.
 

x2man

Sorceror
Thank you so much for your time Gargouille and Lord_Greywolf, my problems are fixed. It was my error in the weapon I was using.

Thanks also Gargouille for this work and post. Now I'm ready to start looking at Lord_Greywolf's custom abilities:D
 

Thilgon

Sorceror
Code:
 + Custom/CustomWeaponAbilities.cs:
    CS0136: Line 109: A local variable named 'Fourth' cannot be declared in this
 scope because it would give a different meaning to 'Fourth', which is already u
sed in a 'parent or current' scope to denote something else
    CS0029: Line 109: Cannot implicitly convert type 'Server.Items.WeaponAbility
' to 'int'
    CS0019: Line 120: Operator '==' cannot be applied to operands of type 'int'
and 'Server.Items.WeaponAbility'

uhm maybe i'm getting something wrong, but i installed this last .cs you updated, and followed the steps (changing meanwhile forth to fourth in distro edits)...
how do i fix this? ^^

almost forgotten: trying this on an RC2
 

Miller.

Wanderer
Gargouille, testing this further I'm finding that I can't get the abilities other than primary and secondary to fire off. I've installed this on a fresh SVN and it works fine. I brought it over to my shard-in-progress and it only works for abilities 1 and 2. I'm using the XML Sockets system and I have Mondain's Legacy installed on the shard-in-progress. Those are the only other edits to BaseWeapon.cs that I've made.

EDIT: Nevermind, I got it. When transferring over to my shard-in-progress, I forgot to make a couple edits to WeaponAbility.cs. Done, and fixed. Thanks again for sparking this, by the way. It's an awesome addition to any custom shard.
 

Leviathon316

Sorceror
x2man;792075 said:
Thank you so much for your time Gargouille and Lord_Greywolf, my problems are fixed. It was my error in the weapon I was using.

Thanks also Gargouille for this work and post. Now I'm ready to start looking at Lord_Greywolf's custom abilities:D

Hey guys, i'm coming into this a bit late but i have a question for x2man. I am havin the same issue with only displaying 3 attacks. If you dont mind my asking what was wrong with your test weapon? whatever was affecting you is probably where my issue lies and would be a huge help in getting past that hurtle.

Thanks

PS Gargouille this is an awesome script and M'Lord_Greywolf your abilites are a fantasic addition Thanks to you both for a job well done

--Lev
 

PitHelvit

Sorceror
Wasn't there another thread regarding this script?

Anyways, I'll post my thanks here again
This script is a life saver =) Finally I can put all those wonderful SE and ML weapons to good use

Great job you guys!
 
Top