Automatic Turret by schilcote

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
BrolyLSSJ5
Anarchist
Anarchist
Posts: 18
Joined: Tue Mar 04, 2008 11:28 am
Location: North Italy

Hi! This the automatic turret mod by schilcote, but there are a lot of bugs in this... Can somebody help?

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<TranscendenceModule>
  <!ENTITY itAutoGun1    "0xD4660003">
  <!ENTITY itAutoGun2    "0xD4660004">
  <!ENTITY itAutoGun3    "0xD4660005">
  <!ENTITY itAutoGun4    "0xD4660006">
  <!ENTITY itAutoGun5    "0xD4660007">
  <!ENTITY itAutoGun6    "0xD4660008">
  <!ENTITY itAutoGun7    "0xD4660009">
  <!ENTITY itAutoGun8    "0xD4660010">

<ItemType UNID="&itAutoGun1;"
		name=				"Automatic Turret"
		level=				"5"
		value=				"8000"
		mass=				"1000"
		frequency=			"uncommon"
		modifiers=			"MajorItem"

		description=		"This device is a slightly brainy gun. When you target a ship and activate the turret, it fires automaticaly untill it is de-activated. This turret is equipped with a lazer cannon."
		>

	<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

	<Invoke key="T"> AutoDefenseDevice
			
                  (setq vessel (objGetTarget gSource))
                                    
             (if (not vessel)
			(objSendMessage gSource Nil "Nothing selected.")	

			
			gtarget=			"vessel"
			weapon=			"&itOmniLaserCannon;"
			rechargeTime=	"15"
			/>

</ItemType>

<ItemType UNID="&itAutoGun2;"
		name=				"Automatic Turret"
		level=				"5"
		value=				"8000"
		mass=				"1000"
		frequency=			"uncommon"
		modifiers=			"MajorItem"

		description=		"This device is a slightly brainy gun. When you target a ship and activate the turret, it fires automaticaly untill it is de-activated. This turret is equipped with a slam cannon."
		>

	<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

	<Invoke key="T"> AutoDefenseDevice
			
                  (setq vessel (objGetTarget gSource))
                                    
             (if (not vessel)
			(objSendMessage gSource Nil "Nothing selected.")	

			
			target=			"vessel"
			weapon=			"&itSlamCannon;"
			rechargeTime=	"15"
			/>

</ItemType>

<ItemType UNID="&itAutoGun3;"
		name=				"Automatic Turret"
		level=				"5"
		value=				"8000"
		mass=				"1000"
		frequency=			"uncommon"
		modifiers=			"MajorItem"

		description=		"This device is a slightly brainy gun. When you target a ship and activate the turret, it fires automaticaly untill it is de-activated. This turret is equipped with a dual turbolazer cannon."
		>

	<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

	<Invoke key="T"> AutoDefenseDevice
			
                  (setq vessel (objGetTarget gSource))
                                    
             (if (not vessel)
			(objSendMessage gSource Nil "Nothing selected.")	

			
			target=			"vessel"
			weapon=			"&itDualTurbolaserCannon;"
			rechargeTime=	"15"
			/>

</ItemType>

<ItemType UNID="&itAutoGun4;"
		name=				"Automatic Turret"
		level=				"5"
		value=				"8000"
		mass=				"1000"
		frequency=			"uncommon"
		modifiers=			"MajorItem"

		description=		"This device is a slightly brainy gun. When you target a ship and activate the turret, it fires automaticaly untill it is de-activated. This turret is equipped with an omnidirectional turbolazer cannon."
		>

	<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

	<Invoke key="T"> AutoDefenseDevice
			
                  (setq vessel (objGetTarget gSource))
                                    
             (if (not vessel)
			(objSendMessage gSource Nil "Nothing selected.")	

			
			target=			"vessel"
			weapon=			"&itOmniTurbolaserCannon;"
			rechargeTime=	"15"
			/>

</ItemType>

<ItemType UNID="&itAutoGun5;"
		name=				"Automatic Turret"
		level=				"5"
		value=				"8000"
		mass=				"1000"
		frequency=			"uncommon"
		modifiers=			"MajorItem"

		description=		"This device is a slightly brainy gun. When you target a ship and activate the turret, it fires automaticaly untill it is de-activated. This turret is equipped with an Akan 30 cannon, which requires Akan 30 shells."
		
	<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

	<Invoke key="T"> AutoDefenseDevice
			
                  (setq vessel (objGetTarget gSource))
                                    
             (if (not vessel)
			(objSendMessage gSource Nil "Nothing selected.")	

			
			target=			"vessel"
			weapon=			"&itAkan30Cannon;"
			rechargeTime=	"15"
			/>

</ItemType>

<ItemType UNID="&itAutoGun6;"
		name=				"Automatic Turret"
		level=				"5"
		value=				"8000"
		mass=				"1000"
		frequency=			"uncommon"
		modifiers=			"MajorItem"

		description=		"This device is a slightly brainy gun. When you target a ship and activate the turret, it fires automaticaly untill it is de-activated. This turret is equipped with an EMP cannon."
		>

	<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

	<Invoke key="T"> AutoDefenseDevice
			
                  (setq vessel (objGetTarget gSource))
                                    
             (if (not vessel)
			(objSendMessage gSource Nil "Nothing selected.")	

			
			target=			"vessel"
			weapon=			"&itIonCannon;"
			rechargeTime=	"15"
			/>

</ItemType>

<ItemType UNID="&itAutoGun7;"
		name=				"Automatic Turret"
		level=				"5"
		value=				"8000"
		mass=				"1000"
		frequency=			"uncommon"
		modifiers=			"MajorItem"

		description=		"This device is a slightly brainy gun. When you target a ship and activate the turret, it fires automaticaly untill it is de-activated. This turret is equipped with a Lancer cannon."
		>

	<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

	<Invoke key="T"> AutoDefenseDevice
			
                  (setq vessel (objGetTarget gSource))
                                    
             (if (not vessel)
			(objSendMessage gSource Nil "Nothing selected.")	

			
			target=			"vessel"
			weapon=			"&itLancerCannon;"
			rechargeTime=	"15"
			/>

</ItemType>

<ItemType UNID="&itAutoGun8;"
		name=				"Automatic Turret"
		level=				"5"
		value=				"8000"
		mass=				"1000"
		frequency=			"uncommon"
		modifiers=			"MajorItem"

		description=		"This device is a slightly brainy gun. When you target a ship and activate the turret, it fires automaticaly untill it is de-activated. This turret is equipped with an omnidirectional particle cannon."
		>

	<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

	<Invoke key="T"> AutoDefenseDevice
			
                  (setq vessel (objGetTarget gSource))
                                    
             (if (not vessel)
			(objSendMessage gSource Nil "Nothing selected.")	

			
			target=			"vessel"
			weapon=			"&itOmniParticleCannon;"
			rechargeTime=	"15"
			/>

</ItemType>
THE POWER OF A LEGEND DOESN'T KNOW LIMITS

Image

I'm A Transcendence Italian Player!
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5510
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

i dunno about the bugs, but "laser" is misspelled as "lazer"
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
Fatboy
Militia Lieutenant
Militia Lieutenant
Posts: 247
Joined: Fri Feb 22, 2008 1:52 am
Location: California

this

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<TranscendenceModule>
  <!ENTITY itAutoGun1    "0xD4660003">
  <!ENTITY itAutoGun2    "0xD4660004">
  <!ENTITY itAutoGun3    "0xD4660005">
  <!ENTITY itAutoGun4    "0xD4660006">
  <!ENTITY itAutoGun5    "0xD4660007">
  <!ENTITY itAutoGun6    "0xD4660008">
  <!ENTITY itAutoGun7    "0xD4660009">
  <!ENTITY itAutoGun8    "0xD4660010">
should be like this

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TranscendenceExtension
[
  <!ENTITY itAutoGun1    "0xD4660003">
  <!ENTITY itAutoGun2    "0xD4660004">
  <!ENTITY itAutoGun3    "0xD4660005">
  <!ENTITY itAutoGun4    "0xD4660006">
  <!ENTITY itAutoGun5    "0xD4660007">
  <!ENTITY itAutoGun6    "0xD4660008">
  <!ENTITY itAutoGun7    "0xD4660009">
  <!ENTITY itAutoGun8    "0xD4660010">
]>

<TranscendenceExtension UNID="0xD4660002" version="0.98">
I hope it helps.
The other stuff I could say is over my head.
F50
Fleet Officer
Fleet Officer
Posts: 1004
Joined: Sat Mar 11, 2006 5:25 pm

How could such a large mod have such a serious problem? Was this one of the old mods from Thom's site?
User avatar
Hades
Commonwealth Pilot
Commonwealth Pilot
Posts: 53
Joined: Sat Jan 26, 2008 3:01 pm

It might have come from Here
User avatar
BrolyLSSJ5
Anarchist
Anarchist
Posts: 18
Joined: Tue Mar 04, 2008 11:28 am
Location: North Italy

DEBUG LOG: Unable to parse Auto-Turret.xml: Line(42): content expected

The problem is here:

Code: Select all

weapon=         "&itOmniLaserCannon;" 
Maybe I have to add the Omni Laser and other weapons descrition in the same file??? :?: :?
THE POWER OF A LEGEND DOESN'T KNOW LIMITS

Image

I'm A Transcendence Italian Player!
F50
Fleet Officer
Fleet Officer
Posts: 1004
Joined: Sat Mar 11, 2006 5:25 pm

No. If &itOmniLaserCannon; is in one of the source xml files, then it is already defined. The problem is not there.


Code: Select all

         (setq vessel (objGetTarget gSource))
             (if (not vessel)
         (objSendMessage gSource Nil "Nothing selected.")
Likely this should be in a (block Nil)

Code: Select all

gtarget= "vessel"
this is likely the problem. It is just " target= " vessel " " in the other autoguns. (why oh why would someone create copies of a thing when that thing doesn't work).



I suggest you delete all autoguns except autogun1 and debug just that. Once you have that working, add the other guns back in and apply all the changes you made to autogun1.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

This script is basically garbage.

Notice that the <Invoke> method has been partly over written by the <AutoDefenseDevice> tag from the ICX. That's the biggest issue.

Is it invoking or auto defense? The script doesn't know. It won't do both.

From the ICX code, <AutoDefenseDevice> only takes the parameters:

Code: Select all

	<AutoDefenseDevice
			target=			"missiles"
			weapon=			"&itOmniLaserCannon;"
			rechargeTime=	"15"
			/>
It is a tag, you might notice.
It won't take a (block of script, either.

So, that's a mess.

Changing it to read something like this:

Code: Select all

	<Invoke key="T">

         (block (vessel)
	         (setq vessel (objGetTarget gSource))
                                   
             (if (not vessel)
         (objSendMessage gSource Nil "Nothing selected.")
     )
	</Invoke>

   <AutoDefenseDevice>
            

         
         gtarget=         "(vessel)"
         weapon=         "&itOmniLaserCannon;"
         rechargeTime=   "15"

         </AutoDefenseDevice>

</ItemType> 
Still won't work because the ONLY value that gtarget seems to want to accept is "missiles". So sorry.

edit- I tried a few different ways to try to get the gtarget to accept anything other than "missiles", and it only spits out the error "Unable to load defense device descriptor"
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

mmmmhhh, what if you manually setq gTarget in code like :

Code: Select all

<Invoke key="T">

         (block (vessel)
            (setq vessel (objGetTarget gSource))
             (setq gTarget vessel)
               
             (if (not vessel)
         (objSendMessage gSource Nil "Nothing selected.")
     )
   </Invoke>

   <AutoDefenseDevice>
           

         
     
         weapon=         "&itOmniLaserCannon;"
         rechargeTime=   "15"

         </AutoDefenseDevice>

</ItemType> 
but i'm just inventing... :)
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I actually tried that. :)
Problem one is that the Invoke hasn't occurred before gTarget is needed- I can't get anything to even compile and load up the game if it is trying to alter the target="missiles" in the AutoDefenseDevice.

I also tried target= "(objGetTarget gSource)" which gave me the same error.
F50
Fleet Officer
Fleet Officer
Posts: 1004
Joined: Sat Mar 11, 2006 5:25 pm

perhaps you need a recurring timer event and (sysCreateWeaponsFire), anyways, its going to be more complicated than the maker of this mod has intended.


Its probably easiest to just ask George for these values
to be made meaningful:

target="freindlyMissiles" (defective turret?)
target="ships" (enemy ships only of course)
target="friendlyShips" (defective turret?)
target="target" (player's target if its an enemy)
target="friendlyTarget" (player's target if its freindly)

This would allow for some really interesting devices.
User avatar
BrolyLSSJ5
Anarchist
Anarchist
Posts: 18
Joined: Tue Mar 04, 2008 11:28 am
Location: North Italy

Oh well, this is the reason I can't do anything about it! :roll:


I think F50's ideas about ICX devices are better than this mod.
THE POWER OF A LEGEND DOESN'T KNOW LIMITS

Image

I'm A Transcendence Italian Player!
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Well, that WAS my first mod above making weapons with bug numbers. I redid it a little while ago and got all the bugs out, except of course how to tell the autiDefenciveDevice tag what to shoot at. In the end I just ended up with a whole lot of ICX turrets. Maybe george can help me, but nobody else. I think autodefencivedevice only looks for missiles, maybe the target definition was for something george didn't put in. In any case, DigDug's ICX works, mine dosen't. At least I had the idea first.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

you got the idea and F50 made the code.

I did nothing in the end ! :D
Post Reply