Creating ship reinforcements

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 need some help making ships a distance away and then come in and patrol around a station. My code is

Code: Select all

			<OnCreate>
				(sysAddObjRecurringTimerEvent 5 gSoruce "OnReinforce")
			</OnCreate>
			<OnReinforce>
						(block nil
							(setq reinforce
								(sysCreateShip 
									&scHurinDestroyer;
									(sysVectorPolarOffset gSource (random 0 359) 35)
									&svHuariEmpire;
									)
							(shpOrder reinforce 'patrol gSource 15)
						
						)
						
			</OnReinforce>
I don't know why it working. Noting is happening at all. What's wrong with the code?
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?
Amilir
Militia Lieutenant
Militia Lieutenant
Posts: 151
Joined: Fri Feb 12, 2010 4:56 pm
Location: With the stRong.

(sysAddObjRecurringTimerEvent 5 gSoruce "OnReinforce")
First, I'd spell gSource correctly. Second, I'd move the first item in your block to OnCreate. No point redoing it every time you spawn another ship.
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 not quite sure what you mean. I need a steady stream of ships coming in.
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?
Amilir
Militia Lieutenant
Militia Lieutenant
Posts: 151
Joined: Fri Feb 12, 2010 4:56 pm
Location: With the stRong.

If I understand Tscript:

Code: Select all

(setq reinforce
                        (sysCreateShip
                           &scHurinDestroyer;
                           (sysVectorPolarOffset gSource (random 0 359) 35)
                           &svHuariEmpire;
                           )
That sets reinforce to the value:

Code: Select all

(sysCreateShip
                           &scHurinDestroyer;
                           (sysVectorPolarOffset gSource (random 0 359) 35)
                           &svHuariEmpire;
                           )
It doesn't actually do anything until reinforce is used. As such, your code sets reinforce to the same thing over and over again. A waste of resources.
Post Reply