Bridge Commander Central
BC Forums => BC Scripting => Topic started by: FekLeyr Targ on November 16, 2007, 11:36:30 AM
-
Hi,
I know here is another topic regarding Ftech, but I thought I open another, because I have other problems than Billz.
I've tried to make the standard Photon torpedo to a splitting one. I follwed the manual to the letter, but I only get this error in the console:
File ".\Scripts\Tactical\Projectiles\PhotonTorpedo.py", line 60
sYieldName = ?ftb.Tech.TimedTorpedoes?
^
SyntaxError: invalid syntax
These are the lines I added to the bottom f the torpedo script:
sYieldName = ??
try:
import FoundationTech
import ftb.Tech.TimedTorpedoes
oFire = ftb.Tech.TimedTorpedoes.MIRVSingleTargetTorpedo(
?Name for tech?, {
?spreadNumber?: 3,
?spreadDensity?: 6.5,
?warheadModule?: ?Tactical.Projectiles.PhotonTorpedosplit?,
?shellLive?: 0,
})
FoundationTech.dOnFires[__name__] = oFire
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
pass
If I try to modify something, I always do it wrong. What have I done wrong? Which words have to be included in the sYield line in the " '' "? Please, help me.
Thank you.
-
Please attach the entire file. Because it doesn't seem to be the real code that is going wrong, since there is no sYieldName = 'ftb.Tech.TimedTorpedoes' line in the supplied code snippit.
Also, this is by your own doing (as in, you tried to script) so I'm moving this to Scripting.
But I see a problem already (maybe not the problem), Python is sensitive to "indentation".
And you need to keep it consistent, otherwise it won't know where you are.
I assumed you wanted the torpedo to split with the parameters you suplied, also, it's advisable to replace things like "Name for tech" with your own name + the type of tech.
In this case, I renamed it (for you) to 'FekLeyrTorpedoSpread3'. This will ensure it's unique.
Here is the (mostly) fixed part:
sYieldName = ??
try:
import FoundationTech
import ftb.Tech.TimedTorpedoes
oFire = ftb.Tech.TimedTorpedoes.MIRVSingleTargetTorpedo(?FekLeyrTorpedoSpread3?, {
?spreadNumber?: 3,
?spreadDensity?: 6.5,
?warheadModule?: ?Tactical.Projectiles.PhotonTorpedosplit?,
?shellLive?: 0,
})
FoundationTech.dOnFires[__name__] = oFire
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
pass
[EDIT]
*Moving*
Also, some of the indentation is "artificial" and added by myself to improve clarity. The indentation is only important on each new code line. A code line (what Python sees) is diffrent than a text line (what you see).
-
Here is the shell. For the warhead I made a copy of this torpedo script without Ftech lines.
I try your code, Mleo and then tell you, if it works or not.
Also: I just set a bookmark to this topic to read your explanation if I forget how to fix this error.
And thanks for everything.
edit: I'm sorry, but it still doesn't work.
-
This is a corrected version (sorry, I haven't got the time to test it right now).
It would appear the real reason for the (inital problem, you would have gotten the other one later after you fixed this one) are the usuage of ?.
Use ' or " (or even ''' or """, these are multiline btw).
I guess something went wrong in the export phase of the document to pdf. Sorry about that.
Also, 'ftb.Tech.TimedTorpedoes' isn't a valid tech.
It's the path to a module, but not a tech.
But you won't see an error for this (because of try: except: block).
-
hi!
could anyone be so nice and make an Intrepid with Reflector Shields?
Since I'm a very bloody noob at scripting...
I read the readme, but if I see the correct line once, things will get much clearer.
It's just about understanding, so that I can add my own Technologies...
-
Use sections 6.1 and 7.4
And I must have said it a lot, but I'm no mind reader, nor can I see what's on your computer so I don't know which intrepid you are talking about. Post the (ship) plugin and we can talk further.
-
Thanks, Mleo. This problem is fixed. But thhe torpedo still doesn't work.
This is that I found in the console:
SyntaxError: invalid syntax
File ".\Scripts\Tactical\Projectiles\PhotonTorpedo.py", line 68
'warheadModule': ?Tactical.Projectiles.PhotonTorpedosplit?,
-
Try this:
sYieldName = 'ftb.Tech.TimedTorpedoes'
try:
import FoundationTech
import ftb.Tech.TimedTorpedoes
oFire = ftb.Tech.TimedTorpedoes.MIRVSingleTargetTorpedo('FekLeyrTorpedoSpread3', {
'spreadNumber': 3,
'spreadDensity': 6.5,
'warheadModule': 'Tactical.Projectiles.PhotonTorpedosplit',
'shellLive': 0,
})
FoundationTech.dOnFires[__name__] = oFire
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
pass
-
i know i know, but since I'm a noob in scripting, and English is not my native language I have two rather big problems, lol
Foundation.ShipDef.Intrepid = Foundation.FedShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })This is the first ShipDef line from the USS Gandia.
What exactly would the next line have to look like?
Thats the only passage you need, isnt it?
-
The ShipDef line I mention in the readme is the:
Foundation.ShipDef.Intrepidpart.
From that, you can add the dTechs part like so:
Foundation.ShipDef.Intrepid.dTechs = {}
And now you can add as many techs as you want between the {} by seperating them with a comma (,).
I said section 7.4 in the readme, and it says to add:
"Reflector Shields": 75, Where 75 is the probability of the reflection working.
In this case, 75% (meaning 3 out of 4 times it will reflect).
The result:
Foundation.ShipDef.Intrepid.dTechs = {
"Reflector Shields": 75,
}
I added extra newlines for improved readability, but they are't required (here).
-
ok, thank you!
-
Hey MLeo,
First off, great mod, really damn cool.
I'm trying to modify the torpedo splitting script to split the torpedos about 10 units from a ship, instead of 100. I've found what I think is the measurement, and I changed it to 10, but nothing changed.
Thanks in advance.
-
Thank you very much, Mleo. Now it works.
I'll use your example above for other Projectiles (like the Orion missile).
Please tell me, if you want me to do something in change.
-
First of, this extension is originally by Dasher, you should be thanking him.
You know, the Foundation genius powering all your mods?
I just (partly) finished it. And ported the Phase Cloak from ATP as learning.
Hey MLeo,
First off, great mod, really damn cool.
I'm trying to modify the torpedo splitting script to split the torpedos about 10 units from a ship, instead of 100. I've found what I think is the measurement, and I changed it to 10, but nothing changed.
Thanks in advance.
I've said it before (even in this thread) and I'll say it again an infinite times.
I'm no mind reader, nor can I read your computer files from a distance, nor can I combine the 2 to read what you are talking about.
So, what is your script? Can you post it?
-
Good idea, Mleo. But due to his retirement before I joined I won't be able to contact him. I have often tried to contact retired modders. :( But I can try it again with Dasher42 and thank him for everything. Without him, BC wouldn't be as modable as today. :)
Tipp: If you have Kobayashi Maru and Thunderchilds Star Wars ship pack, try to implent the splitting Torpedos on the stock Photon as I and Mleo made it, fight against i.e. an Akira against a Stardestroyer and the SD is as good as doomed. :)
Also: I've made a cloak disrupting quantum torpedo and tested it on a Defiant against the Scimitar. It works super.
-
Usefull, don't you think? Those predefined scripts.
If you can get a copy of FTB (check BCU), it's got far more examples of FTech uses.
I started working on FTech through FTB (Dasher invited me, and what do you say to "Him" when he asks you?).
-
Yeah, very usefull.
FTB? Is that "favor the bold"? http://bridgecommander.filefront.com/file/Favor_The_Bold_Alpha_Release;36895
(the answer depends on the question. (or did I misunderstood you? I speak and understand english well, but not perfect))
-
That's the one.
Just don't install it over KM or anything like that.
-
Ok. But I have 2b careful with my disk space. But I could try install only the techs and some ships I want. I've done this in early 2007 with KM and MPMP. (wanted ATP3 in KM)
But I'm not able to download 100mb files, because the download freezes when in progress.
I haven't found more errors with FTech.
-
I was more talking about the use of the techs in it. So ships/projectiles.
-
I have found a mistake in the TMP warp script featured in Adonis newest TMP ships: When I go to warp, the nacelles don't bright up. And when I drop out of warp, the nacelles stay bright.
Does someone else has this problem?
-
I have found a mistake in the TMP warp script featured in Adonis newest TMP ships: When I go to warp, the nacelles don't bright up. And when I drop out of warp, the nacelles stay bright.
Does someone else has this problem?
Not a FTech problem.
Also, it's a Galaxy Chart thing (or so it appears):
http://bc-central.net/forums/index.php/topic,2206.msg39745.html#msg39745
-
First of all, I figured out that FTECH didn't work because I altered the inaccurate phaser settings.
I reset the values to default and everything works fine. This of course leads to my first question.
Is it at all possible to change the values of Inaccurate Phasers, or remove the script entirely without
consequences to FTECH technologies? I know you can use manual fire but it's rather tedious zooming
in and out of the target.
Next is about using second party techs from ATP 1 using ATP technologies scanner in FTECH. Of course
we know that KM 1.0 already includes portions of ATP, however I need to know if there are other major
differences between the scripts besides simple items like the sound fx for "Life Support.
Most importantly, if it is ok to install ATP 1, must I also install the ATP compatibility script "000-Fixes20060726"
or will that not be necessary in KM 1.0?
-
If you can activate ATP without problems in KM, then you don't need the scanner.
And also not the compatibility script.
That is, if you can run ATP without problems.
The scanner is for when you don't have ATP installed, but have a lot of ATP enabled ships.
The compatibility fix is for when you have ATP installed and NanoFXv2Beta installed and nanofx after atp. Basicly, it just ensures that ATP won't complain.