Bullwinkle's List

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
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Re: Jump Drive Kits

It sounds possible, Andy. I did not write the script, so your debugging effort could be as good as mine. :)

Mark your changes with comments and let me know the results. If you track it down, then I will add the fix to the next update.
Andyrids
Posts: 248
Joined: Sat, 16. Aug 08, 19:45
x3tc

Post by Andyrids »

Well me not being familiar with the specific variables involved to do exactly what I said after having a closer look I noticed that there does seem to be a few classes that could achieve desired results in the form of a dirty hack so to speak as below :

plugin.deliver.jd.install

Code: Select all

* BEGIN EDIT AndyR
* get ships maximum hull ammount
  $maxhull = $ship->get max hull
* get ships current hull ammount
  $curhull = $ship->get hull
* if our current hull is the same as max hull then we are undamaged and good to calculate the correct ammount of tunings
  if $curhull == $maxhull  
  $free = $ship->get amount of ware {Engine Tuning} in cargo bay
  $upgrade = $ship->get max upgrades for upgrade {Engine Tuning}
  $math = $upgrade - $free
  $cost = $math * $et.uc
* if our hull is less than the max hull value then our ship is damaged and wont give us the correct ammount of tunings installed
else if $curhull < $maxhull
* so lets set the ships hull to the max ammount in order to correctly calculate the number of tunings we can install
  $ship->set hull to $maxhull
  $free = $ship->get amount of ware {Engine Tuning} in cargo bay
  $upgrade = $ship->get max upgrades for upgrade {Engine Tuning}
  $math = $upgrade - $free
  $cost = $math * $et.uc
* ammount of tunings have been set now so we can return the ships hull back to its origional value
  $ship->set hull to $curhull
* END EDIT AndyR Below is origional block of code
*  $free = $ship->get amount of ware {Engine Tuning} in cargo bay
*  $upgrade = $ship->get max upgrades for upgrade {Engine Tuning}
*  $math = $upgrade - $free
*  $cost = $math * $et.uc
I am unable to test this myself due to the fact Exscriptor refuses to save the file informing me there is references to objects that do not exist (in the other code blocks within the file) I opened all the files in the set also and tried various methods to get it to save but it just does not want to play nice, I guess there is some quirk with Exscriptor that I do not know about, either that or I am just using it wrongly lol
Image
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Are you repairing the ship when you add tunings? I would not think that necessary, but you will need to be able to test your code if you want to get it working.

Which version of Upgrade Kits are you using? The unknown reference could be the custom ware (Upgrade Kit). Do you see this block of text around line 28?:

Code: Select all

* BW: ===================================
$jdk = get global variable: name='deliver.jd.jdk'
if not $jdk
    write to player logbook 'plugin.deliver.jd.install: Please re-run setup.plugin.deliver.jd'
   return null
end
* BW: ===============================
Also, look at the error messages beneath the code window in Exscriptor. What line(s) does Exscriptor complain about?
Andyrids
Posts: 248
Joined: Sat, 16. Aug 08, 19:45
x3tc

Post by Andyrids »

The idea was to temporally repair the ship before calculating the number of tunings to add, since hull damage reduces ship speed and I figure this is somehow related to the incorrect amount of tunings the mod adds when the ship has hull damage resulting in an overtune, once the correct amount has been calculated and added then return the ships hull back to its previous state for EG :

Hull @ 86%
Install JDK
Script sets ship hull to 100%
Then checks to see how many tunings we have and how many can be added (upto the ships default max)
Script then sets ship hull back to 86%

When the hull has damage there always seems to be at least 1 extra tuning added resulting in the overtune.
I guess in this case you could just do this :

Code: Select all

$free =-1
$math = $upgrade - $free
But that would minus 1 tuning in both scenarios.

And yes I do see that block of text around line 28... This is the error response it is showing me :

Saving file...
Save failed because of compilation errors - please compile again
Save failed due to compilation errors!
- Error during jump finalising - there are jumps remaining without destinations. Check that all if/whiles/gotos etc have corresponding ends/labels etc.

