[Question] Remapping stock commands

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
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

[Question] Remapping stock commands

Post by Litcube »

I'm not a fan at how some of the new built in scripts were implemented, especially the explorer software's satellite deployment bug.

Can I remap the global script key COMMAND_DEPLOY_SATELLITE to a new script? I can't seem to get it working, as every attempt seems to result in the command only running the previous, default script.

Redacted for tutorial purposes, for those searching for the same help:

If the original command is assigned to the ship type "Moveable Ship", for example, then your override also needs to be assigned to ship type "Moveable Ship". I.E. assigning the key to ship type "Ship" would not work.

If this method fails, mapping the command using non-group ship types such as "M4" or "TL" seem to override the command just fine.

Also, there are some built in scripts that are assigned to a command by using preload commands., which are not mapped by the usual global key. These preloaded commands are mapped to scripts that launch BEFORE the global map key is launched, for the purposes of gathering user information such as menu data. The code author is expected to RETURN the gathered data from these scripts as an argument array to the actual global command called.
Last edited by Litcube on Tue, 28. Oct 08, 02:22, edited 2 times in total.
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

It works.
Just assign the new script to the same command.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Yeah!
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Actually, I've exhausted all options, I can't seem to override it.

Would you be so kind as to spit out the "global script map: set: key=" code line that worked for you?
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

Look at this script.
It does exactly that.

http://www.hentschke-keramik.de/rmh/fly ... h-gate.zip

It overrides the Explorer software Fly Through Gate with a version that works with terran gates as well.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Thanks Gazz.

Apparently, the override needs to be of the exact same ship type as the original.

For those searching for the same help:

If the original command is assigned to "Moveable Ship" then your override also needs to be "Moveable Ship". I.E. "Ship" would not work.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I encountered similar problems in X3R as well. When ever you run an overriding map, you can't use groups of ..object classes, you would have to specify each group...

eg.
If you did. Map all ships xxx to this
Then map all fighters xxxxx to this,

It would ignore the second one. Instead you would have to
a)
Map all fighters,
Map all ships

or b) (Sometimes this way is faster)
Map all ships
Map fighter1, map fighter2, etc.


So in order of priority:
1) the last individually selected ship has the highest mapping priority
2) Then the FIRST select run object class
(And then nothing else)

I've found no way around it. I.e. Mapping all, then making all ignore the map, then trying to map another group, will NOT work
Last edited by s9ilent on Fri, 24. Oct 08, 00:46, edited 3 times in total.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Yup. It was actually your post that I learned from. ;)
jlehtone
Posts: 22500
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

@Litcube: Could you edit the detailed instructions into your OP, please? (I already added a link into "Tutorials", as IMO snippets like this are worth collecting.)
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

@jlehtone:

Done. See if it's too your liking. I'm at work, so I'm lacking proper terms for the exact commands in the script editor. If you feel the need to edit, please do so to your heart's content.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Preloaded command maps to scripts appear to run on Task 17 which is causing me all sorts of troubles.

Anyone know how to *unload* these preloaded keys?
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Not sure why you would want to, but maybe you could create a script that only has 'return null' in it. Then run that script on task 17. Confused as to what you're up to though?
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Preloaded command maps to scripts appear to run on Task 17. Whic is not what I want to do.

Certain commands that come with X3TC are "pre-loaded" in some scripts. For example, the deploy satellites command. This command runs on task 17. This is undesirable.

I want to know how to unload the loaded key, and apply my own. I figure it's not possible, but we'll see what the gods say.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22432
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

what is the problem with preloads running on task 17 ?

u shouldn't be using those tasks in any scripts you create so theres no problem with it overrighting existing tasks


also note, that althou the preload runs on 17, the main script runs on the main task, preloads are just for the duration of the selection menu.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Uhm.. as my comment was posted Oct 2008, I don't remember. :) Browsing old threads, Cycrow?
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22432
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

catching up with some of the older tutorial threads that have gone unanswered ;)

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