[AL Plugin] Remove Prefix "Your" from Player Property

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

User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse » Sun, 21. Dec 08, 19:04

the remove-Your script is constantly at war with SEWN which forces satellites to be named Your Advanced Satellite [SEWN]
Irrational factors are clearly at work.

tamtam77
Posts: 31
Joined: Fri, 17. Apr 09, 09:21

Post by tamtam77 » Wed, 13. May 09, 16:36

usefull script. I use it with commercial agent 2.5 and in IN HUB menu list of Fabrics is still 'Yours' (.

frijazz
Posts: 63
Joined: Fri, 31. Mar 06, 21:52
x3tc

Post by frijazz » Thu, 14. May 09, 10:13

I was about to say the same. Finally my financial situation is so healthy that I've started building complexes to supply the universe. I noticed that the prefix *your* automatically is added to the stations when joining them in the complex.

User avatar
Khensu
Posts: 110
Joined: Wed, 28. Oct 09, 09:42
x3tc

Post by Khensu » Wed, 4. Nov 09, 10:52

cant dl the custom nameing version :(

can u host it to another site?

unrockable
Posts: 25
Joined: Wed, 18. Feb 04, 18:58
x4

Post by unrockable » Sun, 8. Nov 09, 01:59

I tried to change the script to my needs, but i somehow don`t get it to work. Can anybody help me? (Probably something wrong with the "if $ship == Class/Object"-conditions.)

Code: Select all

001   $plugin.data = get global variable: name=$plugin.ID
002   if not $plugin.data
003   |$plugin.data =  array alloc: size=2
004   |set global variable: name=$plugin.ID value=$plugin.data
005   |$plugin.data[0] = 0
006   |$plugin.data[1] = [TRUE]
007   end
008   if $plugin.event == 'init' OR $plugin.event == 'reinit'
009   |al engine: set plugin $plugin.ID description to 'Auto-Rename Player Property'
010   |$timer = 60
011   |al engine: set plugin $plugin.ID timer interval to $timer s
012   else if $plugin.event == 'isenabled'
013   |$retvar = $plugin.data[1]
014   |return $retvar
015   else if $plugin.event == 'start'
016   |$plugin.data[1] = [TRUE]
017   else if $plugin.event == 'stop'
018   |$plugin.data[1] = [FALSE]
019   else if $plugin.event == 'timer'
020   |if $plugin.data[1]
021   ||$ship.array =  get ship array: of race Player class/type=Schiff
022   ||$n =  size of array $ship.array
023   ||while $n
024   |||dec $n = 
025   |||$ship = $ship.array[$n]
026   |||$name = $ship -> get name
027   |||$sub =  get substring of $name offset=0 length=3
028   |||if $sub == 'Ihr'
029   ||||$sub1 =  get substring of $name offset=4 length=99
030   ||||if $ship == TL
031   |||||$newname = 'TL' + ' ' + $sub1
032   |||||$ship -> set name to $newname
033   ||||else if $ship == M1
034   |||||$newname = 'M1' + ' ' + $sub1
035   |||||$ship -> set name to $newname
036   ||||else if $ship == M2
037   |||||$newname = 'M2' + ' ' + $sub1
038   |||||$ship -> set name to $newname
039   ||||else if $ship == M3
040   |||||$newname = 'M3' + ' ' + $sub1
041   |||||$ship -> set name to $newname
042   ||||else if $ship == M4
043   |||||$newname = 'M4' + ' ' + $sub1
044   |||||$ship -> set name to $newname
045   ||||else if $ship == M5
046   |||||$newname = 'M5' + ' ' + $sub1
047   |||||$ship -> set name to $newname
048   ||||else if $ship == M6
049   |||||$newname = 'M6' + ' ' + $sub1
050   |||||$ship -> set name to $newname
051   ||||else if $ship == M7
052   |||||$newname = 'M7' + ' ' + $sub1
053   |||||$ship -> set name to $newname
054   ||||else if $ship == M8
055   |||||$newname = 'M8' + ' ' + $sub1
056   |||||$ship -> set name to $newname
057   ||||else if $ship == TS
058   |||||$newname = 'TS' + ' ' + $sub1
059   |||||$ship -> set name to $newname
060   ||||else if $ship == TP
061   |||||$newname = 'TP' + ' ' + $sub1
062   |||||$ship -> set name to $newname
063   ||||else if $ship == TM
064   |||||$newname = 'TM' + ' ' + $sub1
065   |||||$ship -> set name to $newname
066   ||||else if $ship == Schiff
067   |||||$newname = $sub1
068   |||||$ship -> set name to $newname
069   ||||end
070   |||end
071   ||end
072   ||$station.array =  get station array: of race Player class/type=Station
073   ||$n =  size of array $station.array
074   ||while $n
075   |||dec $n = 
076   |||$station = $station.array[$n]
077   |||$name = $station -> get name
078   |||$sub =  get substring of $name offset=0 length=3
079   |||if $sub == 'Ihr'
080   ||||$sub1 =  get substring of $name offset=4 length=99
081   ||||$station -> set name to $sub1
082   |||end
083   ||end
084   |end
085   end
086   return null

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked » Sun, 8. Nov 09, 02:10

after

025 |||$ship = $ship.array[$n]

add:

$ship.class = $ship -> get object class

then replace your faulty tests like:

if $ship = TL

by

if $ship.class = TL
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station

unrockable
Posts: 25
Joined: Wed, 18. Feb 04, 18:58
x4

Post by unrockable » Sun, 8. Nov 09, 08:24

Thanks it works now.

User avatar
Peanutcat
Posts: 297
Joined: Fri, 8. Jul 11, 23:56
x4

Post by Peanutcat » Sat, 24. Dec 11, 20:11

Could you make it so it Automaticly puts something else in front.. I want it to say GRI(My Company in X3, Short for Genuru Research Incorporation) instead of Your

EDIT

Noticed someone made this on the first page.. Any1 have that file? The links are broken

Yet another edit

Albion Prelude compatible?
F signature

ptb_ptb
Posts: 142
Joined: Wed, 5. Sep 12, 18:56

Post by ptb_ptb » Sat, 10. Nov 12, 17:40

Peanutcat wrote:Albion Prelude compatible?
According to this thread
http://forum.egosoft.de/viewtopic.php?t=315630&start=0
yes.

(Sorry for the necro, but I think it's best if the last post in the thread is positive).


Post Reply

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