[Discussion] Generic X3TC S&M questions II

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

Darkone8752
Posts: 58
Joined: Tue, 4. May 10, 23:07
x3tc

Post by Darkone8752 »

Yea, quite a bit less stuttery after dropping to medium shaders. Apparently X3 uses over 500 megs of VRAM even without AA... but it seems it only started recently. My current pet theory is that it started with a combination of Improved Boarding's added marine features or something similar, and IR, as it seems I got a sudden spike in overall lagginess when I installed IB in my last game (before switching mods to SRM). In other words, it may be my cards memory, but this wasn't ahppening before, even when looking on similarly massive patrol forces (multiple M1/M2/M7)

Edit: Other info - global scripts was showing multiple copies of Sorenson's EC eliminator, but that might be normal. There were a couple other I can't recall, and am at school on laptop, so I can't check till I get home.

Edit: More question: I know you can't disable script editor, but what about additional debugging information? I would prefer to not see destination of hostile enemies when I look at their info for example...

EDIT Nevermind all that hooplah about Tships, found it out, to the haskell machine!
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

I've forgotten this and it's embarassing...

What's the easiest way to get a simple player boolean input...?

Do you accept this? Yes/No

And then run 2 different things obviously.

I've forgotten whether you need to use menus or not. :wall:
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I dont know about bool, but you can try

<RetVar/IF> <RefObj> -> get user input without sector: type=<Script Reference Type>, title=<Var/String>
<RetVar/IF> <RefObj> -> get user input type=<Script Reference Type>, title=<Var/String>, sector=<Var/Sector>

(I have no idea what the sector does thou....)

