[Solved] Deactivating Weapons?
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 1245
- Joined: Fri, 8. Nov 13, 22:35
[Solved] Deactivating Weapons?
Hey folks,
i'm working on creating a ammo system for new weapons right now.
Its actually almost finished, some weapons are using ammo, which needs to be bought or found.
But i am missing a little functionality... does anybody know a way to deactivate a weapon?
Just in case somebody would ever run out of ammo. ;x
Right now i'm playing around with upgrading the macro of the weapon to a not functional macro, but it didn't work out yet.
Any other ideas which could lead to a goal?
Thanks,
ifor
Edit:
Solved it.
i'm working on creating a ammo system for new weapons right now.
Its actually almost finished, some weapons are using ammo, which needs to be bought or found.
But i am missing a little functionality... does anybody know a way to deactivate a weapon?
Just in case somebody would ever run out of ammo. ;x
Right now i'm playing around with upgrading the macro of the weapon to a not functional macro, but it didn't work out yet.
Any other ideas which could lead to a goal?
Thanks,
ifor
Edit:
Solved it.
Last edited by iforgotmysocks on Sun, 19. Jan 14, 16:17, edited 1 time in total.
-
- Posts: 158
- Joined: Sun, 20. Jun 04, 03:24
maybe one of these would do the trick?
No tplayed with them, but maybe changing the slot on this...
or removing it completely (unitl you manually install it again via script?
No tplayed with them, but maybe changing the slot on this...
Code: Select all
<equip_weapon object="player.primaryship" macro="macro.xxx" slot="tag.primary_slot"/>
Code: Select all
<upgrade_object_by_macro object="player.primaryship" macro="" exact="0"/>
-
- Posts: 1245
- Joined: Fri, 8. Nov 13, 22:35
-
- Posts: 158
- Joined: Sun, 20. Jun 04, 03:24
Didn't have much time before I replied last -- so the question is exactly what do you mean by deactivate? It still fires after ammunition is spent?
Would a workaround be to use the overheat function? Or maybe set a hull percentage in the gun macro so it becomes inoperable when ammo is depleted. (each bullet fired would need tracked)
Ha! ammo working as a gun repair kit in effect
Just thinking out loud
Would a workaround be to use the overheat function? Or maybe set a hull percentage in the gun macro so it becomes inoperable when ammo is depleted. (each bullet fired would need tracked)
Ha! ammo working as a gun repair kit in effect

Just thinking out loud
-
- Posts: 1245
- Joined: Fri, 8. Nov 13, 22:35
Nah, its okay, some ideas pretty much hit the point. ^^
The weapon should not be able to fire once ammo is depleted.. ^^
Using overheat was one of the first things i tried, but again, overheat values are handled in the macro and i didn't find any way to access those values.
Harming it hp-wise is also not the way i wanna go.
Depending on what mods are installed, this wouldn't even be possible mostly.
Edit:
Solved it.
The weapon should not be able to fire once ammo is depleted.. ^^
Using overheat was one of the first things i tried, but again, overheat values are handled in the macro and i didn't find any way to access those values.
Harming it hp-wise is also not the way i wanna go.

Edit:
Solved it.
-
- Posts: 376
- Joined: Fri, 30. Jan 04, 14:26
-
- Posts: 1245
- Joined: Fri, 8. Nov 13, 22:35
-
- Posts: 168
- Joined: Mon, 15. Jun 09, 23:10
I know you have fix for it but I was looking for something myself. Not sure if this will help you at all.
found these strings in scriptproperties.xml from cat \06\libraries
Code: Select all
<datatype name="weapon" type="destructible">
<property name="ammo.capacity" result="Amount of ammostorage this weapon adds to its destructible" type="integer" />
<property name="ammo.macro" result="Macro of the used ammo" type="macro" />
<property name="ammo.ware" result="Ware that can provide the used ammomacro" type="ware" />
</datatype>
found these strings in scriptproperties.xml from cat \06\libraries
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals
-
- Posts: 1245
- Joined: Fri, 8. Nov 13, 22:35
Ya, but i don't think its worth the time trying to figure out whats missing, how to construct it and how to fill the blanks. Working on something different right now. I'm guessing Ego is going to deliver some ammo weapons soon anyway, and my method pretty much does its job.docwho83 wrote:I know you have fix for it but I was looking for something myself. Not sure if this will help you at all.
Code: Select all
<datatype name="weapon" type="destructible"> <property name="ammo.capacity" result="Amount of ammostorage this weapon adds to its destructible" type="integer" /> <property name="ammo.macro" result="Macro of the used ammo" type="macro" /> <property name="ammo.ware" result="Ware that can provide the used ammomacro" type="ware" /> </datatype>
found these strings in scriptproperties.xml from cat \06\libraries
If i have some spare time i'll check what might still be missing.