[SCR] Ring of Fire - Stealth Lasertowers (v2.31 - 29.11.09)
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 2
- Joined: Sun, 25. Oct 20, 06:13
Re:
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?Triscopic wrote: ↑Mon, 10. Mar 14, 00:30Just 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
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:
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.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
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.
Re: [SCR] Ring of Fire - Stealth Lasertowers (v2.31 - 29.11.09)
But I don’t understand one thing, if you fixed something, then why not immediately give a ready-made corrected script ....