forums | blogs | polls | tutorials | downloads | rules | help

How to Recharge Weapon Mana?

ChickenGeorge's picture

I made a Flintlock Pirate Gun for Dungeon Siege.
It works. Fires bullets.
And uses DS's Minigun Magic template.
The weapon is assigned mana points.
Every time it fires a mana point is subtracted.
When the mana/ammo runs out, the weapon stops working.
There is an option to have the weapon disappear.
Which I can do.
But why not be able to buy ammo and then have the ammo recharge the weapon?

I already made an ammo object.

I just don't know if or how a weapon's mana can be recharged.

Also of note, in the gas, you can have the mana regenerate.
But that will make sure the weapon never runs out of ammo.
And this weapon needs some drawbacks, or its just cheating to have.
The drawback should be, ammo is not cheap.
And ammo can run out.

The skrit would be a simple one, I just don't know skrit.
The skrit would run when using the ammo item in inventory.
The skirt would search the inventory and remove the ammo object after right click.
I already have that capacity, borrowed from the potions.
Then next step would search the inventory to find this gun.
And remove it.
And then place a new gun right back into the inventory.
A new gun, which is the same gun, but a newly created one,
will have it's mana recharged, because mana comes with this gun already in the gas.

So I guess my question is,
Does any one know of a mod that places an item into the inventory?
Or can remove and replace?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ChickenGeorge's picture
Good advice. Update...

Darkelf wrote:
sounds like you are almost done...was thinking about the sound issue some more...if remember right each weapon has a weapon_base...was thinking that maybe the crossbow base sound was being used cause of it...to be honest probably best to not use a minigun/crossbow base but instead copy them gas templates and make flintlock it's own weapon base....or perhaps first just insert the flintlock sound into flintlock.gas template...also sometimes skrit and effect have but I think it the base sound you are hearing...reading effects u can also change duration they played as well...anyways u got this!!!

That is a good idea.
Since the sounds still playing are crossbow sounds,
just get the items from the high branch templates.
Thank you for the advice.

kathycf wrote:
I'm glad you are making some progress with the gun.

There are a few tutorials on the site that might be helpful for you.

Super Fun Tutorials! Laughing out loud

I found the pcontent one to be good since I tend to be overly cautious when assigning values. I would really like to play the Brittania siegelets but I'm having some weird problems with Dungeon Siege at the moment.

Thank you for the link. Those will be most handy.
I wish I saw them earlier.

My gun has a big problem.
Both U6 and Lazarus share the item and ammo components.
Renaming it doesn't help because I think DS doesn't allow for certain declarations
to occur by more then one skrit.

Just renaming the skrit and nothing else cause the bullet count to stop working.
And Siege editor wouldn't allow it to compile, then disregarded it.
I was also careful to rename the calls in the skrit in further attempts.
But some require the global figure and some don't.
If I use it, it takes priority over the original components.
And they are not the same.
U6 expanded on Lazarus so it may still accommodate it.
But half way through the game, it could crash it.

I might be making a mod that shouldn't be.
Which is a darn shame.
The ammo idea was real cool.
There is a pirate island in the game where you could buy it.
And it makes since to have a bullet count.

UPDATE: Found out that Project Britannia made a compatibility patch for U6 and Lazarus.
http://www.projectbritannia.com/forum/index.php?topic=204.0

About DS mods.
I was thinking maybe since I don't know much about DS,
I could at least make the ART available for use.

I could make the pre-tanked folders with the art and icons,
and namingkey where it needs to be.
Even a dummy template that people can edit proper DS values in.
That way at least I can contribute something to this wonderful site.

I also plan to send you the new all sleeves A1 suit.
But in Gmax I kept overwriting with countless versions.
Frankenstein combinations of the suits.
Wondering what I was doing wrong.
It was the namingkey.
But it was easy enough to make,
And I still have the plate textures for an A1 suit.

I will PM you a link to the ASP when I get it up and going again.

Thank you both for your advice and consideration.

kathycf's picture
I'm glad you are making some

I'm glad you are making some progress with the gun.

ChickenGeorge wrote:
But I have to do some research into DS variables to know how to set the stats of each item. I know nothing about it or how to make them even available to the game.

