I have been thinking about making a "summoner" mod and reading about the GOD mod kinda inspired me that it would not be terribly difficult. But before I start going crazy trying to figure this out perhaps someone has already done it or you experts can give me some pointers.
The idea would be to play as some sort of platform ship that spawns lesser ships. Ideally, as you gained more experience you would be able to summon more powerful ships. I imagine that the ability would recharge like certain weapons.
What do you think would be the best/easiest way to implement this? I think the easiest would be to create an item that you Use in order to create a ship. If I incorporated some kind of level to it, I could present a menu of ships available to create.
Of course, I have only created some simple device mods and player ships at this point - nothing with scripting, but if I can wrap my head around what the scripts are doing I should be able to pull it off.
Any ideas or suggestions?
Edit: I realized that "carrier" was the word I was really searching for so I changed the post subject
Summoner/Carrier Mod
- alterecco
- Fleet Officer
- Posts: 1658
- Joined: Wed Jan 14, 2009 3:08 am
- Location: Previously enslaved by the Iocrym
The idea itself sounds plausible. Most of what I think you would want could be done one way or another. If you are willing to learn to script (and you would have to, to pull this one of), then I say go for it. Spend some time fleshing the idea out, come on irc and ask some questions.
Take a breath, and realise that a good mod takes time to create. Depending on how much time you have on your hands, several days, weeks, months or more. Personally I have been working on my mods for over a year now, and I am still working on them (quite a lot recently even). So, if you only want to spend a few hours getting this done, don't even bother. Start with something simpler.
I think Wolfy made a ship recently that spawns other ships, and you can also pick apart godmod for some code. And again, come on irc and ask there. Sometimes it is easier to get direct feedback. (oh, and be patient on irc. Someone is not around all the time
)
Now, I know this was not direct feedback on your idea, but I hoped it is useful for you anyways.
Take a breath, and realise that a good mod takes time to create. Depending on how much time you have on your hands, several days, weeks, months or more. Personally I have been working on my mods for over a year now, and I am still working on them (quite a lot recently even). So, if you only want to spend a few hours getting this done, don't even bother. Start with something simpler.
I think Wolfy made a ship recently that spawns other ships, and you can also pick apart godmod for some code. And again, come on irc and ask there. Sometimes it is easier to get direct feedback. (oh, and be patient on irc. Someone is not around all the time

Now, I know this was not direct feedback on your idea, but I hoped it is useful for you anyways.

Thanks for your reply and suggestions.
I was able to put together a working carrier ship by looking through the code in the GOD Mod, the charon frigate, the commonwealth carriers, and this post which has details on a hanger item:
http://neurohack.com/transcendence/foru ... php?t=2305
My carrier currently creates one type of ship (hardcoded) as a player wingman, keeps track of the current total, updates when wingmen are lost, and only allows a certain total number of wingmen at a time. I have a few more questions if people have experience in these areas.
1. Is it possible to give credit to the player for wingmen kills? Is there an OnKill or similar event I can trap for with the wingmen to update the aEnemiesDestroyed value? Or is there a better way to do this so the other values like aBestEnemyClass is also updated normally?
2. Certain weapons have recharge rates so they can only be fired so often (like the Ares Lightning Cannon). Is there a similar thing for devices so I can limit how often the player can create ships? My only other idea is to consume fuel when ships are created with shpConsumeFuel, but that seems kinda lame.
3. Similarly, how does usable device power consumption work? Is the full power consumed while the device is installed, or only when it is used?
Once I get all this working I hope to dive into creating a Use Screen so the player can pick which wingman type to create.
I was able to put together a working carrier ship by looking through the code in the GOD Mod, the charon frigate, the commonwealth carriers, and this post which has details on a hanger item:
http://neurohack.com/transcendence/foru ... php?t=2305
My carrier currently creates one type of ship (hardcoded) as a player wingman, keeps track of the current total, updates when wingmen are lost, and only allows a certain total number of wingmen at a time. I have a few more questions if people have experience in these areas.
1. Is it possible to give credit to the player for wingmen kills? Is there an OnKill or similar event I can trap for with the wingmen to update the aEnemiesDestroyed value? Or is there a better way to do this so the other values like aBestEnemyClass is also updated normally?
2. Certain weapons have recharge rates so they can only be fired so often (like the Ares Lightning Cannon). Is there a similar thing for devices so I can limit how often the player can create ships? My only other idea is to consume fuel when ships are created with shpConsumeFuel, but that seems kinda lame.
3. Similarly, how does usable device power consumption work? Is the full power consumed while the device is installed, or only when it is used?
Once I get all this working I hope to dive into creating a Use Screen so the player can pick which wingman type to create.
2: this is from the transpace jumpdrivecapacitorPowerUse is how much power it uses while recharging after use
powerToAcivate is self explanatory, though the units aren't
I don't know exactly how those work, but a bigger reactor will make it recharge faster, for precise control you can count ticks withadd x number of ticks onto the total number of ticks and don't let it make another until the total number of ticks exceeds the stored variable, there won't be a visual.
3: depends, weapons use 1/10 when idle, shields use 1/2? enhancers use full, and I have no idea what miscellaneous devices use, I suspect full.
Code: Select all
<MiscellaneousDevice
powerUse= "100"
capacitorPowerUse= "900"
powerToActivate= "1000000"
/>
powerToAcivate is self explanatory, though the units aren't
I don't know exactly how those work, but a bigger reactor will make it recharge faster, for precise control you can count ticks with
Code: Select all
(unvGetTick)
3: depends, weapons use 1/10 when idle, shields use 1/2? enhancers use full, and I have no idea what miscellaneous devices use, I suspect full.
Awesome, thanks! That is exactly what I was looking for on questions 2 and 3!
It looks like the powerToActivate is the total power needed to recharge before it can be used again and capacitorPowerUse is how much it recharges at each tick, so you can say how much power will be drained for powerToActivate / capacitorPowerUse ticks.
It looks like the powerToActivate is the total power needed to recharge before it can be used again and capacitorPowerUse is how much it recharges at each tick, so you can say how much power will be drained for powerToActivate / capacitorPowerUse ticks.
- alterecco
- Fleet Officer
- Posts: 1658
- Joined: Wed Jan 14, 2009 3:08 am
- Location: Previously enslaved by the Iocrym
For the wingman counter you have to use events. There is an event called OnDestroyed that tiggers on, well, destroy.
If you are building the wingmen yourself in xml it is quite easy. You probably have some event that is called when they attack a ship, if not run in it an OnUpdate or similar. Use the facility to register an event listener on the ship the wingman is currently targeting and listen for OnObjDestroyed. basically it would go a bit like this
Wingman
OnUpdate
Check if we have a target, and if that target is already being listened for events on (objGetData target "AmIListeningForEvents")
If not, register for events (objRegisterForEvents target obj) and set the data that you are listening (objSetData target "AmIListeningForEvents" True)
OnObjDestroyed
This will trigger when one of the targets the wingman has registered for events with is destroyed. In here you can do your bookkeeping.
Hope that little bit made sense. If not just ask for clarification

If you are building the wingmen yourself in xml it is quite easy. You probably have some event that is called when they attack a ship, if not run in it an OnUpdate or similar. Use the facility to register an event listener on the ship the wingman is currently targeting and listen for OnObjDestroyed. basically it would go a bit like this
Wingman
OnUpdate
Check if we have a target, and if that target is already being listened for events on (objGetData target "AmIListeningForEvents")
If not, register for events (objRegisterForEvents target obj) and set the data that you are listening (objSetData target "AmIListeningForEvents" True)
OnObjDestroyed
This will trigger when one of the targets the wingman has registered for events with is destroyed. In here you can do your bookkeeping.
Hope that little bit made sense. If not just ask for clarification

That does make sense, but I am not creating new ships for wingmen, I am just creating existing ships (for example a Charon Corsair-class Gunship). Is it possible to attach an event to an existing object in code?
So if I have this:
Is there a call where I can then add an OnUpdate to the fighter object? Or can that only be done by creating a new ShipClass object?
Here are a few other random questions:
1. Is (objGetSovereign theCarrier) the right call to make? Would that set the new ships as being svPlayer? Is that OK? Or should I just make them svIndependent? Are there any side-effects of setting the sovereign that I should be aware of?
2. I have setup an item for each of the ships that a player can create. Think of these like spells in an RPG that the player can learn. As you go through the game, you will pick up the ability to create more powerful ships by picking up these items. I needed a way for the item to tell me what kind of ship it links to (the UNID) so I was trying to use ObjSetData on the object in the OnCreate event, but it is not firing. Any idea why?
Here is a sample:
There are many advantages to doing it this way, but one of the biggest ones is that I can easily tie into the DockScreen logic for selecting what ship to launch by using this:
3. This is all working well (dockscreen selection, etc), except that the OnCreate is not triggering. My debug statement in there never fires. The item comes preinstalled on my carrier player ship. That means that when I try to find the UNID of the ship to create I get nothing.
Is there a better way to set that UNID link in the item? Or a better event to use?
Edit: typo
So if I have this:
Code: Select all
; Create the new ship
(setq fighter (sysCreateShip theFighter (objGetPos theCarrier) (objGetSovereign theCarrier) "Fleet"))
; Set new ship as an escort for the carrier
(shpOrderEscort fighter theCarrier)
; Tag the fighter as coming from the carrier
(objSetObjRefData fighter "carrier" theCarrier)
; Register to receive the fighter events so we know when it is destroyed
(objRegisterForEvents theCarrier fighter)
Here are a few other random questions:
1. Is (objGetSovereign theCarrier) the right call to make? Would that set the new ships as being svPlayer? Is that OK? Or should I just make them svIndependent? Are there any side-effects of setting the sovereign that I should be aware of?
2. I have setup an item for each of the ships that a player can create. Think of these like spells in an RPG that the player can learn. As you go through the game, you will pick up the ability to create more powerful ships by picking up these items. I needed a way for the item to tell me what kind of ship it links to (the UNID) so I was trying to use ObjSetData on the object in the OnCreate event, but it is not firing. Any idea why?
Here is a sample:
Code: Select all
<ItemType UNID="&itCharonCorsairFighter;"
name= "Corsair-class Gunship launcher"
level= "1"
value= "0"
mass= "0"
frequency= "notrandom"
numberAppearing= "1"
modifiers= "MajorItem; Fighter1"
description= "Launch a Corsair-class Gunship."
>
<Image imageID="&rsMediumShips1;" imageX="288" imageY="0" imageWidth="48" imageHeight="48" rotationOffset="-10" imageFrameCount="0" imageTicksPerFrame="0"/>
<MiscellaneousDevice
powerUse= "0"
deviceSlots= "0"
/>
<Events>
<OnCreate>
(block Nil
; Initialize fighterUNID
(objSetData gSource "fighterUNID" &scCorsair;)
(dbgOutput (cat "fighterUNID data: " (objGetData gSource "fighterUNID")))
)
</OnCreate>
</Events>
</ItemType>
Code: Select all
<ListOptions
dataFrom= "player"
list= "*I+Fighter1"
/>
Is there a better way to set that UNID link in the item? Or a better event to use?
Edit: typo
- alterecco
- Fleet Officer
- Posts: 1658
- Joined: Wed Jan 14, 2009 3:08 am
- Location: Previously enslaved by the Iocrym
About the events.
There is a new set of functions avaialbe in the rc's that deal with event handlers. Event handlers are base ShipClasses that can be virtual. On these you can define Events and then at any time attach that event handler to a ship as it's event handler. Look at &evStdPatrolEncounterBehavior; in vanilla for examples of how to use it. There is a small chance that others will overwrite your handlers since the game does not have inheritance atm, so you should be aware of that.
As for your questions.
1) (objGetSovereign theCarrier) would return the sovereign of the carrier, which ever that is. If you want the summoned ships to have the same alignment as the player then try using svPlayer, otherwise svFriendlyAuton might be worth using. You could always define your own sovereign with the dispositions you want.
2) Items don't have OnCreate. Perhaps you can use OnInstall instead.
Try looking here for some docs on items http://wiki.neurohack.com/transcendence/wiki/itemtype
There is a new set of functions avaialbe in the rc's that deal with event handlers. Event handlers are base ShipClasses that can be virtual. On these you can define Events and then at any time attach that event handler to a ship as it's event handler. Look at &evStdPatrolEncounterBehavior; in vanilla for examples of how to use it. There is a small chance that others will overwrite your handlers since the game does not have inheritance atm, so you should be aware of that.
As for your questions.
1) (objGetSovereign theCarrier) would return the sovereign of the carrier, which ever that is. If you want the summoned ships to have the same alignment as the player then try using svPlayer, otherwise svFriendlyAuton might be worth using. You could always define your own sovereign with the dispositions you want.
2) Items don't have OnCreate. Perhaps you can use OnInstall instead.
Try looking here for some docs on items http://wiki.neurohack.com/transcendence/wiki/itemtype
If you have a working dockscreen that will display your wingman items, I would place the shipclass unid in static data and have the dockscreen check that. It's much less messy than worrying about setting data on items or objects that could be overwritten.
If you are using the vanilla ships as your wingman, you should consider creating an event handler to apply to them which can inherit from the standard wingman event handler giving them all the commands and communication skills that rama or volkov would have. That would also be an excellent place to put all your custom events for tracking onDestroy etc.
There is a basic event handler in VUI that is used with the overmind cyberdeck that does precisely this.
This sounds very promising, I can't wait to try it out!
If you are using the vanilla ships as your wingman, you should consider creating an event handler to apply to them which can inherit from the standard wingman event handler giving them all the commands and communication skills that rama or volkov would have. That would also be an excellent place to put all your custom events for tracking onDestroy etc.
There is a basic event handler in VUI that is used with the overmind cyberdeck that does precisely this.
This sounds very promising, I can't wait to try it out!
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
Very helpful information. Thanks to both of you!
StaticData did the trick and is much, much cleaner than the method I was trying to use.
I have tried messing with the wingmen events to track kills, but it has turned out to be problematic. I have given up for now because it is not as important, but I will come back to it later. Primarily, it would be nice to have access to whatever is fired when the player kills a ship, or an OnKill event. Even if I manage to correctly trap wingmen kills, I have no way of updating the global vars that seem to be used for that (aEnemiesDestroyed, aBestEnemyClass, etc). I think I will need intervention from George to get that part working.
I am not sure what is meant by VUI and I couldn't find any reference to an "overmind" cyberdeck in the source. Is that something in a mod?
On the positive side, the wingmen stuff is working nicely. At first, changing my sysCreateShip to use my behavior class instead of "fleet" caused me grief, but I have coded almost all the wingmen commands so they work correctly now. As a bonus, the wingmen now repair armor, etc like normal wingmen instead of acting like autons.
One thing I cannot figure out how to replicate, though, is the Formation commands. I also cannot find it in the code, so I presume that it is built-in somehow. Any ideas on that? It is not really necessary, but would be nice to have for a carrier ship.
Two more questions for now...
1. Is there a way to automatically exit a dockscreen? Once the ship type to launch is selected, all I can figure out to do is send the player to a "Done"-type screen. It would be really nice to just take them straight out of the dockscreen to minimize keystrokes. Can this be done?
2. Now that I am using a dockscreen, I notice that my item is not being "Invoked" normally, so the recharge stuff (capacitorPowerUse and powerToActivate) is not happening anymore. Can I manually kick these off somehow? I suppose that I could programmatically open a dockscreen using the dockscreen framework mod, but I don't like the idea of having dependancies if they can be avoided.
StaticData did the trick and is much, much cleaner than the method I was trying to use.
I have tried messing with the wingmen events to track kills, but it has turned out to be problematic. I have given up for now because it is not as important, but I will come back to it later. Primarily, it would be nice to have access to whatever is fired when the player kills a ship, or an OnKill event. Even if I manage to correctly trap wingmen kills, I have no way of updating the global vars that seem to be used for that (aEnemiesDestroyed, aBestEnemyClass, etc). I think I will need intervention from George to get that part working.

