[SCRIPTING] Cataclysm Acolyte script

(Taiidan Republic Mod) #1

@herobrine101902 contacted me about making a cataclysm acolyte script for HWRM.

My own linking scripts are a bit different (plaforms) and I know others (@Nathanius I am looking at you) have experience in this area, so I thought we could discuss publicly.

Clearly this would have to be a customcode script. The problem (as I see it) is that if the linking is done by docking, the player could press “d” and not know whether the acolytes would link with each other or dock with a carrier/mothership…

Anyway, this is how I do HOD swapping:

print("swapping HOD")

-- Store the position and rotation of the old HOD
temppos = SobGroup_GetPosition(OldGroup)
tempcoords = SobGroup_GetCoordSys(OldGroup)

-- Create the new ship
SobGroup_Create("new"..shipID)
SobGroup_SpawnNewShipInSobGroup(playerIndex, TargetShipType, "sqn_"..shipID, "new"..shipID, "NewSpawnVolume"..playerIndex..shipID)
SobGroup_SetPosition("new"..shipID, temppos)
SobGroup_SetTransform("new"..shipID, tempcoords)

-- Remove the old platform
SobGroup_MakeDead("trp_platform_"..shipID)

My suggestion would be to trigger this once the docking acolyte (the lower one) is docked with the top one. The new HOD would be the combined acolyte. Anyone got any better ideas?

2 Likes
(Hero Crafter 1987 (Homeworld Universal Conquest Mod)) #2

I was thinking of instead of using the docking command, what about using a custom command instead. I’m saying this because I’m using an animation for when the link process begins. It activates when the custom command is used.

(Hero Crafter 1987 (Homeworld Universal Conquest Mod)) #3

And also, why not make another platform script but instead it uses two of the same ship instead of three different ones?

(Nathanius) #4

The STC MVAM and Galaxy separation scripts work very differently to how I would attempt to write them now, they were done by Stargazer for the old version of Homeworld 2 of course though.

There is a set of global tables constantly checking for dock or launch events for all the various parts involved and then the HOD on the map is swapped for the docked ship bits or vice versa. There’s also some calculations on the side to adjust health up or down depending on current HP and other things.

A custom script would probably do a much neater job of it

(Taiidan Republic Mod) #5

Yes, you could adapt my platform script. It uses custom code and swaps HODs on docking, which is probably what you want to do. I would recommend destroying the two acolytes and spawning one new ship (the combined one) on linking.

(Hero Crafter 1987 (Homeworld Universal Conquest Mod)) #6

I also have an idea, In the FX Galaxy mod, the turanic azrael attacker has a script that combines two ships in one. I will try to see if I can use that script to help with this.

(Hero Crafter 1987 (Homeworld Universal Conquest Mod)) #7

The resource collector actually may be helpful too because its ability to latch onto other ships.

(Taiidan Republic Mod) #8

The magic is not in the resource collector (it does not have a special latch ability), the magic is in the ship it latches on to. Check out the example ship hgn_carrier for an example.

(Taiidan Republic Mod) #9

Did you get this working in the end @herobrine101902 ?

(Hero Crafter 1987 (Homeworld Universal Conquest Mod)) #10

No I didn’t.