[SCR][TC/AP] TCAN - Menudriven Full Auto Naming plugin v0.99.9

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

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

Thanks Orfevs. Looking forward to 1.0.
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

Sorry, I went ahead of myself. v1.0 will be a major update, so I'll release a bugfixed and optimized version first.

Planned v0.7 Highlights
  • No unimplemented "previews" or black menu entries.
  • No useless code or "structure constants" in place of numbers.
  • No debug information or extended comments aside from "init" and "update"
  • Bugfixed
  • Optimized
I'm presently testing and cleaning the code and it should be out very soon. If there are issues that needs resolving, aside from the known bugs, please let me know.

I assume TCAN can be translated to German without much trouble. I'm uncertain about other languages. If someone wish to step up, then please do. The main issue is the use of "The" and "of" as optional parameters, as well as prefix and suffix vs main name sets.

Planned v1.0 Highlights
  • Extended tags. 3 or more letters. 2 Just won't cover what I need.
  • Wide menus where needed.
  • Factory output, intermediary and resource info ( 0-9 )
  • Option to ignore energy cells as dominant cargo in aspect settings.
  • Possibly numbering and/or symbol replacement.
Version 1 will be incompatible from previous versions, but this is not a problem. Uninstalling the former while keeping unique names, then installing the new one while using the set names as unique names will do the trick. Although the aspects will be gone, the autoaspecting feature should restore most ships to their former glory.
Initially, TCAN does absolutely nothing until you set the configuration the way you want it to be and you start it through the Artificial Life.

Now's the time to come with suggestions ;)

UPDATE:
The more I work on TCAN, the more I make fundamental changes - so I'll just skip the lower version and go for gold instead. Longer tags, more functions, wider menus yada yada. Not giving up until all promised features are in place - except for one. "Constant variables" in the source code will remain for the most part.
zernon916
Posts: 11
Joined: Fri, 24. Feb 12, 06:49
x3tc

update?

Post by zernon916 »

I love this script so far, however, I am anxiously awaiting your update to get the numbers working... I would be more than happy to test it for you when you get closer to release ^.^ ... Any ideas when it may be out?

Thanks again for the killer script..
Zernon
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

Shouldn't be long now. I'm in the final phases of converting (all) the scripts to quad tag format. A pre-release will be available when I feel things are functioning properly.

With the pre-release, there are some things that of course need adjusting, and that's mostly the names that come with the namesets, and the default setup for each aspect. Some characters used with the aspects seems to have disappeared when saved. The solution is to just use offsets to the characters. Which I've done with bracketing so far.
I'll be happy to receive bug reports as well, naturally ;)

The one thing missing from the pre-release will be numbering. That's the biggest problem I have at the moment, considering the complexity of implementing 2 separate numbering schemes at the same time, while each one has sub-aspects attached. Once I start, things should be rolling pretty fast though. Then there are idiot errors that I can't see despite being right in front of me. Those are the worst and take the longest to fix since in this case the main problem is the programmer!

I'm afraid to say that unique names, and everything, will be gone with the introduction of the next one. If this is a big issue, then I'll make an altered uninstall procedure to keep unique names. Aspects will be reset however, as I've altered the structure and flag settings considerably.

In any case - the highlights so far:
  • Quad tag format.
  • FAETI format has become FATIQE (Q = quick extract of consonants)
  • Faster menues
  • Wider menues where applicable
  • Symbol replacement
  • All special chars can be used as brackets, and you pick both separately
  • Bugs from the old version happily replaced with new ones! (Shouldn't be any though... :p)
Edit:
Btw - don't worry about numbering. I'm as eager as anyone to use it. I want to actually play the game (TC and AP both) - something I haven't done since I started on this script. So it's not far away.
And I have definite plans on how to implement them :)
The most important thing is that everything works 100% though.

Further plans for pre-release:
  • Selectable prepositions and conjunctions for aspect suffices (per aspect). Meaning 'of' can be replaced with "the,of,of the,with,and,or..." etc.
  • More of prefix,suffix and names
  • At least ONE working numbering scheme.
Also, if there is someone that uses TCAN and is an author of a plugin that can be supported, please PM me. Using the tag for "pilot task", TCAN can extract information to be displayed in the name. For this I need the main task and local/global variables that yields useful info. All supported plugins are listed with their respective authors.
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