I am not sure what is meant by VUI and I couldn't find any reference to an "overmind" cyberdeck in the source. Is that something in a mod?
On the positive side, the wingmen stuff is working nicely. At first, changing my sysCreateShip to use my behavior class instead of "fleet" caused me grief, but I have coded almost all the wingmen commands so they work correctly now. As a bonus, the wingmen now repair armor, etc like normal wingmen instead of acting like autons.
One thing I cannot figure out how to replicate, though, is the Formation commands. I also cannot find it in the code, so I presume that it is built-in somehow. Any ideas on that? It is not really necessary, but would be nice to have for a carrier ship.
Two more questions for now...
1. Is there a way to automatically exit a dockscreen? Once the ship type to launch is selected, all I can figure out to do is send the player to a "Done"-type screen. It would be really nice to just take them straight out of the dockscreen to minimize keystrokes. Can this be done?
2. Now that I am using a dockscreen, I notice that my item is not being "Invoked" normally, so the recharge stuff (capacitorPowerUse and powerToActivate) is not happening anymore. Can I manually kick these off somehow? I suppose that I could programmatically open a dockscreen using the dockscreen framework mod, but I don't like the idea of having dependancies if they can be avoided.
1. (scrExitDock gScreen) or <Exit/>
2. I don't know, you could always count ticks and go to a different screen if it hasn't been long enough. perhaps use an overlay to signify when it is fully recharged.
if you want the formations I think you need to use the fleet controller, but you can have your code change the controller when it needs to do something like repair armor, then change it back to fleet when done/recalled to formation.
2. I don't know, you could always count ticks and go to a different screen if it hasn't been long enough. perhaps use an overlay to signify when it is fully recharged.
if you want the formations I think you need to use the fleet controller, but you can have your code change the controller when it needs to do something like repair armor, then change it back to fleet when done/recalled to formation.
VUI is my mod. it can be dowloaded here. The overmind cyberdeck will take control of other ships and there is a chance of turning them into wingmen, with all the normal functionality of a normal wingman. It can be found in /VUI/Software/cyberdecks.xml starting at line 477. The event handler that inherits from the wingman base class is right below it.I am not sure what is meant by VUI and I couldn't find any reference to an "overmind" cyberdeck in the source. Is that something in a mod?
#2 - You can manually recharge the wingman spawn by firing a timed event on the mothership.
Code: Select all
; Spawn new ship (if local var is valid)
set local var to nil
fire timed event
; timed event fires
reset local var to true
; can now spawn another ship
To track kills you will have to register all the enemies within a certain radius to your mothership. Then the <onObjDestroyed> event can check the aDestroyer var against the mothership and wingman IDs to see if any of them killed the enemy ship. You could then track that total on the mothership to be used for whatever you need.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
Thank you again for very helpful replies! Yesterday was very productive.
(scrExitDock gScreen) was exactly what I was looking for with the dockscreen, so now that exits out immediately.
I got the wingman kill count working. The suggestion to just pre-register all the nearby enemies helped enormously. Previously I was trying to track the wingmen targets but that got complicated and caused errors that I couldn't track down. This is much simpler and more elegant.
After that I spent some time working on the carrier skill process and that is coming along nicely.
I would like to give the player a chance to learn new ships when he docks with a wreck of that type of ship. I cannot find an event like OnDock that would let me do that though. Does something like that exist? There is an OnObjDocked, but that seems to only run on the object docked with.
(scrExitDock gScreen) was exactly what I was looking for with the dockscreen, so now that exits out immediately.
I got the wingman kill count working. The suggestion to just pre-register all the nearby enemies helped enormously. Previously I was trying to track the wingmen targets but that got complicated and caused errors that I couldn't track down. This is much simpler and more elegant.
After that I spent some time working on the carrier skill process and that is coming along nicely.
I would like to give the player a chance to learn new ships when he docks with a wreck of that type of ship. I cannot find an event like OnDock that would let me do that though. Does something like that exist? There is an OnObjDocked, but that seems to only run on the object docked with.
You could check to see if the player is docked with something by using (staGetDockedShips station) with nearby stations.
The trouble will be determining what ship the wreck used to be, because a wreck is a station, a whole new object with as far as I can tell, no data from the original ship except the name, which you might be able to try matching.
The trouble will be determining what ship the wreck used to be, because a wreck is a station, a whole new object with as far as I can tell, no data from the original ship except the name, which you might be able to try matching.
- alterecco
- Fleet Officer
- Posts: 1658
- Joined: Wed Jan 14, 2009 3:08 am
- Location: Previously enslaved by the Iocrym
Again you would have to register for events with the wreck, and then listen for OnObjDocked. You can register in the OnObjDestroyed assuming you have that triggered (register on the aWreckObj if I recall correctly)Styro wrote: I would like to give the player a chance to learn new ships when he docks with a wreck of that type of ship. I cannot find an event like OnDock that would let me do that though. Does something like that exist? There is an OnObjDocked, but that seems to only run on the object docked with.