[Discussion] Generic X3TC S&M questions III

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

Post Reply
User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Fri, 13. May 11, 10:55

eldyranx3 wrote:My goal is to create working Terran Marines.
What is the difference between Terran and Argon Marines, btw.?
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!

Fattyfat
Posts: 186
Joined: Thu, 5. May 11, 04:03

Post by Fattyfat » Fri, 13. May 11, 11:00

s9ilent wrote:You can't.

Why are you trying to disable the script editor, what is the end result you are trying to achieve?
Thank you for the quick reply, the result I'm trying to achieve is hotkey related - I don't want the hotkeys active when in console

edit: I just removed it from the control setup. Still bothered by the extra line in console but this works :)

Devilrat
Posts: 6
Joined: Mon, 18. Oct 10, 16:17
x3tc

Post by Devilrat » Fri, 13. May 11, 14:34

Hopefully someone can help me with a strange problem I'm having with one of my t\ files. I've been working on a custom sector, and I wanted to put a special pirate base there named Pirate Asteroid Base, using Cadius' asteroid base for the model. However, I also wanted to have Betty speak the name when the base is targeted and such, so I went playing around in the 00044.xml and made two new entries under page 17:

Code: Select all

<t id="23252" s="40965049" l="586"/>
<t id="23253" s="40965632" l="584"/>
This separates Betty's spoken bit of "Pirate Base" into "Pirate" and "Base". So, to associate them with text, I added labels for them in my custom t\ file (6980-L044.xml for sake of reference), also under page 17:

Code: Select all

 <t id="23252">Pirate</t>
<t id="23253">Base</t>
And then strung them around the "Asteroid" spoken bit:

Code: Select all

 <t id="23250">{17,23252} {17,3721} {17,23253}(Pirate Asteroid Base)</t>
I created a new dock in my TDocks file for the base and set the name id string from my text file for it, and the name shows up properly in its entry there. However, once I actually go into the game and target the station, Betty speaks the bits as set up, but the base is literally named {17,23252} {17,3721} {17,23253} rather than Pirate Asteroid Base. The name also shows up properly as Pirate Asteroid Base in menus, such as when I use Cycrow's cheats to spawn a new station, but for some reason the name only shows up as a string of numbers when targeted or in the Sector radar screen. I've tried monkeying around with my text file in all sorts of manners, but nothing seems to fix it.

Hopefully this will help illustrate my problem: http://imgur.com/AnrRO.jpg

Anyway, I would greatly appreciate any help. I'm ready to start tearing my hair out.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 13. May 11, 15:26

Was the T-File reloaded? (this converts the numbers into text)
Did you re-create that base?
If the bogus name was literally assigned in game and saved that way, the name stays saved.

In the menu above it was dynamically created from default.
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
eldyranx3
Posts: 2178
Joined: Sat, 14. Jan 06, 21:29
xr

Post by eldyranx3 » Fri, 13. May 11, 17:50

X2-Illuminatus wrote:
eldyranx3 wrote:My goal is to create working Terran Marines.
What is the difference between Terran and Argon Marines, btw.?
Where you purchase them. It's a RP thing. And something I think was overlooked in Vanilla X3TC.

Devilrat
Posts: 6
Joined: Mon, 18. Oct 10, 16:17
x3tc

Post by Devilrat » Fri, 13. May 11, 18:29

Gazz wrote:Was the T-File reloaded? (this converts the numbers into text)
I think this could be the problem, since I'm not really sure if or how to reload the file. I made a setup script to load my text file, and the other entries in it (a few custom ships) load fine, although no numbers are being used in the ship names.

I've been using Custom Game to test my new sector, and I've been starting a brand new game each time rather than save/loading, but the funky name still persists. I even started new with several of the default gamestarts and spawned the base in with Cycrow's cheat scripts, but no luck there either (although it was fun to watch the collective of Argon Prime freak out at the sudden appearance of a huge pirate base).

