Reload events
- DigaRW
- Militia Captain
- Posts: 517
- Joined: Thu Jul 30, 2015 3:10 pm
- Location: The place where I belong
- Contact:
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!
Click this link!
Click this link!
-
- Fleet Officer
- Posts: 1533
- Joined: Tue Mar 22, 2011 8:43 pm
- Location: Alaska
- Contact:
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.
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 :
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
Was I close?
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>
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>
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>
Flying Irresponsibly In Eridani......
I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
- 0xABCDEF
- Militia Lieutenant
- Posts: 124
- Joined: Thu May 19, 2016 12:58 am
- Location: Was destroyed by a Phobos-class dreadnought in the Eridani system
Reload events are not an engine feature, so they never fire on their own. They can be manually fired by functions such as objFireEvent
-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
-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
-
- Fleet Officer
- Posts: 1452
- Joined: Tue Aug 19, 2014 10:17 pm
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.
- DigaRW
- Militia Captain
- Posts: 517
- Joined: Thu Jul 30, 2015 3:10 pm
- Location: The place where I belong
- Contact:
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!
Click this link!
Click this link!
-
- Militia Lieutenant
- Posts: 104
- Joined: Thu Apr 07, 2011 9:05 pm
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
https://github.com/gcabbage/Transcenden ... ingmen.xml
My mods on github: https://github.com/gcabbage/TranscendenceMods