Reload events

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 333
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Fri Apr 14, 2017 6:39 am

It's reload events are functional? When I applied to a wingmen, it seems does not work. And how to 'reload' non-disposable launcher?
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.34
Great corporate that feature a new items and challenges!
YourCORP v1.11
Build your very own corporation!
Trade Item Extension v1.14
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.3
New weapons that have very unique abilities!
Click this link!

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1394
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Thu Apr 27, 2017 1:48 am

ok: Let me try : I have two thoughts on what you are asking :
A)
you are talking about reloading a weapon' ammo on a wingman for when they run out of Ammo ?

If you are making an .xml :
A) you can do what I do with ships to ensure they have Ammo : I forget exactly whom gave me this code : but I think it was DigDug.
You can put it on the weapon or ship : it ( should not ) work if the weapon is on the Playership.

Code: Select all

		<Events>
		<OnAIUpdate>
             (block (ammoCount)
           (setq ammoCount (objGetItems gSource "*U +thermalShell;"))

               (if (ls ammoCount 20)
                 (objAddItem gSource &itHowitzerCannonShell; (subtract 20 ammoCount))
                   )
              )
             </OnAIUpdate>
		</Events>
B)
you are looking to reload a launcher like the NM900 MissilePod on the Britannia ?

this Pod has a set # of charges : 36 I think it is : On the ship itself you will find :

Code: Select all

		<Events>
			<Reload>
				(block (theMissilePod)
					(setq theMissilePod (item (objGetItems gSource "lI") 0))
					(if theMissilePod
						; Tell the missile pod to reload itself
						(objFireItemEvent gSource theMissilePod "Reload")
						)
					)
			</Reload>
But to tell you the truth, it will not work ( for US ) because there is nothing to fire the event on the ship itself.
I think the event is fired by the CSC base.

What it DOES when activated on the ship is fire the event on the Launcher

Code: Select all

		<Events>
			<Reload>
				; Reloads the pod with missiles
				(objSetItemCharges gSource gItem 36)
			</Reload>
		</Events>
Was I close?
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

User avatar
0xABCDEF
Commonwealth Pilot
Commonwealth Pilot
Posts: 89
Joined: Thu May 19, 2016 12:58 am
Location: Was destroyed by a Phobos-class dreadnought in the Eridani system

Thu Apr 27, 2017 2:27 am

Reload events are not an engine feature, so they never fire on their own. They can be manually fired by functions such as objFireEvent

Code: Select all

<OnFireWeapon>
	(gamEnd Nil "encountered an unexpected error")
</OnFireWeapon>
-Command Screen Library: RTS in a dockscreen
-Extended Justice: A safer Commonwealth for all
-Playership Bones: Revisit your old ship wrecks!
-Please help out our official Documentarist (me) by editing the wiki

User avatar
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1355
Joined: Tue Aug 19, 2014 10:17 pm

Thu Apr 27, 2017 6:11 pm

DigaRW wrote:
Fri Apr 14, 2017 6:39 am
It's reload events are functional? When I applied to a wingmen, it seems does not work. And how to 'reload' non-disposable launcher?
I believe what you want is the code used by the Sapiens Compound, which resets its ammo whenever it runs out so that it can endlessly fire missiles at the player. If you want another piece of example code, my Iocrym mod(link in signature) auto - reloads the Iocrym Command Ship to prevent the planet exploit from being used against it using the same system.

User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 333
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Mon May 01, 2017 9:12 am

I see. I'll try them out. But if they don't works, I think I will make 'Transfer' communication so the player can give specific missile to wingman.
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.34
Great corporate that feature a new items and challenges!
YourCORP v1.11
Build your very own corporation!
Trade Item Extension v1.14
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.3
New weapons that have very unique abilities!
Click this link!

giantcabbage
Commonwealth Pilot
Commonwealth Pilot
Posts: 89
Joined: Thu Apr 07, 2011 9:05 pm

Mon May 01, 2017 10:12 am

In my upgradable wingmen mod you can install missile launchers on your wingmen. They will then automatically reload at stations selling ammo using code similar to their armor repair. Code is in:
https://github.com/gcabbage/Transcenden ... ingmen.xml

Post Reply