[SCR] AI Ammo Cheat + DMG Mitigation (v1.08 - 17.12.11)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

[SCR] AI Ammo Cheat + DMG Mitigation (v1.08 - 17.12.11)

Post by Gazz » Tue, 2. Jun 09, 20:04

English / Deutsch

This script is not compatible with X3: Albion Prelude.


AI Ammo Cheat + Damage Mitigation
  • AI Ammo Cheat
    ...because it's silly when the enemy stops shooting back.

    AI ships do not have any kind of supply system and frankly - I don't think anyone wants a full blown supply network with AI fleet tenders flying criss-cross around the universe, supplying thousands of ships for about 16 races.

    So let's cheat!

    This is an AL Plugin but there is no background task, no universe-wide scan to check all ships regularly.
    Well, there is a background task while a ship is being supplied but that one is extremely low profile and short lived.
    Everything is signal driven. If a ship never gets in a fight during it's lifetime, it is never touched.
    It doesn't need ammunition if it doesn't fight and this script is never run...

    The ALP does nothing beyond providing a switch to turn the whole thing on/off.


    Ships are not supplied with missiles.
  • Damage Mitigation

    Basically this is armour. For shields and hull.

    This is an optional Setting of the AL Plugin.

    Both AI and playerships are affected.

    It works IS as well as OOS.

    Heavy fighting ships are expected to take damage. Therefore they have more efficient shield generators and better armor.
    this applies to M2, M7, and M6.

    Any ship with hangars is a carrier.
    These are faster ships which are not intended to take damage but run away.
    Carriers do not have damage mitigation.

    Damage mitigation means that ships take less damage.
    • M2
      Shield Damage - 33 %
      Hull Damage - 66 %
    • M7
      Shield Damage - 16 %
      Hull Damage - 32 %
    • M6
      Shield Damage - 10 %
      Hull Damage - 20 %
    This does not affect shield regeneration at all. Only damage taken.

    If the shields are down it takes as long as before until they have fully recharged.

    If an M1 is hit for 50000 points of shield damage then an M2 would have been hit for 33500 and an M7 Tiger for 42000.
    An M7 Panther would have been hit for 50000.

    As with the Ammo Cheat, this script never runs unless a ship gets into a fight.
[ external image ]Download: ZIP
Last edited by Gazz on Sat, 17. Dec 11, 15:16, edited 17 times in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 2. Jun 09, 20:04

** reserved **
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

thunderai
Posts: 374
Joined: Fri, 17. Apr 09, 04:40
x3tc

Post by thunderai » Tue, 2. Jun 09, 20:06

I always thought there was a massive trade system in place. Why else are orders for 6,000 rimes stopping at my EQ?

Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 » Tue, 2. Jun 09, 20:11

AI ships can run out of Ammo? 0.o

Very good idea then. The TC AI definetly needs some backup from good scripters like you ;)

If NPC ships do not get supplied with ammo, what does GOD do with all the Ammo the AI freighters buy (if they buy it) ?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 2. Jun 09, 20:14

thunderai wrote:I always thought there was a massive trade system in place.
Not exactly.
It is a system created to supply the player with credits.
Big difference.

That's why factories buy at high prices but sell low. The only reason for that madness is that the player is now able to buy low and sell high.
All these factories and docks in the game serve no purpose whatsoever - to AI races.
They only exist for the player to trade, gain credits, and buy equipment for his ships.

Why else are orders for 6,000 rimes stopping at my EQ?
Because the free trader sees "Rimes" at an acceptable price.
So it buys it.

Then it tries to sell it somewhere.
Maybe it can, maybe not. Most likely it's getting destroyed by pirates or in a xenon sector while flying criss cross around the universe trying to sell an impossible to sell cargo of 6000 rimes.

That's also why space fuel sells.
Traders buy it. If they can ever sell it is completely irrelevant.
More traders will surely spawn.

Cronos988 wrote:If NPC ships do not get supplied with ammo, what does GOD do with all the Ammo the AI freighters buy (if they buy it) ?
Cart it around until the freighter can either sell it or the ship is destroyed.
Either way, more can be bought.


The ideal location for selling is when the only station that would buy your goods is on the other side of a Xenon sector.
Traders buy your goods, get destroyed, more traders spawn to buy your goods.
If the (theoretically) buying station is an AI factory, it's prices stay high because it is never actually receiving the cargo. So it can lure even more traders into the Xenon sector.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

