[Solved] Deactivating Weapons?

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

iforgotmysocks
Posts: 1245
Joined: Fri, 8. Nov 13, 22:35
x4

[Solved] Deactivating Weapons?

Post by iforgotmysocks »

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.
Last edited by iforgotmysocks on Sun, 19. Jan 14, 16:17, edited 1 time in total.
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

maybe one of these would do the trick?

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"/>
or removing it completely (unitl you manually install it again via script?

Code: Select all

<upgrade_object_by_macro object="player.primaryship" macro="" exact="0"/>
iforgotmysocks
Posts: 1245
Joined: Fri, 8. Nov 13, 22:35
x4

Post by iforgotmysocks »

Nope, equiping it under the secondary slot doesn't work. :/
And removing it completly is not even close to what i'm looking for.

Thanks for the suggestions.
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

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
iforgotmysocks
Posts: 1245
Joined: Fri, 8. Nov 13, 22:35
x4

Post by iforgotmysocks »

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. :s Depending on what mods are installed, this wouldn't even be possible mostly.

Edit:
Solved it.
User avatar
Ikaruga
Posts: 376
Joined: Fri, 30. Jan 04, 14:26
x4

Post by Ikaruga »

Just out of curiosity, how did you do that ?
If brute force doesn't solve your problems, then you aren't using enough
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

I'd like to know also :)
iforgotmysocks
Posts: 1245
Joined: Fri, 8. Nov 13, 22:35
x4

Post by iforgotmysocks »

Well, i used some pretty dirty method once i realized that there is no official way to do that yet. So i switched the working macro with a broken one.
docwho83
Posts: 168
Joined: Mon, 15. Jun 09, 23:10
x4

Post by docwho83 »

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
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals
iforgotmysocks
Posts: 1245
Joined: Fri, 8. Nov 13, 22:35
x4

Post by iforgotmysocks »

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
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.

If i have some spare time i'll check what might still be missing.

Return to “X Rebirth - Scripts and Modding”