There are a few tutorials on the site that might be helpful for you.

Super Fun Tutorials! Laughing out loud

I found the pcontent one to be good since I tend to be overly cautious when assigning values. I would really like to play the Brittania siegelets but I'm having some weird problems with Dungeon Siege at the moment.

Darkelf's picture
sounds like you are almost

sounds like you are almost done...was thinking about the sound issue some more...if remember right each weapon has a weapon_base...was thinking that maybe the crossbow base sound was being used cause of it...to be honest probably best to not use a minigun/crossbow base but instead copy them gas templates and make flintlock it's own weapon base....or perhaps first just insert the flintlock sound into flintlock.gas template...also sometimes skrit and effect have but I think it the base sound you are hearing...reading effects u can also change duration they played as well...anyways u got this!!!

ChickenGeorge's picture
Wow thank yous. I got the ammo count working now

Darkelf wrote:
years ago there was a mod named Gungeonsiege, in it was a python..it had many guns and their sounds. just like said below dark and light elves had wands that used mana think something like 30 charges. minigun_lightning does indeed have an effect in global/effects where it plays sound..... sound play s_e_ u will need to name your sound file with s_e_flintlocksoundnameuusehere so game can find the sound file

as far as smoke goes I did search I found a smoke_emitter...thing about effects u can run just part of them..like for lightning gun u wouldn't need all the effects as u are just shooting a bullet..indeed the bullet is the ammo template...whether it appears jit or not not sure...

as far as inventory goes would also have to modify the game ui to show how many bullets which could require much time.

Thank you. I will see if I have, or download the siesgelet here.
I have my sound already. And pointed the gun to it, then the bullet.
It just doesn't want to play.
But I am using PB's modified version of the minigun magic so that might have something to do with it.

I got the gun's ammo and item count working. Finally.
PB's minigun sets the weapon to 999 mana, but then completely ignores it.
The setting needs to be though.
And what actually counts is a variable that is increased as soon as you purchace or pickup the ammo object.

I got everything working.
The gun doesn't show the bullet count until you start attacking something.
It will say zero bullets, even after obtaining the ammo.
But once it starts firing, the gun's bullet amount shows up,
and starts decreasing with each shot.
This item doesn't have to be recharged or replace.
The bullet count will go back up once ammo is purchased.

PB's minigun also has the ammo sit on top of the weapon before it fires. Sad
This is good for a bow or a crossbow.
But for a gun looks stupid.
After the first shot it stops doing that.

I will take a look at that effect. Thank you.
I know how to resize effects, and recolor them too.
Change the duration.
Those are the easy figures to figure out. Tongue

ghastley wrote:
We had a bunch of guns in that mod, and I did some work to provide stances and animations to go with them. You might find some of that useful. It's somewhere in the downloads here. The minigun animation didn't work for pistols, so they had their own.

This page should give you an idea of what's available.

Those are amazing. Wonderful job on the weapons.
I hope to be able to do the same.
Also I did not know you made adjustments to the lance import scripts.
That's very cool.

ghastley's picture
Halloween Special

We had a bunch of guns in that mod, and I did some work to provide stances and animations to go with them. You might find some of that useful. It's somewhere in the downloads here. The minigun animation didn't work for pistols, so they had their own.

This page should give you an idea of what's available.

Darkelf's picture
years ago there was a mod

years ago there was a mod named Gungeonsiege, in it was a python..it had many guns and their sounds.

just like said below dark and light elves had wands that used mana think something like 30 charges. minigun_lightning does indeed have an effect in global/effects where it plays sound.....
sound play s_e_
u will need to name your sound file with s_e_flintlocksoundnameuusehere
so game can find the sound file

as far as smoke goes I did search I found a smoke_emitter...thing about effects u can run just part of them..like for lightning gun u wouldn't need all the effects as u are just shooting a bullet..indeed the bullet is the ammo temlate...whether it appears jit or not not sure...

as far as inventory goes would also have to modify the game ui to show how many bullets which could require much time.

ChickenGeorge's picture
Dark Light Elvs Skrit Clone

Klandank wrote:

In light/dark elf there’s a skrit called equip_joint that clones an item from the content database and then does some equipping/unequipping.

Thank you. I will take a look at it.