For those interested, I can say the project is coming along nicely after redesigning designs and data structures throughout TCAN - several times. And I'm probably not finished with that as new ideas wreak havoc on my existing setup.

I've started on numbering, and have just finished the roman calculator for Latin number representation. Although "finished" is a moot point. I need to test it first. I do that when everything else is in place.

There's a whole lot of improvements over the old version, but most are not visible to the user. The most notable of the hidden improvements should be speed. Naturally, expecting hundreds of ship to suddenly update at once is a bit far fetched if you want to the game to do something other than just name ships. With the notion that getting from a to b while busting up your foes are primary, naming comes at a good third.

So in order to share the pain I've been going through, here's some info on Roman numerals. Enjoy :)
User avatar
RedEclipse
Posts: 1269
Joined: Sat, 11. Sep 04, 16:43
x4

Post by RedEclipse »

Quick technical question to the OP :

What happens is my mod take one shipname, put "SELECT - " in front of it for the next 120 seconds (or so but I don't care exact time) and get back to the original ?

This is not made by an AL pluggin, only something like a [START] script with ship as an argument :

$old = $ship->get name
$new = 'SELECT - ' + $old (with length > 40 check or substring $old 0,40 if length > 40)

$ship->set name $new
count = 120
while count >0
dec count
wait 1000ms
end
$ship->set name $old
return null


That was made in order to find my selected ships in the r menu. I tried colors with no succes.
"AaaAaaAah ! They're everywhere...", Jane Doe, Freedom Force.
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

Funny that.. I never check the length of the ship name..

If you run TCAN along with a script that renames objects, it's inevitable the name will change since TCAN updates at regular intervals.
The default is set to minimum 20 seconds.

[edit]
You must understand that I don't use any data from the object names, except during initial naming. Everything is in arrays or local variables - and when update is due, the name is set based on said arrays and variables. Not the object name.
[/edit]

There are many ways:
  • The annoying way - Remove any dynamic variables from the aspect belonging to your object.
  • For the purpose of testing, you can set the AL to off or "hotkey only". There won't be any updates in that state.
  • The middle way - use the local variable "orf.tcan.unique.name" and alter that. (that variable will be gone with the next release though). It's the /un tag, so "SELECT" won't come up in front unless you place the tag there yourself (in the aspect).
  • The intended way - Add a unique identifier string to the array found in the local variable "orf.tcan.reserved.plugin.array". Remove the entry when done. If the array doesn't exists, you can create it and add to the variable. This is the intended way of removing objects from the eyes of TCAN. Although, I'm not so sure it will work as intended. V062 got a few bugs, and I think that's one of them..

    I'll make a script you can call to take an object away from TCAN temporarily for version 1.
Otherwise, as long as TCAN runs, you cannot normally "SELECT" the player ship. TCAN gives that special attention. Although, it shouldn't update until you actually change ships. Seems one of the bugs is that the player ship won't update like the rest. So I guess it's safe for now..
User avatar
RedEclipse
Posts: 1269
Joined: Sat, 11. Sep 04, 16:43
x4

Post by RedEclipse »

Orfevs wrote:Funny that.. I never check the length of the ship name..
I verifiecd yesterday, they make 50 char long. I don't know if color tags counts, I would say yes by... guessings, at least in some obscure parts of the old MSCI engine. I don't like very much automatic truncated strings, I prefer to do it myself :)
Orfevs wrote:If you run TCAN along with a script that renames objects, it's inevitable the name will change since TCAN updates at regular intervals.
The default is set to minimum 20 seconds.
That's what I though... So I guess too bad I won't be compatible with all the renaming script around. I could avoid ship renaming by being able to use the r menu from script but it's not possible so I need renaming.
Orfevs wrote:I'll make a script you can call to take an object away from TCAN temporarily for version 1.
If I can call it (via a START so it don't block) to desactivate the called ship and re-active it after that would be the best solution I think but for now, don't pay to much attention on that, I even not released a pre-pre-pre alpha - coffe-kamikaze edition :) (very soon by the time I have 1 or 2 full hours on it, just need to en-translate, clean and package things).

