Author Topic: Problem(s) with Ftech  (Read 2623 times)

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Problem(s) with Ftech
« 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:
Code: [Select]
  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:
Code: [Select]
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.
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #1 on: November 16, 2007, 11:56:53 AM »
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:
Code: [Select]
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).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Problem(s) with Ftech
« Reply #2 on: November 16, 2007, 12:07:46 PM »
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.
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #3 on: November 16, 2007, 12:45:27 PM »
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).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

intrepid90

  • Guest
Re: Problem(s) with Ftech
« Reply #4 on: November 16, 2007, 12:55:04 PM »
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...

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #5 on: November 16, 2007, 01:00:05 PM »
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.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Problem(s) with Ftech
« Reply #6 on: November 17, 2007, 06:58:54 AM »
Thanks, Mleo. This problem is fixed. But thhe torpedo still doesn't work.
This is that I found in the console:
Code: [Select]
SyntaxError: invalid syntax
  File ".\Scripts\Tactical\Projectiles\PhotonTorpedo.py", line 68
    'warheadModule': ?Tactical.Projectiles.PhotonTorpedosplit?,
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #7 on: November 17, 2007, 10:10:10 AM »
Try this:
Code: [Select]
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 still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

intrepid90

  • Guest
Re: Problem(s) with Ftech
« Reply #8 on: November 17, 2007, 02:28:13 PM »
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
Code: [Select]
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?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #9 on: November 17, 2007, 04:52:12 PM »
The ShipDef line I mention in the readme is the:
Code: [Select]
Foundation.ShipDef.Intrepidpart.

From that, you can add the dTechs part like so:
Code: [Select]
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:
Code: [Select]
"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:
Code: [Select]
Foundation.ShipDef.Intrepid.dTechs = {
    "Reflector Shields": 75,
}

I added extra newlines for improved readability, but they are't required (here).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

intrepid90

  • Guest
Re: Problem(s) with Ftech
« Reply #10 on: November 17, 2007, 05:03:35 PM »
ok, thank you!

Offline Daedalus

  • Posts: 1
  • Cookies: 0
Re: Problem(s) with Ftech
« Reply #11 on: November 17, 2007, 06:44:27 PM »
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.

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Problem(s) with Ftech
« Reply #12 on: November 18, 2007, 03:53:34 AM »
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.
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #13 on: November 18, 2007, 10:16:25 AM »
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?
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Problem(s) with Ftech
« Reply #14 on: November 18, 2007, 02:30:02 PM »
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.
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #15 on: November 18, 2007, 04:21:32 PM »
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?).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Problem(s) with Ftech
« Reply #16 on: November 19, 2007, 09:27:21 AM »
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))
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #17 on: November 19, 2007, 12:40:14 PM »
That's the one.
Just don't install it over KM or anything like that.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Problem(s) with Ftech
« Reply #18 on: November 20, 2007, 11:30:05 AM »
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.
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Problem(s) with Ftech
« Reply #19 on: November 21, 2007, 11:40:06 AM »
I was more talking about the use of the techs in it. So ships/projectiles.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.