[Script] Friendly Pirates v4.01 (upd: 05/08/06)

The place to discuss scripting and game modifications for X³: Reunion.

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

B-O'F
Posts: 719
Joined: Sat, 21. Feb 04, 03:15
x3tc

Post by B-O'F » Thu, 19. Jan 06, 21:34

Hi TycHouse,

Just tried the new script, no problem with ST and UT now, haven't checked if the pirates like me - will have to try and kill a few....

Thanks for your work, we have all learned something with this error - that is the sole purpose of errors, to learn from them. Having made a lot in my time, and still making new errors, I am still learning..

Thanks,
Boron - Ol Fh'art

virgil_182
Posts: 7
Joined: Sun, 15. Jan 06, 05:55
x3

Post by virgil_182 » Fri, 20. Jan 06, 00:07

I have a quick question.

(A really good idea by the way, nice script.)

My question is this. Will the pirates be friendly only to you, the player, or will running this script make your merchant fleets and pilots, ie.. station support / traders, immune to pirate attack as well. I like the idea of being able to trade, and establish relations with the shady pirate underworld with my character but I don't like the idea of the script as a global, player empire, get away from pirates free card. (I just began playing so as of yet my empire consists of myself and my Buster. But I assume that as my fleet grows and becomes more automated my pilots will be subject to the dangers of enemy fleets, and pirates as they ply the trade lanes.)

Thanks again for the script.

Best.

TycHouse
Posts: 486
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by TycHouse » Fri, 20. Jan 06, 01:55

No, the player is a race just like the Argon, Boron etc. It basically tells the pirates that the player 'race' is neutral therefore they will not attack your stations or other ships.
Think of it like this: you are a pirate just like them but it's not possible for you to be of race type 'pirate' therefore this is the next best thing.
If however, you start attcking them then they will start to dislike you more and more and eventually you would be back in the same position as a normal game.
The script was written so that the player could truely be a pirate. You can go out and attack the Argon, Boron etc and make them enemies but as long as you don't attack the pirates you will always have their bases to dock at. Also, with TycPack2 (still writing it !) it will be possible to buy ships (and later maybe stations) from pirate bases thus negating the need to be friendly with normal faction races altogether.

TycHouse
AMD FX-8350 Eight-Core 4.0GHz Processor
ASrock Extreme 3 R2.0 Motherboard
8Gb memory
2 x AMD HD7770 Graphics (Crossfire not enabled)
Windows Vista Ultimate 64bit SP2

banghead
Posts: 145
Joined: Mon, 26. Jul 04, 18:00
x3

Post by banghead » Fri, 20. Jan 06, 07:49

thank you again for updating it :)

TycHouse
Posts: 486
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by TycHouse » Fri, 20. Jan 06, 17:52

Update v3.03
Found another small problem where after saving your game and reloading there would be multiple copies running as a global task, not a huge problem but would degrade performance after multiple saves.

Fixed: setup file now checks whether code has been run before launching script.

Install v3.03 then load game, check global tasks and stop (select correct task and use 'del' key) all but one 'friendly.pirates' task. Then save game, all should now run correctly.
AMD FX-8350 Eight-Core 4.0GHz Processor
ASrock Extreme 3 R2.0 Motherboard
8Gb memory
2 x AMD HD7770 Graphics (Crossfire not enabled)
Windows Vista Ultimate 64bit SP2

TycHouse
Posts: 486
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by TycHouse » Wed, 29. Mar 06, 14:08

now also available in .spk format.

ps, i now run this all the time as it keeps the pirates off me whilst i'm scripting. Seems very stable and very effective :)
AMD FX-8350 Eight-Core 4.0GHz Processor
ASrock Extreme 3 R2.0 Motherboard
8Gb memory
2 x AMD HD7770 Graphics (Crossfire not enabled)
Windows Vista Ultimate 64bit SP2

Trouser Thief
Posts: 27
Joined: Tue, 10. Feb 04, 20:09
x3

Post by Trouser Thief » Wed, 29. Mar 06, 17:42

Nice script, I like being a pirate so I appreciate not having to deal with other pirates as well as law enforcement.

However, would it be possible for you to make a version that starts with them hating you as before but have them like you if you are hated by races? Might seem a bit odd, but in my mind I see it as notoriety; if you are hated by races then other pirates don't attack you out of fear/respect.

TycHouse
Posts: 486
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by TycHouse » Wed, 29. Mar 06, 18:57

i see what you mean, good idea.

I could take the sum of the notoriety of all other faction races and use that to calculate you pirate notoriety. Hmm will have a think about that.
AMD FX-8350 Eight-Core 4.0GHz Processor
ASrock Extreme 3 R2.0 Motherboard
8Gb memory
2 x AMD HD7770 Graphics (Crossfire not enabled)
Windows Vista Ultimate 64bit SP2

Yellowman
Posts: 605
Joined: Mon, 3. May 04, 12:54
x4

Post by Yellowman » Fri, 31. Mar 06, 19:14

well i tried ur script and indeed the pirates are friendly...