(I use it for int's)

But personally I prefer a menu (it is more coloUrful-er)
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

I used the first with a boolean in it... but it needs a reference object. Not usre what the object does with the script and I don't need one so I did my usual job of sticking THIS in there... :roll:

It's from a menu anyway, I just wanted a popup instead of part of the menu. Works anyway.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
Darkone8752
Posts: 58
Joined: Tue, 4. May 10, 23:07
x3tc

Post by Darkone8752 »

Have a question about the mechanics of Beam weapons.
Is the damage you set per shot in bullets applied per second, or over the course of the beam's duration? that is, a 5 second duration bullet with 100 damage, and set to "beam" will do 20 per second for 5 seconds, or 100 per second?
WhoCares01
Posts: 35
Joined: Mon, 22. Mar 10, 21:08
x3tc

Post by WhoCares01 »

I am currently reassigning the weapon types that the ships can use in tships.txt.
Now I wonder whether the AI will be able to use the ships in that new configuration (e.g. a pirate M4 with an Ion Disruptor) or will I have to touch another resource (maybe jobs.txt?) to have the game spawn the new conifgs?! That is in a complete restart, no need to be save compatible.
Worst case I would get a ships spawned with weapons incompatible with its weapon slots :roll:
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

In the Ship Rebalance Mod, paulwheeler was messing around with new default loadouts for ships.
Try there.
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.
WhoCares01
Posts: 35
Joined: Mon, 22. Mar 10, 21:08
x3tc

Post by WhoCares01 »

But there has been done so much more in that mod that it will be very hard to re-engineer which changes have been done for what purpose - especially for a beginner.
And it would be nice to have the answer in the forums :wink:
There is the Job scripts topic referenced in the Tutorials and Resources sticky, but it leaves me even more confused :?
In fact, I think this is the reason for my confusion, as it says there is an "...'add default equipment' script command, but it's hardcoded...". But it seems that exactly that did not work in that case and a change to "jobs.txt" was the solution.

Now I wonder whether all the "standard" jobs like police, recon, military,... will end up in some odd configurations as due to my changes some weapons are no longer supported by the spawned ships...

Edit:
:thumb_up: Thanks to paulwheeler there is an answer to the question :thumb_up:
Q&A in the Ship Rebalance Mod
paulwheeler wrote:
WhoCares01 wrote:A quick question if I wanted to make a little change there myself.

If I reassign the weapon types that the ships can use in tships.txt, will the AI be able to use the ships in that new configuration as well or will I have to touch another resource (jobs.txt?) to have the game spawn the new conifgs?!

Just as an example, if I gave a Boron M5 just Ion Disruptors (which it doesn't have and don't fit in vanilla, too big & too much energy) and removed the standard weapons, would I end up with Boron M5 patrols with some standard weapons in the trunk but no weapons mounted to the gun pods?!

Weapons are set by both TShips and TCockpits. Generally TShips sets whats in the main guns and TCockpits sets whats in the turrets (for most ships...)

AI ships will only spawn what they can mount. So if you took away all weapons except for the IonD they would all spawn with IonDs. However, if the weapon is M cargo size and the shp is only S it won't spawn them.

Jobs does not control which weapons are spawned. It is hard coded into the game and depends on ship/weapon compatibility, order in TLasers, ware size and some other factors.
Last edited by WhoCares01 on Sat, 13. Nov 10, 17:12, edited 1 time in total.
Moizo
Posts: 70
Joined: Thu, 20. May 10, 09:12
xr

Post by Moizo »

Hey

I tried installing Ship rebalance mod + CMOD4 and all their extra's today, started 10 hours ago.

I want to be able to play my savegame from before i tried installing those mods, at this time im unable.

I tried recreating the installation for the savegame to be compatible with it, but it seems no matter what i try, my game will load, then 10-60seconds later freeze with an audioloop or crash during loading. I think the crash is because its a slightly diffirent save in a busy system with a big complex, the audioloop is in the far bottom right unknown sector so thats really empty.

During the recreating of the installation i started it up to check if it worked, often i'd hear "uninstalled uninst uninstauninstalled" but now i don't so i figure it should work now, but it doesn't...

[Edit: also to mention, i installed all but 2 scripts/mods again, just like i had when i saved the game in question, (wing hotkey/hotkey manager still to do) all those scripts seemed like they worked together flawlessly.
EndEdit]

Any advice on how i can salvage my savegame? Any topic/guide out there on it? (searching yields me with pretty much every mod topic:p)




This is just plain weird, installing 2 hotkey scripts made the diffirence aparently... it's working...funky[/b]
cynosure
Posts: 9
Joined: Mon, 7. Jul 08, 19:42

hotkeys and commands

Post by cynosure »

Hi,

I started to make a litle script. It works well if I run it from the current ship through the command panel, but I have a problems if I try to reach it in a different way. If I set a hotkey in the setup script, the [THIS] variable is empty. So how can I give [THIS] or my currently driven ship to the main script through a hotkey call? I tested writing out the serialised object to a message, and I only got a #0. I read about that [THIS] is not present in global scripts, but if I sit in a ship and I push a hotkey, this script runs locally on this ship.

Thanks!

*EDIT*

Its solved, I wrote a little if condition:

Code: Select all

if [THIS]
  $ship = [THIS]
else
  $ship = [PLAYERSHIP]
end
It gives now correct values if I run the command from the ship via hotkay or command, and from an other ship too.
Last edited by cynosure on Sun, 14. Nov 10, 00:00, edited 1 time in total.
Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd »

I remember back in X3 reunion days there was a lib somewhere which allowed interaction with the planets (landing, trade, etc). Has X changed too much for this to be any useful or is there still some hope?
Fantasy is the impossible made probable. Science fiction is the improbable made possible.
cynosure
Posts: 9
Joined: Mon, 7. Jul 08, 19:42

Post by cynosure »

Can I put this command to a "thread" or something similar to the background?

Code: Select all

  START $ship->command {COMMAND_FOLLOW} : arg1=$target, arg2=null, arg3=null, arg4=null
This command never exits, so it hangs up my script. I want to follow my target while the script finishes its job, but it needs the target to be in 2Km.

The AP starts well, and my ship follows my target, but nothing happens if I stop AP manually too...

The whole code:

Code: Select all

if $range > $tbrange
  $text = sprintf: pageid=$page.id textid=201, null, null, null, null, null
  display subtitle text: text=$text duration=2500 ms
  START $ship->command {COMMAND_FOLLOW} : arg1=$target, arg2=null, arg3=null, arg4=null
  while 1
    $range = get distance between $ship and $target
    if $range < $tbrange
      break
    end
    = wait 1000 ms
  end
end
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Re: hotkeys and commands

Post by Gazz »

cynosure wrote:

Code: Select all

if [THIS]
  $ship = [THIS]
else
  $ship = [PLAYERSHIP]
end
It gives now correct values if I run the command from the ship via hotkay or command, and from an other ship too.
You should use

if [THIS] is object class (ship)
and
if [THIS] exist

instead because hotkey scripts can sometimes get gibberish values that are "not nothing" but are not existing objects.

cynosure wrote:Can I put this command to a "thread" or something similar to the background?

START $ship->command {COMMAND_FOLLOW} : arg1=$target, arg2=null, arg3=null, arg4=null
Movement instructions will only work on task 0 of a ship.

You can run the "break condition" on another task, though.
Like start the watcher script on task 3456456, then execute the (unstoppable) follow command.

When the break condition is fulfilled, the watcher script interrupts task 0 with a priority 1000 script that does nothing but

[THIS] -> follow [THIS] with timeout 1ms.

That shuts down follow mode.
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.
cynosure
Posts: 9
Joined: Mon, 7. Jul 08, 19:42

Post by cynosure »

Well, it works well with this code. The problem was only that the AP closes up to the target ship for 1.1Km from the ship's hull. ;) but the script checks range beetween ship cores. So if I check a 2KM range for a weapon, the script never leaves from the loop. If I manually modify the checking range to 2.5-3Km, the script works nice. In an orca the difference is about 1-1.2Km from the center to its nose while checking distance on the HUD and by a script.

*EDIT*

Can I set the FOLLOW precision somehow to something like 500m?
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

You can use the get size library script I wrote. (that works OOS which the regular script instruction does not)

Add the "size" of both ships to the distance and it works with every ship.
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
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

Just wondering if anyone knows where the TLaser subtypes are held. Want to alter a few of their names or are they actually defined in the TLaser file?
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson
cynosure
Posts: 9
Joined: Mon, 7. Jul 08, 19:42

Re: hotkeys and commands

Post by cynosure »

Gazz wrote:
cynosure wrote:

Code: Select all

if [THIS]
  $ship = [THIS]
else
  $ship = [PLAYERSHIP]
end
It gives now correct values if I run the command from the ship via hotkay or command, and from an other ship too.
You should use

if [THIS] is object class (ship)
and
if [THIS] exist
every ship (from M5 to M1) is an instance of Class named {Ship 2004}?
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

Check out the appendix in the MSCI.

The table misses some new ones like TM but those are obvious so...
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.
cynosure
Posts: 9
Joined: Mon, 7. Jul 08, 19:42

Post by cynosure »

Thank you Gazz for your helps, they are really usefull to me.

Can I activate only one turret from a given turret slot on a target? I need its effect only. I want to simulate the tractor beam which tows a ship, but I don't want to disable the target and hold its distance.
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

Scripts can neither detect nor use X3's tractor beam feature.
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.

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