Warnings:
Script 'plugin.deliver.jd.lsm' does not seem to exist! (line 122)
Script 'plugin.deliver.jumpdrive.getware' does not seem to exist! (line 129)
Script 'plugin.deliver.jd.wings' does not seem to exist! (line 132)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 148)
Variable free is being used on line 156 before being assigned to.
Script 'plugin.deliver.jd.fillup' does not seem to exist! (line 180)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 184)
Script 'plugin.deliver.jd.fillup' does not seem to exist! (line 214)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 218)
Script 'plugin.deliver.jd.fillup' does not seem to exist! (line 286)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 301)
Script 'plugin.deliver.jd.fillup' does not seem to exist! (line 331)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 335)
Script 'plugin.deliver.jd.fillup' does not seem to exist! (line 360)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 375)
Script 'plugin.deliver.jd.fillup' does not seem to exist! (line 405)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 412)
Comment on line 420 contains XML symbols such as &, < or >. X3 cannot handle these symbols properly so it is recommended that you avoid using them.
Comment on line 422 contains XML symbols such as &, < or >. X3 cannot handle these symbols properly so it is recommended that you avoid using them.
Script 'plugin.deliver.jd.fillup' does not seem to exist! (line 439)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 444)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 453)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 459)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 468)
Script 'plugin.deliver.jd.getlists' does not seem to exist! (line 474)
Script 'plugin.deliver.jd.malf' does not seem to exist! (line 487)
Could not check parameters for call to: lib.bw.breakpoint: file not found. (line 495)
Script 'lib.bw.breakpoint' does not seem to exist! (line 495)
Hence why I loaded up all the missing files it is referring to thinking it would then see them and save the file in question, but no such luck lol
Image
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Why does Exscriptor not find the related scripts? That's not right.

Code: Select all

Error during jump finalising - there are jumps remaining without destinations. Check that all if/whiles/gotos etc have corresponding ends/labels etc.


^ The above message means that you have an error in your if/end loops. I do not see any "end" statements in the code that you published.

If/end should look like this:

Code: Select all

if <condition>
   <do something>
end
Andyrids
Posts: 248
Joined: Sat, 16. Aug 08, 19:45
x3tc

Post by Andyrids »

Thanks you were correct I had missed off one "end"

Anyway that code actually did not fix the overtune SO I looked at another file and edited quite simply the line below :

plugin.deliver.jd.fillup.xml

Code: Select all

0023 * EDIT AndyR
0024 * $free = $upgrade - $chk
0025    $free = $upgrade - $chk - 1
0026 * ----------
Now it works ! there is no more overtune in any situation... I tested this in all possible scenarios I could think of and the correct tunings are applied and the speed of course gets set correctly to the ships current and possible max value... So no more "overtune" :) Can make note of that and stick it in the next update if you wish to do so.

I was looking in the wrong place to start with I should have just went straight to the check routine to start with.

Also I discovered some interesting things to "play" with whilst messing this lol
Image
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Andyrids wrote:[you] can make note of that and stick it in the next update if you wish to do so.
I will do exactly that, Andy, thanks.

And nice work!
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Update

Updated Features
  • :arrow: Improved spacewalking speed (again). Marines can now catch up to fast-moving target ships.
    :arrow: Improved spacewalk reliability by transporting marines near to target ship. (Fixes some collision-avoidance problems).
    :arrow: Spacewalk launch hotkeys now send only the correct number of marines for the target. Use multiple launches for more marines.
    :arrow: Added configurable options to t file, including use of standard Transporter Device instead of expensive Boarding Transporter.
History
  • v1.23.03 (2012-12-19)
    - Fixed a bug that caused jet pack speed to be (permanently) too slow.
    - Improved Spacewalking reliability by partially compensating for collision avoidance problems.
    (Uses standard Transporter Device to beam marines near the target ship.)
    - Added adjustable values to t file.
    - Increased default values for transporter range and spacewalk launch distances to deal with large target ship sizes (TL+).

    v1.23.02 (2012-10-02)
    - Increase boarding transporter range to 3 km (Scion Drakhar)

    v1.23
    - Cycrow's original version: Improved Boarding (Cycrow).
Last edited by DrBullwinkle on Sun, 23. Dec 12, 17:48, edited 1 time in total.
Friznit
Posts: 58
Joined: Thu, 16. Dec 04, 12:07
x2

Post by Friznit »

Just installed this version over XRM & IR2 (also running MARS). It's not very happy - lots of readtext errors and the shortcut key descriptions are in German (though that may be a feature?)

Are these known conflicts?
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Thank you for the report, Friznit!

Bug Fix

