maths question

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

maths question

Post by LV »

Code: Select all

$tlsil = $tl -> get amount of ware Silicon Wafers in cargo bay

Code: Select all

= $base -> add -$tlsil units of Silicon Wafers

Example

My TL has 1344 units of silicon which i can call with the top command

but how do i turn that into a minus value so I can subract it from the tl?

ie 1344 would become -1344 :?
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses
User avatar
InvrSmall
Posts: 717
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by InvrSmall »

If the scripting language allows, multiply by -1.
XeHonk
Posts: 1087
Joined: Sun, 7. Mar 04, 23:03
x3tc

Post by XeHonk »

$tlsil = - $tlsil

just use an expression (first cmd in general commands i think)
User avatar
JustHere4Coffee
Posts: 1075
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JustHere4Coffee »

I'd love to buy ships where you do, if they can fit 1344 silicon wafers! :D

are you doing this as a remote stock change or something? otherwise surely the "ship -> load x units of y" should adjust the stations stock automatically shouldn't it?
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

this is a tl ore delivery mission, ie an npc tl wants xore xsil xniv , player mines it and the transfer is done by "transporter" from my tl to npc tl ;)
User avatar
JustHere4Coffee
Posts: 1075
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JustHere4Coffee »

ah, fair enough

sounds amusing :)

Return to “X²: The Threat - Scripts and Modding”