My mod is seen very very simple, but it's not : it implied a lot more than I though and could be very very wide.
I wanted that renaming feature aswell but since some guys specialized in renaming and made awesome work, I'll try to be compatible with most. Same for equiping ship more or less automaticly but maybe there I'll doo that myself.
With the "no cheating" contraint, I'm trying to remove the tedious/longest things to do in X3AP interface so it free the player 's time for actually playing and enjoying moving fleets with other excellent mods and stuff so...

Maybe the guys like us that aimed that +/- debuging gamedesign goal should join and release a bigger thing ?
"AaaAaaAah ! They're everywhere...", Jane Doe, Freedom Force.
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

RedEclipse wrote: I verifiecd yesterday, they make 50 char long. I don't know if color tags counts, I would say yes by... guessings, at least in some obscure parts of the old MSCI engine. I don't like very much automatic truncated strings, I prefer to do it myself :)
Color tags count. They're 2 characters long with escape code in octal format (\033) + color identifier character, then additional 2 with terminator (\033X).
RedEclipse wrote:
Orfevs wrote:If you run TCAN along with a script that renames objects, it's inevitable the name will change since TCAN updates at regular intervals.
The default is set to minimum 20 seconds.
That's what I though... So I guess too bad I won't be compatible with all the renaming script around. I could avoid ship renaming by being able to use the r menu from script but it's not possible so I need renaming.

I take measure to make it compatible since there are plugins that desire to rename ships on their own. Hence the local variable for other plugins to interact with TCAN, and internal compatibility to add support for released plugins. Although, only a few are supported as of yet, being the ones I use the most myself.
RedEclipse wrote:
Orfevs wrote:I'll make a script you can call to take an object away from TCAN temporarily for version 1.
If I can call it (via a START so it don't block) to desactivate the called ship and re-active it after that would be the best solution I think but for now, don't pay to much attention on that, I even not released a pre-pre-pre alpha - coffe-kamikaze edition :) (very soon by the time I have 1 or 2 full hours on it, just need to en-translate, clean and package things).
The script will probably just use the variable I mentioned though, and no return value is really required for that. You could still use START.
The chance that the particular object (ship/station/satellite/lasertower.. whatever) is undergoing updates at that time is small, but it's there. To be on the safe side, waiting for a return would be best. The wait time would be less than a second anyhow.
RedEclipse wrote: My mod is seen very very simple, but it's not : it implied a lot more than I though and could be very very wide.
I wanted that renaming feature aswell but since some guys specialized in renaming and made awesome work, I'll try to be compatible with most. Same for equiping ship more or less automaticly but maybe there I'll doo that myself.
With the "no cheating" contraint, I'm trying to remove the tedious/longest things to do in X3AP interface so it free the player 's time for actually playing and enjoying moving fleets with other excellent mods and stuff so...
If you use a menu for this, then you don't actually need to put "select" on anything in the object list. Instead put the entire object name in the info section.
That does give me an idea though. I can add a custom "external" prefix (local variable) to objects that anyone can add externally. Using this could then disregard all tags other than the unique name (and/or number ) to ensure the whole name is displayed. So I'll add that to the removal script - like this:

Code: Select all

START $null-> call script "plugin.tcan.reserve.object" : Object=$object, Prefix="SELECT" KeepTags=[FALSE]

while not $done
   ... do your stuff here
end
START $null-> call script "plugin.tcan.release.object" : Object=$object
RedEclipse wrote: Maybe the guys like us that aimed that +/- debuging gamedesign goal should join and release a bigger thing ?
I got a feeling that would be difficult.. there are a few released libraries people could use, but with plugins being very specific about what they're doing, I'm unsure whether or not those libraries would be used. I might be reinventing the wheel with some of the TCAN support routines, but I wouldn't have to count on external libraries outside my control. My debug libraries are public domain as far as I'm concerned though. Perhaps I should release them separately..
User avatar
RedEclipse
Posts: 1269
Joined: Sat, 11. Sep 04, 16:43
x4

Post by RedEclipse »

I really wish I had more time to mod. I'm buying a 90% burned house atm + working 12 hours a day so I have very few time on modding. :(

You could put prefix but I think you shouldn't, you should only register/deregister property objects. That way you'd be compatible with any other renaming script that does the same job as you, if they implement register/deregister scripts aswell.

I'm releasing tonigth I think, I allready manage to think multiscreen/multiuse before because I want to put more stuff in that (I made a fonctional analysis before modding that way I know where I go) :)
"AaaAaaAah ! They're everywhere...", Jane Doe, Freedom Force.
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