I did manage to get PB's Ammo Pool item to function like it does in Ultima6.
But when I fiddled more with it, it stopped working.
And for the life of me I can't figure it out.

There are a lot of dependencies skrit. A lot. Most of the functions won't be used in this siegelet I'm working with.
And some of the files would overwrite same named items.
Careful renaming of files and variables.

I've remade the thing completely from scratch 3 times.
And can't reproduce it.

It did not say the number of bullets under the Flintlock in the inventory, as it would in U6 siegelet.
But showed them being used if I hovered over it in the mini slot icon.
And stopped working when the bullets ran out.

This meant the ammo item was being pooled into the ammo variable.
And being used properly as a bullet count.

Whatever I did to make it work, is now gone.
Lazarus siegelet already had the pool variable for food, reagents, and of course the gold.
And U6 just expanded on it to include crossbow bolts and arrows.
They went on to do throwing knives, flaming oil, throwing axes and lots more weapons.
The whole siegelet is remarkable.

Since I got it to work once, I should keep at it.
It is the best idea for the Flintlock.
I do have the other version that fires one shot and waits for the reload.

The other issue is I can't get the [voice] attack to work.
Either in the FLintlock or the bullet.

An earlier bow I made uses these just fine. And it uses minigunmagic as well.
The only sound it makes is as if firing a crossbow bolt.

But any additional voice setting should override specializes.

Another cool thing to add is a puff of white grey smoke when it fires.
I believe the lightning charge effect can be replaced for this.
And probably will have to customize an existing effect.

The effect would have to be a puff of smoke of some kind.
Like the swamp gas puff.
Or something that smokes when opened or exploded.
Just a brief puff of smoke.

Klandank's picture
Remove and replace

ChickenGeorge wrote:
So I guess my question is, Does any one know of a mod that places an item into the inventory? Or can remove and replace?

In light/dark elf there’s a skrit called equip_joint that clones an item from the content database and then does some equipping/unequipping.

As I recall I messed around with equipping/unequipping (in DSLOA) for a while and found that it was more problematic than it looked. I often wound up with two versions of the same item, and would eventually get an error. Adding a delay between the unequip/delete and the equip seemed to help. I think the game engine wasn’t updating or something. I don’t remember if I ever got the problem 100% solved.

And don’t get me started on trying to equip a character with custom gear on STARTUP! During the retail game NIS cutscene at the start of the game there’s something going on that ALWAYS re-equips the character with his knife, so merely changing the template doesn’t work. So that sent me on a days-long quest to figure out how the *^*(&^*% to overcome this.

1) I tried using skrit to check if the character was equipped with a knife and switch it out on character creation, but the skrit was firing before the game did it’s thing, so that didn’t work.

2) I tried having the skrit fire when the game state entered SP_INGAME, but that didn’t work. Doing some research on the loading process I found out that the game actually enters SP_INGAME for a brief split second before the cutscene, so the skrit was still firing too early.

3) I then changed the skrit to see if the current state was SP_INGAME and that the previous state was SP_NIS.

Finally got the thrice-damnable thing to do what a simple template change SHOULD have done. Angry

Everything's gotta be complicated.

ChickenGeorge's picture
Recharge wait is best suggestion.

kathycf wrote:
Ugh, sorry. I seem to keep posting when I should just hush.

Oh don't be sorry.
All of your tips and suggestions are important and I really need it.
I'm such a novice at Dungeon Siege and still feeling in the dark.
I always look forward to your comments. They are very helpful.

kathycf wrote:
Maybe you could post some of your mods? The long sleeved a1 would be neat to try out also.

Thank you for the interest in my mods. About posting mods here.
Right now I do not know how to make weapons and armor for the original Dungeon Siege.
So far I've only made them for the Ultima V Lazarus Siegelet.
And the gas literally says, "Good Bye Dungeon Siege."
Because it is a complete rework of how weapons work and effect the environment.
Most of the enchantments do not work on PB weapons.
It's simple enough to make my mods work in Dungeon Siege.
But I have to do some research into DS variables to know how to set the stats of each item.
I know nothing about it or how to make them even available to the game.
Also I think I've only played LOA for about 30 minutes.
I passed one of them once. But have forgotten the whole experience.
Once I do some more research in how DS works, I will post them here.