But in menus to spawn the station (such as the cheat scripts and in the Galaxy Editor) the name loads as it should. It's only in the 'gameplay' areas (like the Sector map and when being targeted) that the numbers show up.

SyncViews
Posts: 58
Joined: Thu, 27. Jan 11, 14:38
x3tc

Post by SyncViews » Fri, 13. May 11, 20:01

HotSake wrote:Is there a command to get the speed of a missile? I see damage, range, and flags, but not speed.
Don't know if your still intrested, but I came across somthing while digging through a standard script today in !lib.get.bestmissile.fortarget

Code: Select all

$miss.speed =  get bullet speed of laser $miss

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Sat, 14. May 11, 05:21

@ Devilrat

I can tell you why you station has t file ref numbers instead of the name, but as i'm not a modder i can't tell you how to fix it. You will need some input from a modder for that.

As you are loading your t file with a script it is not being loaded until 'after' the station has been created. Hence the text for its name is not created until after the station is created.

When things are done via scripts it is important that the objects are created 'before' a script can act upon them (otherwise all sorts of hinky things happen). A 'setup' script is not run until the engine has created every object in the universe first.

This is why modders make text entries and pack them into cat/dat's to have the text loaded before the universe is created.



@ HotSake & SyncViews

I just gave that command a test with all maintype 10 (missile's) wares and it matches the encyclopedia entries for their speed, so it looks good.

I'll add it into the MSCI Reference somewhere (got to figure out a good place that's relevant) as soon as i get a chance.



MarCon

HotSake
Posts: 472
Joined: Sun, 3. Jan 10, 22:15
x3tc

Post by HotSake » Sat, 14. May 11, 05:47

mark_a_condren wrote:@ HotSake & SyncViews

I just gave that command a test with all maintype 10 (missile's) wares and it matches the encyclopedia entries for their speed, so it looks good.

I'll add it into the MSCI Reference somewhere (got to figure out a good place that's relevant) as soon as i get a chance.
Thanks, I can't believe that works! I never would have thought to try that command on a missile ware. I can't believe I missed it when I was examining that library. Well, I'll have my version of the library done soon, and I'll post the code so people can critique.

edit: Also, wouldn't the relevant place be the (currently blank) entry for that MSCI command? Just sayin'...

SyncViews
Posts: 58
Joined: Thu, 27. Jan 11, 14:38
x3tc

Post by SyncViews » Sat, 14. May 11, 12:49

If you put it in the MSCI command people are unlikly to find it (unless there looking for laser bullet speed)...

Are you just rewriting that one file? My quick experiment with it ran into the issue that untill you get into laser range it won't even try to fire a missile more than about once every 10 seconds. Fine for heavier missiles, but with say a rapier targetting an m5 in that 10 seconds between missiles the shields have regened, you need to fire 5 or 6 quickly for it to be worthwhile...

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Sat, 14. May 11, 12:54

eldyranx3 wrote:
X2-Illuminatus wrote:
eldyranx3 wrote:My goal is to create working Terran Marines.
What is the difference between Terran and Argon Marines, btw.?
Where you purchase them. It's a RP thing. And something I think was overlooked in Vanilla X3TC.
Wouldn't it be then possible to just put an Argon military outpost in Terran space and change, as you already mentioned per script (ALP), the marines' race and owner of the outpost to terran?
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!

User avatar
eldyranx3
Posts: 2178
Joined: Sat, 14. Jan 06, 21:29
xr

Post by eldyranx3 » Sat, 14. May 11, 13:08

X2-Illuminatus wrote:Wouldn't it be then possible to just put an Argon military outpost in Terran space and change, as you already mentioned per script (ALP), the marines' race and owner of the outpost to terran?
Thats what my script already does, but if left untouched, the station spawns marines of different races. My AL plugin goes in and changes the names and such to Terran, but when they attempt to board, the voices of the original races come through. Make sense?

How do race marine training barracks only spawn their race marines?

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22232
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Sat, 14. May 11, 16:20

