Reset Aggression on Laser Towers
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Reset Aggression on Laser Towers
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'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
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
- X2-Illuminatus
- Moderator (Deutsch)
- Posts: 24961
- Joined: Sun, 2. Apr 06, 16:38
Re: Reset Aggression on Laser Towers
"<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!
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!
Re: Reset Aggression on Laser Towers
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
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
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
Re: Reset Aggression on Laser Towers
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
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
Re: Reset Aggression on Laser Towers
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.
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
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
- X2-Illuminatus
- Moderator (Deutsch)
- Posts: 24961
- Joined: Sun, 2. Apr 06, 16:38
Re: Reset Aggression on Laser Towers
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!
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!
Re: Reset Aggression on Laser Towers
Thank you, thank you, thank you. I knew there was a better way as the script was inviting me to select a vessel twice.X2-Illuminatus wrote: ↑Wed, 4. Nov 20, 18:30Alternatively use the constant [THIS] which always refers to the object the script is running on.
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
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
Re: Reset Aggression on Laser Towers
although
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?
Code: Select all
[THIS]->set relation against [PLAYERSHIP] to Neutral
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
Gamer Girl since 1981 Mistress of Heavy Landings since 1984 (BBC-B Elite)
Corei7 7700, 16GB Ram, MSI RX6700XT, Sidewinder FFB2, Kubuntu 22.04
- Khaakbuster
- Posts: 393
- Joined: Sun, 8. Jan 06, 18:43
Re: Reset Aggression on Laser Towers
You can use this. It should work with all station and ship types alike.
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...
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