Reset Aggression on Laser Towers

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

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

Post Reply
NewtSoup
Posts: 1405
Joined: Wed, 16. Nov 05, 13:33
x4

Reset Aggression on Laser Towers

Post by NewtSoup » Tue, 3. Nov 20, 17:12

Hi there,

I'm delving into some scripting and I'd like a pointer if possible.

I started out on the O'Ren Rock start with the mamba and tanked Boron and Paranid rep. I've built my rep up but a number of laser towers are still hosing down my traders and I that's not the way to treat a friend of Priest Duke.

Now I can destroy the towers in script without a killer set so I don't get blamed - that's easy - 2 lines of code. first one gets player tracking aim. second makes it go boom.

I'd like to have a little more finesse. however. I know full well it's possible to set a hostile ship or factory to non hostile, factories use a hack mission and you pay some cash and it's possible to simply "apologise" to ships for accidental fire. So it must be possible using the scripting engine. I just can't work out what to look at. Can someone point me in the right direction as to what I need to modify on the selected target to make it go blue instead of red?
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)

Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Re: Reset Aggression on Laser Towers

Post by X2-Illuminatus » Tue, 3. Nov 20, 17:39

"<RefObj> set relation against <Value> to <Relation>" in General Object Commands is what you're looking for. <RefObj> has to be the lasertower, <Value> the player (as a race) and Relation either "Friendly" or "Neutral".
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

NewtSoup
Posts: 1405
Joined: Wed, 16. Nov 05, 13:33
x4

Re: Reset Aggression on Laser Towers

Post by NewtSoup » Tue, 3. Nov 20, 17:47

Thank you. I was looking at that command and thought the laser tower was neutral to me - I wrote the value to the player message log.

However it's entirely possible I got my references crossed over and in fact measured the relation of me to the laser tower.

**Edit**

Yep, that was it. I now don't have to pick apart the defences of various sectors that still have hostile laser towers
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)

Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04

NewtSoup
Posts: 1405
Joined: Wed, 16. Nov 05, 13:33
x4

Re: Reset Aggression on Laser Towers

Post by NewtSoup » Tue, 3. Nov 20, 18:11

Also - Using the Script Editor reminds me a bit of basic programming on the Sinclair ZX81 / Spectrum 48k
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)

Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04

NewtSoup
Posts: 1405
Joined: Wed, 16. Nov 05, 13:33
x4

Re: Reset Aggression on Laser Towers

Post by NewtSoup » Wed, 4. Nov 20, 00:57

Just one further question on this matter:

When I run the script I'm offered the opportunity to select a ship, station or other entity from the map.

How would apply my line of script to an object selected when running the script?

** edit - figured it out

add argument "theShip", type "Var\ship" text "makeFriendly"

then I can just select what I want from the map and it's used as an input argument for the script with the reference "theShip" - I'm going to assume the text is so that I can call the script like a function from another script.
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)

Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Re: Reset Aggression on Laser Towers

Post by X2-Illuminatus » Wed, 4. Nov 20, 18:30

Alternatively use the constant [THIS] which always refers to the object the script is running on.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

NewtSoup
Posts: 1405
Joined: Wed, 16. Nov 05, 13:33
x4

Re: Reset Aggression on Laser Towers

Post by NewtSoup » Sat, 7. Nov 20, 13:25

X2-Illuminatus wrote:
Wed, 4. Nov 20, 18:30
Alternatively use the constant [THIS] which always refers to the object the script is running on.
Thank you, thank you, thank you. I knew there was a better way as the script was inviting me to select a vessel twice.
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)

Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04

NewtSoup
Posts: 1405
Joined: Wed, 16. Nov 05, 13:33
x4

Re: Reset Aggression on Laser Towers

Post by NewtSoup » Sat, 7. Nov 20, 13:31

although

Code: Select all


[THIS]->set relation against [PLAYERSHIP] to Neutral

Does't seem to work right now. Is it because I'm out of sector and [PLAYERSHIP] is not currently visible to the laster tower?
I am a rock in the wind, watch how I plummet!
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)

Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04

User avatar
Khaakbuster
Posts: 393
Joined: Sun, 8. Jan 06, 18:43
x3tc

Re: Reset Aggression on Laser Towers

Post by Khaakbuster » Fri, 5. Feb 21, 18:17

You can use this. It should work with all station and ship types alike.

Code: Select all

if not [THIS]-> is of type [Station]
	skip if [THIS]-> is of type [Ship]
		return null
end

[THIS]-> set relation against [Player] to [Neutral]

return null
I used it to make single race ships neutral, who still held a grudge against me from the old days, when I was at rank -3...

Post Reply

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