Need help with escorts

Freeform discussion about anything related to modding Transcendence.
Post Reply
Drako Slyith
Fleet Officer
Fleet Officer
Posts: 1036
Joined: Wed Feb 03, 2010 4:28 am
Location: Researching how to make St. Kats star go supernova.
Contact:

I'm working on some code to make some CSC's able to give fleet officers escorts. I wrote out this code:

Code: Select all

							<Action name="Continue" key="C">
						(block nil
							(switch
								(eq (objGetData gPlayerShip "fleetLevel") 4)
									(block nil
										(intFleetDisperseWingmen gSource 4)
										(intFleetCreateWingmen gSource 4 &scCenturion;)
										
									)
								(eq (objGetData gPlayerShip "fleetLevel") 5)
									(block nil
										(intFleetDisperseWingmen gSource 6)
										(intFleetCreateWingmen gSource 6 &scCenturion;)
									)
										
									(block nil
										(intFleetDisperseWingmen gSource 6)
										(intFleetCreateWingmen gSource 6 &scBritannia;)
									)
								)
							(scrExitScreen gScreen)
						)
It seems to work fine but when I do a mission, it lets me make escorts but doesn't get rid of the others, so after a mission at level 4, if I already have 4 escorts it lets me get an extra 4, so I have 8 escorts. After I do another mission it lets me get another 4, and so on. This is just one time after every mission I do. I really don't understand why it's executing half the code in the block.
Image
Image
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

did you try putting (dbglog around the (intFleetDisperseWingmen gSource 4) to see what it returns?

edit:
i did

Code: Select all

(setq wm (lambda nil
	(block nil
	(intFleetDisperseWingmen gplayership 4)
    (intFleetCreateWingmen gplayership 4 &scCenturion;)
	)
	))
and it worked fine

(apart form the fact that i had to stop them form trying to dock with me

Code: Select all

(setq intFleetDisperseWingmen (lambda (aStation aCount)
(block (i shipsLeft)
(setq shipsLeft 0)
(for i 0 (subtract aCount 1)
(block (ship)
(setq ship (objGetObjRefData aStation (cat "Wingman" i)))
(if ship
(block Nil
(setq shipsLeft (add shipsLeft 1))
(shpCancelOrders ship)
;(shpOrderDock ship aStation)
(shpOrderGate ship)
))))
shipsLeft
)
))
Last edited by sdw195 on Sat Mar 19, 2011 11:47 pm, edited 1 time in total.
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
Drako Slyith
Fleet Officer
Fleet Officer
Posts: 1036
Joined: Wed Feb 03, 2010 4:28 am
Location: Researching how to make St. Kats star go supernova.
Contact:

no I haven't. I'll go try that. It doesn't even cause an error message, it just doesn't work. Also, I've determined it only lets you go past the limits if you have just finished a mission and your escorts given to you are dispersed.
Image
Image
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

i edited my post
edit:
i did

Code: Select all

(setq wm (lambda nil
   (block nil
   (intFleetDisperseWingmen gplayership 4)
    (intFleetCreateWingmen gplayership 4 &scCenturion;)
   )
   ))	
		

and it worked fine

(apart form the fact that i had to stop them form trying to dock with me

Code: Select all

Code:
(setq intFleetDisperseWingmen (lambda (aStation aCount)
(block (i shipsLeft)
(setq shipsLeft 0)
(for i 0 (subtract aCount 1)
(block (ship)
(setq ship (objGetObjRefData aStation (cat "Wingman" i)))
(if ship
(block Nil
(setq shipsLeft (add shipsLeft 1))
(shpCancelOrders ship)
;(shpOrderDock ship aStation)
(shpOrderGate ship)
))))
shipsLeft
)
))
i really need to stop editing my posts :roll:
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
Drako Slyith
Fleet Officer
Fleet Officer
Posts: 1036
Joined: Wed Feb 03, 2010 4:28 am
Location: Researching how to make St. Kats star go supernova.
Contact:

Ok thanks.
Image
Image
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
Drako Slyith
Fleet Officer
Fleet Officer
Posts: 1036
Joined: Wed Feb 03, 2010 4:28 am
Location: Researching how to make St. Kats star go supernova.
Contact:

Thanks for the help. It works as intended, except for 1 small(ish) thing. An error message comes up when a CSC is spawned. I have this in my Globals:

Code: Select all

	<Globals>
	(block nil
(setq newWingMenCent1 (lambda nil
   (block nil
   (intFleetDisperseWingmen gplayership 4)
    (intFleetCreateWingmen gplayership 4 &scCenturion;)
   )
   ))
 (setq newWingMenBrit (lambda nil
   (block nil
   (intFleetDisperseWingmen gplayership 6)
    (intFleetCreateWingmen gplayership 6 &scBritannia;)
   )
   ))
(setq newWingMenCent2 (lambda nil
   (block nil
   (intFleetDisperseWingmen gplayership 6)
    (intFleetCreateWingmen gplayership 6 &scCenturion;)
   )
   ))
   

 
(setq intFleetDisperseWingmen (lambda (aStation aCount)
(block (i shipsLeft)
(setq shipsLeft 0)
(for i 0 (subtract aCount 1)
(block (ship)
(setq ship (objGetObjRefData aStation (cat "Wingman" i)))
(if ship
(block Nil
(setq shipsLeft (add shipsLeft 1))
(shpCancelOrders ship)
;(shpOrderDock ship aStation)
(shpOrderGate ship)
))))
shipsLeft
)
))  )


	</Globals>
and this in my dockscreen:

Code: Select all

							<Action name="Continue" key="C">
						(block nil
							(switch
								(eq (objGetData gPlayerShip "fleetLevel") 4)
									(block nil
										
										(newWingMenCent1 gSource)
										
									)
								(eq (objGetData gPlayerShip "fleetLevel") 5)
									(block nil
										(newWingMenCent2)
									)
										
								(eq (objGetData gPlayerShip "fleetLevel") 6)	
									(block nil
										(newWingMenBrit)
									)
								)
							(scrExitScreen gScreen)
						)
							</Action>
Image
Image
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

remove the gsource from

Code: Select all

  (newWingMenCent1 gSource)
might stop the error :D
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
Drako Slyith
Fleet Officer
Fleet Officer
Posts: 1036
Joined: Wed Feb 03, 2010 4:28 am
Location: Researching how to make St. Kats star go supernova.
Contact:

Yeah, that fixed it. Thanks :D
Also, I figured out that you can set up to test a mod, save, then self-destruct, edit, and continue the save game with the changes. (unless of course you are saved in a system that no longer exists, or you are equipped with a weapon that no longer exists, or some other drastic error)
Image
Image
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
Post Reply