mark_a_condren wrote: When things are done via scripts it is important that the objects are created 'before' a script can act upon them (otherwise all sorts of hinky things happen). A 'setup' script is not run until the engine has created every object in the universe first.

This is why modders make text entries and pack them into cat/dat's to have the text loaded before the universe is created.
there is another way.
setup scripts are run after the universe is created, ie after all the objects are available

however, u can use init. scripts, these are run before the universe creation, so u can use these to load text files and such

just becareful what you try and do in an init script thou

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Sat, 14. May 11, 19:24

HotSake wrote:... wouldn't the relevant place be the (currently blank) entry for that MSCI command? Just sayin'...

SyncViews wrote:If you put it in the MSCI command people are unlikly to find it (unless there looking for laser bullet speed)...


Hopefully i have addressed both of these issues. :)

This command has now been done in the MSCI Reference Forum.

<RetVar> = get bullet speed of laser <Var/Ware>

A note in the commands thread has been made under 'Special Uses' regarding its usefullness with missiles.

Also, a new thread has been created for Commands with alternate uses for this and any other commands that this arises for in the future. That thread has also been linked to the General Information Index.

It's the best solution i could come up with atm.

MarCon

User avatar
eldyranx3
Posts: 2178
Joined: Sat, 14. Jan 06, 21:29
xr

Post by eldyranx3 » Mon, 16. May 11, 07:05

Would this create a buyable terran marine? I figured out how to add them to a TP, but wouldn't this work for a Military Outpost, Military Base, or Marine Training Barracks?

Code: Select all

<condition>
				<check_age value="{player.age}" min="7s"/>
			</condition>
			<action>
				<do_all>
          <create_station name="Terran MO" race="terran" typename="SS_DOCK_A_MILITARY" safety="0">
            <position x="-30km" y="0" z=""/>
            <sector x="13" y="4"/>
            <equipment loadout="default"/>
            <tradables>
              <ware typename="SS_WARE_SOLDIER_2"/>
            </tradables>
          </create_station>
          <create_actor race="terran" subrace="terran" gender="male" face="101" voice="101" object="Terran MO" location="product" price="50000">
            <skills>
              <fighting profile="bell"/>
              <hacking exact="0"/>
              <engineering exact="0"/>
              <mechanical exact="0"/>
            </skills>
          </create_actor>
          <incoming_message popup="0" author="eldyranx3" text="Debug"/>
				</do_all>
			</action>

Demotruk
Posts: 468
Joined: Tue, 1. Aug 06, 21:02
x3tc

Post by Demotruk » Sun, 22. May 11, 12:04

Hi, I made a very small modification to the Local/Galaxy trader main routine to prevent it from buying a jumpdrive. It worked for a while but now that a LT got to level 18, somehow it managed to buy one. When I checked the script, my changes had been reversed and it was back to buying jumpdrives at level 12. Can anyone tell me why my script change would have been reversed? I'm pretty sure I didn't apply any updates, bonus packs or mods in this time.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sun, 22. May 11, 12:30

You may have not unpacked the script files to XML.
Only XML files can be written to. PCK are read only.
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.

Demotruk
Posts: 468
Joined: Tue, 1. Aug 06, 21:02
x3tc

Post by Demotruk » Sun, 22. May 11, 13:51

Ah, thanks. I think I have it sorted now, hopefully my game won't explode after I unpacked, made a tiny change and repacked.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sun, 22. May 11, 14:26

Don't bother repacking.
Just delete the PCK version so there aren't 2 identical scripts.
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.

Demotruk
Posts: 468
Joined: Tue, 1. Aug 06, 21:02
x3tc

Post by Demotruk » Sun, 22. May 11, 14:27

Hmm, it's still reversing the changes. Is there any thread where I can find out how to correctly unpack, modify and repack the script files? The one in the tutorials and resources sticky was only somewhat useful to me.

Post Reply

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