Improved Boarding (Bullwinkle's Hacked Version)
[ external image ]

[ external image ]

Improved Boarding (Bullwinkle's Hacked Version 1.23.04)

For X3TC or X3AP.



Updated Features
  • :arrow: Improved spacewalking speed (again). Marines can now catch up to fast-moving target ships.
    :arrow: Improved spacewalk reliability by transporting marines near to target ship. (Fixes some collision-avoidance problems).
    :arrow: Spacewalk launch hotkeys now send only the correct number of marines for the target. Use multiple launches for more marines.
    :arrow: Added configurable options to t file, including use of standard Transporter Device instead of expensive Boarding Transporter.
History
  • v1.23.04 (2012-12-23)
    - Added missing language files (t files). (Friznit)

    v1.23.03 (2012-12-19)
    - Fixed a bug that caused jet pack speed to be (permanently) too slow.
    - Improved Spacewalking reliability by partially compensating for collision avoidance problems.
    (Uses standard Transporter Device to beam marines near the target ship.)
    - Added adjustable values to t file.
    - Increased default values for transporter range and spacewalk launch distances to deal with large target ship sizes (TL+).

    v1.23.02 (2012-10-02)
    - Increase boarding transporter range to 3 km (Scion Drakhar)

    v1.23
    - Cycrow's original version: Improved Boarding (Cycrow).
Friznit
Posts: 58
Joined: Thu, 16. Dec 04, 12:07
x2

Post by Friznit »

Works a treat - swift work, many thanks!
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

You are welcome, and thank you for the report, Friznit!
Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 »

Question regarding Upgrade Kits:
I have not found anything regarding XRM compatibility.
Are they XRM compatible?
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

I wouldn't know.

And please punch yourself for asking. ;)
  • (The script itself will work -- maybe. You may want to change the equipment packs by editing getlists. By default, I include a jump drive with any package -- I do not recall whether the script checks if a jump drive can be mounted. Try it and let the rest of us know your results. :) )
Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 »

DrBullwinkle wrote:I wouldn't know.

And please punch yourself for asking. ;)
  • (The script itself will work -- maybe. You may want to change the equipment packs by editing getlists. By default, I include a jump drive with any package -- I do not recall whether the script checks if a jump drive can be mounted. Try it and let the rest of us know your results. :) )
*PUNCH* - OW! -

Aside from that - I bought an upgrade kit, gave it to a Yaki Appallox (M6), but the command "install upgrade" in the ship menu is not showing up.

As I understand, it should show up in the submenue "custom", right?
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

:)

Yes, you should see the option if you have any upgrade kits on board your ship. Have you bought any? They are sold at the factory in Getsu Fune and at Terracorp HQ (although it may take time for a transport to stock Terracorp from the factory).
Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 »

Yes, bought a Jumpdrive kit at Terracorp HQ, captured the Appalox in a pirate sector, then wanted to jump to safety by transfering and installing the kit.
I should say, that I turned on the AL plugin only AFTER buying the kit. Could this lead to the error?
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

You want to buy upgrade kits. Several of them. Not a jump drive, right?

The AL Plugin just keeps the factory running.


Could this lead to the error?

What error? You didn't report an error. :?



If there are no upgrade kits at the factory in Getsu Fune, then I would suspect a problem with installing the custom ware. The Plugin Manager should handle that. (If that turns out to be the problem, then I can tell you how to work around it.)
Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 »

DrBullwinkle wrote:You want to buy upgrade kits. Several of them. Not a jump drive, right?
I think I have the kit :)
[ external image ]
DrBullwinkle wrote: The AL Plugin just keeps the factory running.


I ment this option:
[ external image ]
DrBullwinkle wrote:
Could this lead to the error?

What error? You didn't report an error. :?
I ment the missing command in the ship menu...
DrBullwinkle wrote: If there are no upgrade kits at the factory in Getsu Fune, then I would suspect a problem with installing the custom ware. The Plugin Manager should handle that. (If that turns out to be the problem, then I can tell you how to work around it.)
I did not get to Getsu Fune yet, will check when I get there.

Additional note:
I insalled the kits as a fake patch, not with the Plugin Manager. Might be a conflict with another mod then.
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Nicoman35 wrote:Additional note:
I installed the kits as a fake patch, not with the Plugin Manager.
Well, that won't work (unless EMP is built into XRM).

Custom wares are a bit flimsy, mostly due to lack of documentation and evolution of EMP without updates to scripts that use the wares. The easiest way to install custom wares is with the Plugin Manager. Even the XRM Installation Instructions tell you to open and close the PM in order to update custom wares.

The ware that you are looking for is called an "Upgrade Kit" if installed normally (with the PM).

From your description, the script appears to be behaving normally.


Pure Speculation Department: It is possible that EMP might be built into XRM, and your "Jumpdrive Deployment Kit" may come from that. The way to find out, for sure, is to check the factory in Getsu Fune. Can you buy multiple Jumpdrive Deployment Kits?

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