thunderai
Posts: 374
Joined: Fri, 17. Apr 09, 04:40
x3tc

Post by thunderai » Tue, 2. Jun 09, 20:41

And then you go in a mop the place up and cappure all the wrecks.

Honestly, I thought GOD had some big plan where traders actually did something and didn't just 'exist'. Are you saying the meaning of life is pointless....that hurts man.

I wonder if you could mod the game so traders actually did something and i'd wonder if the game would come to a crashing hault because no goods are getting anywhere. No spacedocks with ships, no weapons, nothing would exisit.

Judging from your other mods, I am certain you have the skillz to rebuild the economy from the ground up and make it run without cheating.

Treelor
Posts: 314
Joined: Mon, 5. May 08, 01:25
x4

Post by Treelor » Tue, 2. Jun 09, 20:48

The freetrader behavior explains why I can't find any sort of weaponry half the time.

There ought to be traders that sell to EQ docks, as well - for a surplus military shop, they sure don't have a whole lot.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 2. Jun 09, 21:05

thunderai wrote:Honestly, I thought GOD had some big plan where traders actually did something and didn't just 'exist'. Are you saying the meaning of life is pointless....that hurts man.
Heheheh.
Don't ask a scripter how the game works. You won't very much like many of the answers. =)

thunderai wrote:Judging from your other mods, I am certain you have the skillz to rebuild the economy from the ground up and make it run without cheating.
You're calling to the wrong god here.
Take your sacrifices to Lucike's temple. =P

I think in Reunion he experimented with unleashing his traders upon the universe, replacing the AI traders.
As a result, trade opportunities for the player became nonexistant.

Be careful what you wish for because you might get it.


PS: as a side effect this might also fix one of the bugs with OOS combat, where one laser without ammo nullifies the whole ship's damage.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Tue, 2. Jun 09, 22:29

Excellent...

Would it be too much to ask for a similar script for m7m/m8 resupply purposes?

thunderai
Posts: 374
Joined: Fri, 17. Apr 09, 04:40
x3tc

Post by thunderai » Tue, 2. Jun 09, 22:37

Gazz wrote:
thunderai wrote:Honestly, I thought GOD had some big plan where traders actually did something and didn't just 'exist'. Are you saying the meaning of life is pointless....that hurts man.
Heheheh.
Don't ask a scripter how the game works. You won't very much like many of the answers. =)

thunderai wrote:Judging from your other mods, I am certain you have the skillz to rebuild the economy from the ground up and make it run without cheating.
You're calling to the wrong god here.
Take your sacrifices to Lucike's temple. =P

I think in Reunion he experimented with unleashing his traders upon the universe, replacing the AI traders.
As a result, trade opportunities for the player became nonexistant.

Be careful what you wish for because you might get it.


PS: as a side effect this might also fix one of the bugs with OOS combat, where one laser without ammo nullifies the whole ship's damage.
An entire Universe of ESTs. Now that would be interesting, and fully functional one would think. To add, more realistic, in no way should I be able to build a fleet of warships in less than 4 days of in game time.

What does GOD need with a starship - anyway i guess. I had expected the game to be rubberbanded with scripts, but I had hoped it was with a purpose and the AI ment something. I may as well load up a fleet of ESTs of my own and start fixing this broken game and make money at it in the process.

Does anything in the script library mention if the AI will stop spawning traders if I take over the universe?

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Tue, 2. Jun 09, 22:41

ai spawning is actually done through jobs..
but from what i understand, if you use a sector takeover script, jobs no longer recognizes that sector as 'race', so it doesnt spawn stuff there.
That requires you to take over nearly the entire universe though.

thunderai
Posts: 374
Joined: Fri, 17. Apr 09, 04:40
x3tc

Post by thunderai » Tue, 2. Jun 09, 22:58

Lancefighter wrote:ai spawning is actually done through jobs..
but from what i understand, if you use a sector takeover script, jobs no longer recognizes that sector as 'race', so it doesnt spawn stuff there.
That requires you to take over nearly the entire universe though.
Which would defeat the purpose, because in order to take over the sector you would have to destroy everything in it.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Tue, 2. Jun 09, 23:51