No problem u think but now i was tired of being friends and i starded too atack them but then i hear ''u lost recognation etc'' and from every race my rank goes down by 50 too 60 % and that sucks HARD :!:

Can u do something about it or else i have too reinstall my game.

and yes... i have tried too disable the script but it doesnt work.

Tnx Yellowman

TycHouse
Posts: 486
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by TycHouse » Sat, 1. Apr 06, 14:53

That's very strange ! The script has no way to affect the notoriety of other races - only Pirates ! I'll double check however.

If you no longer want to use the script do the following:

delete files setup.friendly.pirates.xml & friendly.pirates.xml from the ..\x3\scripts folder

then load the game and go into the script editor,
on the SE main menu go to Global Tasks,
you should see the task 'friendly.pirates : null'
select it and press the 'delete' key (make sure it's the right one by noting the PID number)
confirm the delete then exit from the SE menu's
now just save your game.

Thanks for the feedback, i'll go take a look and see if i can recreate the problem.
AMD FX-8350 Eight-Core 4.0GHz Processor
ASrock Extreme 3 R2.0 Motherboard
8Gb memory
2 x AMD HD7770 Graphics (Crossfire not enabled)
Windows Vista Ultimate 64bit SP2

Yellowman
Posts: 605
Joined: Mon, 3. May 04, 12:54
x4

Post by Yellowman » Sat, 1. Apr 06, 18:22

All right then tnx for the quick respons :!: :D

It's so strange i attack pirates they become enemy and then after a few shots Split and boron ships start too become enemy...

And now u think ''but yellowman maby u shoot one by accident'' No because it was on the other side of the map.. :?

It is so strange and if u want too know it was in sector Ceo's Doubt when it happend.

And again thanks,

Yellow

Jakesnake5
Posts: 2874
Joined: Fri, 17. Feb 06, 05:55
x4

Post by Jakesnake5 » Sat, 1. Apr 06, 20:17

The pilots of those pirate ships are RACE specific. If they eject and you kill a space suit, you lose faction with the race that suit belonged to.

Might be related, don't know.

Pjotrski
Posts: 11
Joined: Thu, 19. Jan 06, 09:48
x3

Post by Pjotrski » Sun, 2. Apr 06, 10:17

I had a similar problem with this script.
My patrols in Ghinn's Escape sometimes attacked pirates that spawned at the pirate base (I also had a navsat next to it) and those pirates did not turn friendly by the script.
As a result, all over the universe, all other races would see me as a hostile and my entire empire collpased.

TycHouse
Posts: 486
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by TycHouse » Sun, 2. Apr 06, 15:49

If there is a player owned ship within 15km of a pirate then the script will NOT change the status of that pirate. So if you had a nav sat within 15km of the pirate base then when the pirate was spawned it would stay enemy until it moved away from that nav sat. This is necessary because you might choose to attack a pirate and you don't want him to suddenly change status back to friendly mid fight.

As for the rep drop of other races, there is no way this script could cause that. The only thing i can suggest is that (as mentioned above) if the pilot bails he may revert back to his 'true' race and killing him would thus affect that race rep :?

This is a really simple script, there are no hidden details. For those who can follow it i have added some comments, here is the main loop from the script:

Code: Select all

Continuously check notoriety and update relation accordingly
012   while [TRUE]     * main loop

Calculate the correct relation to player
013    $note = get notoriety from race Pirates to race Player
014    $pirate.to.ply = Foe
015    if $note > -1000 AND $note < 1
016     $pirate.to.ply = Neutral
017    else if $note > 0
018     $pirate.to.ply = Friend
019    end

Load the entire Pirate ship array
020    $ship.array =  get ship array: of race Pirates class/type=null
021    $ship.count =  size of array $ship.array

022    while $ship.count     * iterate through every pirate ship
023     dec $ship.count = 
024     $ship = $ship.array[$ship.count]
025     $player = null

if the ship is in space, check for player ships within 15000m
026     if not $ship -> is docked
027      $sector = $ship -> get sector
028      $player =  find ship: sector=$sector class or type=null race=Player flags=[Find.Nearest] refobj=$ship maxdist=15000 maxnum=1 refpos=null
029     end

if there are none then adjust this ships relation
030     skip if $player
031      $ship -> set relation against Player to $pirate.to.ply

allow for interupts ie the rest of the game
032 @   = wait 50 ms

033    end     * get the next pirate ship

034   end     * continue with main loop
Hope that helps :roll:
AMD FX-8350 Eight-Core 4.0GHz Processor
ASrock Extreme 3 R2.0 Motherboard
8Gb memory
2 x AMD HD7770 Graphics (Crossfire not enabled)
Windows Vista Ultimate 64bit SP2

Pjotrski
Posts: 11
Joined: Thu, 19. Jan 06, 09:48
x3

Post by Pjotrski » Sun, 2. Apr 06, 20:41

Thanks, I'll remove the navsat, that should stop my problems.
Great script, love it!

Post Reply

Return to “X³: Reunion - Scripts and Modding”