Already made the scripts where you reserve and release an object.
Prefix and "Strip" included. You supply the plugin name as identifier (or any other identifier string for that sake. plugin names are at least guaranteed unique..). Prefix does not supply space, so that's the job of the coder. Strip removes all name data except the unique name.
There's no checking the length though.

The release script can release one or all using the plugin name of the calling script and optional object.
And I incorporated a few checks so far - enough that the objects won't update. But that's not enough. I will remove them from listings as well to make it completely "invisible" from TCAN.

Once I have the numbering system in place, this will all be reality.
(My numbering concept didn't hold up, so I suffered a little setback there. But all support routines are at least done. Numbering across aspects cause more problems and confusion that needed. I use aspects for a reason, so that's where the numbering will be..)

Like a freight train I can't stop easily once I speed up. It's not that I got limitless time to mod.. I just put everything else on hold :p

Good luck with your house!
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Pre release is out! v099

Post by Orfevs »

And there it is. Took a while, but I think v0.99 is working as it should.
This is a pre release, so there's still unfinished business.

Please note that this is NOT compatible with v0.62. So you MUST uninstall the former version. This is due to cataclysmic changes in most main arrays, the aspects and in particular the quad tag format.

Sorry about that, but there was no upgrading possible.


Latest release is 0.99.5

- Orf
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

There has been changes in the aspects from point 4 to point 5.

To utilize these changes use the import entry in nameloader menu if you replace the files. In which case it's advised you download the zip rather than SPK. On install (update won't work with the pre-release), the aspect will be read anyway. No need to import then.

With the introduction of numbering, I've gone through the relevant tags and made sure they work as intended. Currently, the only numbering schemes that work are "by aspect" and "by attach". The others are present in the list but will not serve a function.

Notable Changes
  • Personal TS uses unique name (the rest of the "personal" ships don't have a unique name tag and name generation is turned off.)
  • TS ships in general use HB number + Ship Aspect name + Number with unique name fallback
  • Mobile Bases use ship aspect name + local number with unique name fallback
  • Factories and hubs uses aspect name + local number
  • More aspects now use the "installed equipment" tag. Use the symbol menu to add equipment to the list.
All ships have either local or homebase sector (using FATIQE format) in their names. Depending on their numbering setup.
In my case I use an armada of miners and gatherers attached to an M1Aran that inherits the homebase number and sector of their attachment, the M1. Additionally there are freighters with the purpose of selling off or transporting the ore.
I'm proud to say the autoaspecting were dead on in all cases but personal vessels. They're hard to categorize, but not impossible. It *will* be done.

Most numbered ships use local numbering with attach.
Military aspects still need lots of work.

Questions?
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

My commitment to updates depends on whether anyone use this or not.
Since I haven't heard anything, I'll simply keep adding/modifying features for my own benefit.
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

No. Please keep up the good work orfevs. I just realized you updated it.
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

Yosh!

For now it seems stable aside from the lacking features.

Immediate Plans in priority order:
  • Add remaining numbering schemes.
  • Wing handling. May get special aspects.
  • Make "include wings with aspect" a global option rather than individual aspect option.
  • More weight on military matters. So far it's been the peaceful exploration/mining part.
  • Add more tags / fix faulty ones. Any requests?
  • Remove/replace wacked up/too long names in namesets
  • Tweak aspects/namesets for less freaky names.
    ANY suggestions here are most welcome!
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

Wow orfevs. This has really come a long way. Im changing to this from RSWE.

Keep it up!
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

I have to head to work so I dont have time to mess with this yet but does the NPC naming work? Ive been wanting this...
Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs »

Yes. It works.

You have to turn it on through the Main Config -> Maintenance Menu first.
Then use the NameShooter to name the NPC after targeting it.

You cannot mass name them, nor use any tags. If that's a requested option I might look into it, but I can only deal with radical changes after version 1.

If I should incorporate tags it would be a one shot thing only with no updates.
Even if the thought of adding a TTL timer is appealing, my signal handling sucks.
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

Yes a mass NPC naming option would be awesome for sure. I can totally understand if its a hassle to have an NPC autonaming function though. In the meantime ill use Fillipi's AI shipnames script for that. His script is great but its a little limited as far as options is concerned.

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