thunderai wrote:
Lancefighter wrote:ai spawning is actually done through jobs..
but from what i understand, if you use a sector takeover script, jobs no longer recognizes that sector as 'race', so it doesnt spawn stuff there.
That requires you to take over nearly the entire universe though.
Which would defeat the purpose, because in order to take over the sector you would have to destroy everything in it.
there is enough time between spawns of buildings to plop your own trading station and call it your own...
or just write your own script that makes it slightly easyer.
Up to you

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Wed, 3. Jun 09, 00:46

When do they get supplied with ammo ?

If they get an automatic resupply in the middle of a battle, then thats making things a lot harder. They SHOULD be able to run out in a battle, same as the player can.

But resupply when there is no target in the sector, is fine.

That being said though, if the ammo is on the other side of the universe, how exactly do they get their resupply and why is it ok for the npc's to get it automatically and the player have to move either the ship or the ammo to the ship ?

My way of looking at it is if the pirate chooses a gun with ammo, then that is potentially restricting the fire rate of that ship to the ammo on hand. It should not be automatically resupplied in any way other than the player has to go through, and when the universe has no supply of the ammo, the gun shouldnt be able to fire. That doesnt mean that it cannot be simulated by adding the ammo to pirate bases, letting the npc supply chain keep them topped up, and changing the job for the pirate ship to dock at nearest pirate station and get ammo, between battles.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Wed, 3. Jun 09, 00:55

Judging from the files in the download (specifically, signal attacked scripts), I assume it is done as combat starts...

I personally have no problem with this - its a gazz script designed to make battles useful. After all, ive seen xenon ships with gauss cannons spawn with 2 or 3 crates of ammo.. Useless.

However it is, as stated, a npc cheat. Use it, or dont... If you dont, feel free to write your own script instead..

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Wed, 3. Jun 09, 01:01

Well beyond my scripting ability.

All I'm saying is that the game is hard enough, so giving the enemy ships an advantage over the player isnt a good idea, imo. But I dont mind plugging a hole with something realistic.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Wed, 3. Jun 09, 03:02

Bringing an m2 with full racks of gauss cannons and... a grand total of 3 crates of ammo is NOT something the player would do.
It should spawn them with at least 5 boxes per gun.... (1000 salvoes or so)

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Wed, 3. Jun 09, 03:09

If the player cannot find the ammo, then sure they would. :D

They may not necessarily have an alternative gun available either until they find a steady ammo supply.

I have a number of 'salvaged' ships fitted out with salvaged guns, where the ship has no ammo for them. Until I find enough guns to fit them out properly, they get what is findable. If the gun cant fire, thats just a problem to be sorted at some point.

If those ships find themselves in major combat, they are going to be at a huge disadvantage in not having a decent gun loadout, but thats a player decision. Ideally, you dont allow them into combat, but shit happens.

Whos to say pirates dont make bad decisions ? :D

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Wed, 3. Jun 09, 04:09

apricotslice wrote:When do they get supplied with ammo ?

If they get an automatic resupply in the middle of a battle, then thats making things a lot harder. They SHOULD be able to run out in a battle, same as the player can.
Nah.
The player would bring 50 crates of EBC ammo for an M7. The AI spawns with 1 or 2. Or none at all.

Ships do use ammo OOS so all the bigger race ships you meet have long run out of ammo.

The ammo cheat runs IS as well because I wanted it to be simple and some ships just don't have the cargo space for a workable supply of gauss ammo. Ammunition seems to be an optional extra.
The AI spawns whole fleets out of thin air - and that's IS...
So a little ammo is hardly going to break the game.

apricotslice wrote:Well beyond my scripting ability.
*shrug*
A script will be as complicated as you like.
The problem with this one was that I insisted on making it signal driven. That reduces the overhead to a minimum because it only ever checks the few ships that actually get into a fight and not thousands of ships that never do.
Alas, this particular signal is buggy so I had to invent a wholly new signal handler... but other than that it was pretty simple. =)
Last edited by Gazz on Wed, 3. Jun 09, 04:15, edited 1 time in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Wed, 3. Jun 09, 04:10

first of all, this is xenon...

Second of all, its a frakking xenon invasion mission! WHy would xenon invade a sector with NO AMMO?!

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”