Project Britannia has just a wonderful pool system for ammo.

Basically each ammo object, once picked up, disappears and adds the ammo amount to a global variable.
The interface even displays it under the bow.
How cool is that?

So I copied the skrits and gasses.
And renamed them when needed because Lazarus shares the names and are not the same functions.
It all worked in Lazarus except the number under the flintlock didn't show up.
That’s probably an interface thing anyways, no big deal.

My ammo item did disappear once picked up.
But even though the ammo count is set to 6 or 12 or 24 bullets,
each ammo item only counted as one bullet.
So if I picked up 3 ammo items of 6 bullets each,
In the end I could only fire 3 times.

Now mind you if I put this Flintlock in PB's Ultima 6 siegelet,
it would function just like the bows do.
And work properly exactly how I want it to.
With no renaming anything.
Just would have to make a custom gas for the bullet instead of arrow.
But I don't like that siegelet.
I don't enjoy playing it.
It looks stunning. Visually impressive.
I think superior to Dungeon Siege itself.
The interface is amazing.
Even the parts I really dislike are still amazing accomplishments in DS programming.
There’s not much I can say against it except I don't enjoy playing it.

Going back to the Flintlock.
Right now it works as a crossbow replacement.
I would like to make a new animation for it.
Just holding out and firing it I suppose.

My new bullet isn't showing up. I think... It is small.
It fires the stone rock in weapons misc.
But it is too big an item to count as a bullet.
Minigun magics can fire anything actually.
A tree. Or a wagon. Or a chicken.

bare_elf wrote:
You could always allow the gun to run out of whatever it shoots and then slowly allow it to recharge while using a spell as a back up weapon. (There are many powerful spells that can be recharged with mana potions.) I would think the gun should be equipped to recharge and not just in inventory. You could set how long the gun takes to recharge to like 5 minutes. Then people would say "is the weapon's power worth the risk of having to wait for it to recharge."

Elf

kathycf wrote:
In Witness' Dark/Light elf mod she featured weapons similar to the lightning gun (spell casting gauntlets and wands) except those weapons had a limited number of charges and when you ran out, you had to wait for the weapon to replenish itself which took awhile. Maybe when your gun completely runs out of ammo it could regenerate at a much slower rate and thus wouldn't be overpowered. The player just needs to deal with the risk/benefit of using the gun...It's powerful but one has to also consider the penalizing aspect of the slow mana regen.

I think I will go with your recharge wait option.
It should fire only one bullet then.
Just as the real pirates, who couldn't stop in a battle to reload.
They just pulled out their swords.
So fire one shot and would have to wait a while.
Maybe even until the battle is over.
That makes the most sense.
Thank you both for clearing that up.

I would really like to know how to replace an item in the inventory with another item.
I have lots of items I would like to have this ability that are not weapons but function by right clicking on.
Or simply place a new item in the inventory.
The code I have I can not figure out how to get it to work.

        		actor$.Inventory.RSCreateAddItem(IL_MAIN, "flintlock");
        		myFlintlock$ = actor$.Inventory.GetItemFromTemplate("flintlock");

bare_elf's picture
Maybe recharge like this

You could always allow the gun to run out of whatever it shoots and then slowly allow it to recharge while using a spell as a back up weapon. (There are many powerful spells that can be recharged with mana potions.) I would think the gun should be equipped to recharge and not just in inventory. You could set how long the gun takes to recharge to like 5 minutes. Then people would say "is the weapon's power worth the risk of having to wait for it to recharge."

Elf

kathycf's picture
I like that

I like the gun, Chicken George. Maybe you could post some of your mods? The long sleeved a1 would be neat to try out also.

In Witness' Dark/Light elf mod she featured weapons similar to the lightning gun (spell casting gauntlets and wands) except those weapons had a limited number of charges and when you ran out, you had to wait for the weapon to replenish itself which took awhile. Maybe when your gun completely runs out of ammo it could regenerate at a much slower rate and thus wouldn't be overpowered. The player just needs to deal with the risk/benefit of using the gun...It's powerful but one has to also consider the penalizing aspect of the slow mana regen.

Ugh, sorry. I seem to keep posting when I should just hush.