[SCR] Ring of Fire - Stealth Lasertowers (v2.31 - 29.11.09)

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

Post Reply
Rikaelus
Posts: 223
Joined: Tue, 29. Nov 05, 04:03
x3

Post by Rikaelus » Sat, 2. Jun 18, 08:58

Just FYI, that latest fix (for XRM) also fixed stealth towers not decloaking to attack Yaki in my Xtended modded TC game.

-Wolfie-
Posts: 3
Joined: Sat, 28. Aug 21, 03:27

Post by -Wolfie- » Thu, 7. Apr 22, 22:49

Does anyone still have the XRM fix?

FTLasteroid
Posts: 2
Joined: Sun, 25. Oct 20, 06:13

Re:

Post by FTLasteroid » Sat, 22. Apr 23, 18:09

Triscopic wrote:
Mon, 10. Mar 14, 00:30
Just an addendum to the excellent work done by Chaos Master in fixing this script...
Chaos Master wrote:It eludes me why I didn't write which file to change :roll:

it's plugin.ring.of.fire.stealth

in lines 67 and 68 you have
$flag = [Find.Enemy] | [Find.ForceUsePos]
$hostiles = find ship: sector=$sector class or type=Moveable Ship race=null flags=$flag refobj=[THIS] maxdist=$sensor.range maxnum=1 refpos=$scan.position

after those two lines you add:

...*snip*...

and yes, you change the version number to 232 in all the plugin.ring.of.fire.--- scripts, and the setup.ring.of.fire one

if you're new to scripting it's gonna take you a while to find all those commands (can't just type em, have to select them from a convoluted list of commands)

If you don't get it to work, pm me again tomorrow and I can (somehow) send you the changed files.
Don't really have time today ...

A slightly more all-encompassing fix is this:

Code: Select all

    $flag = [Find.Enemy] | [Find.ForceUsePos]
    $hostiles = find ship: sector=$sector class or type=Moveable Ship 

* New code here to fix enemy race detection
    $flag = [Find.ForceUsePos]
    $index = size of array $check.race.arr
    while $index > 0
      dec $index =
      $check.race = $check.race.arr [ $index ]
      if $hostiles == null
        $rel = [PLAYERSHIP] -> get relation to race $check.race
        if $rel == Foe
          $hostiles = find ship: sector=$sector class or type=Moveable Ship race=$check.race flags=$flag refobj=[THIS] maxdist=$sensor.range maxnum=1 refpos=$scan.position
        end
      end
    end
This uses the pre-existing race array, looping through all the races to see which ones the player's current ship currently has set to "Foe" and explicitly checking for them. This means you can easily set your towers to kill Pirates, or Paranids, or Argon, etc - just set your own race relationship to Foe and your turrets will immediately start attacking them.

Note 1: All of the necessary lines of code can be copied from the same script - just browser down a few pages and you'll find all of them, so minimal scripting is required.

Note 2: It is very important to note all the files need their versions updated just as Chaos Master mentions.

Note 3: When you load a save game the towers will automatically update their script versions (they'll all decloak briefly and betty will tell you they've been updated).

Hope this helps someone.
I'm a newbie in this filed,and I don't know how to use it,could u tell or teach me how to use it?

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

Re: [SCR] Ring of Fire - Stealth Lasertowers (v2.31 - 29.11.09)

Post by alexalsp » Sat, 22. Apr 23, 22:51

But I don’t understand one thing, if you fixed something, then why not immediately give a ready-made corrected script .... :gruebel:

Post Reply

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