Firstly, we really need a rigged unit cannon in order to do anything as the model lacks bones. Next, we need to decide which type of UC we want. Factory will be easier to do but less functional. "Load N' Shoot" will be harder to do, maybe not even possible with our current tools, but more functional. If we do factory, then we need to create a factory that is able to build all land units. Easy enough. Bones should define where they are made, although I suggest somewhere inside of the model. It should have a very high metal consumption and fairly low energy consumption with a high cost. In order to make the units be shot somewhere upon completion, the following code should be used: Code: "deploy_projectile": "path", The deplay projectile should be staged. Code: "flight_type": "Staged", Example stage code from the orbital rocket: Code: "stages": [ { "ignores_LOS": true, "ignores_gravity": true, "rotates_to_velocity": true, "stage_duration": 300, "stage_turn_rate": 0 }, { "climb_angle": 45, "ignores_LOS": true, "ignores_gravity": true, "rotates_to_velocity": true, "stage_change_height": 200, "stage_duration": 0, "stage_turn_rate": 90 }, { "apply_thrust": false, "climb_angle": 45, "ignores_LOS": false, "ignores_gravity": false, "rotates_to_velocity": true, "stage_duration": 1000 }, { "apply_thrust": false, "die_here": true, "ignores_LOS": false, "ignores_gravity": false, "release_payload": true, "rotates_to_velocity": true, "stage_duration": 0 } ], The important part is the section that tells it to die, which I believe is when the projectile is destroyed and the unit is released. This should be all it takes to make a factory based unit cannon. For it to be a "load and shoot" style unit that loads units and then shoots them, we would have to define a new type of usability. The teleporter has the following code dedicated to this: Code: "useable": { "range": 30, "type": "teleporter" I am not sure if there is other code somewhere that determines exactly what that type means, so if implementing this is possible at this point is unknown. If anyone knows any further information on this matter, I would appreciate it. Thoughts?
The problem I see is that I think you misinterpreted the stage system (key word being "think"). If you can only control the stage duration then getting the unit to deploy at the right time at any range would be impossible. Another way of saying it is that it works for orbital because the orbital layer is at a set height above the ground layer.
But you can set rally points for the orbital launcher where the rocket could take the unit to just above the launcher or it could take it halfway around the planet. I'm not sure, but I hypothesize that the second stage with a duration of 0 is sort of an "infinite until it reaches its destination" stage. If someone from Uber could help us out, that'd be great!
Apparently Uber changed how orbital factory rally points worked recently. Never play orbital so didn't notice. I'll be needing old code in that case. I've already pmed @raevn about it, but if anyone could supply me with some code from mid-beta (about November of 2013 or build 56821) for the orbital launcher and the orbital missile booster I'd be grateful. This is actually the last hurdle remaining before I can implement and factory based UC. That and getting a model for the delivery system.
To get a load-and-shoot UC, stuart, I think you'll need access to the core engine coding so you can add in the physics functionality as well as the background support necessary. I'm interested to see where this goes - and hopefully Uber gets the UC done SOON.
I’d ask about the main goal here. If it’s just to get a working UC in the game to prove it can be done so UBER will build it then I’d suggest pirating another unit model. I am new to the modding but I’d like to get into it so forgive any ignorance in my suggestions here. If you took say the Holkin unit, and added to it the functionality of say the transport or the astreus, so that you could load units into it. What it fires is a single use pod (a spike) that say has a 12 unit capacity. The UC fires the pod (planet to planet) and either you skip the orbital path entirely and just spawn the pod after a certain duration or you pull the astreus or orbital fighter pathing for the move to send the pod/spike over. Then call the shell for when a commander spawns at the beginning of the game and have the pod slam down into the planet, cause a minor area of effect damage (and ideally a small stun state on any units or turrets in the area) and then the spike automatically unloads the units and decays into a reclaimable shell. Of course you’d have to change the shot duration for the UC (holkin) so it takes longer to load and shoot. But this unit could actually serve two purposes. Orbital artillery would be a dream to play with, and this UC could serve as both a slow firing, minimal damage but large area, orbital cannon as well as a unit cannon. Imagine a stack of bomb bots stuffed in a round shot from such a UC. Having the umbrella system, as well as any anti air weapon able to attack the rounds would probably be ideal for balancing. However, having to retreat a base due to shelling from another planet adds another layer to strategy. I’m fully in support of your mod here. I’d like to try out anything you have. Cheers, Jester
Wouldn't it be far easier to create a new class of units that are built regularly but act as orbital units (i.e. can be sent between planets)?
Loading the unit into the factory is only one of two problems. The other one is aiming. "factory"->"deploy_projectile" creates a projectile with an unit attached and launches it. "tools"[]->"ammo_id" creates a projectile which gets it's target from the corresponding tool. First one has no target set, and can only go straight in the direction of the spawn bone. Second one has no unit attached to the projectile. Right now, it's impossible to have a unit canon both launch AND aim a unit. Well ok, probably not true. And I already DO have an idea how to hack it in First, we must assume that "release_payload" also works for non-staged projectiles. If it doesn't, we are screwed. Now we have to create a "TOOL_Weapon" on the unit canon with an invisible, 0-damage projectile which has the same ballistic properties as the unit cannon shell. The aim-bone of the weapon is the same as "factory"->"spawn_points". Now the bone will orientate itself in the precise direction required to shoot a ballistic projectile with the specific properties at the location marked with the attack command. When the unit is shot from the same bone, it should travel the precise same course and land in the target location. Anyone dares to try? Well, there are problems, of course. There is no target selection system which could enforce VALID targets. You might as well target unreachable or completely invalid locations with the unit canon. And it's probably going to be rather inaccurate, because even "ballistic" projectiles have "turn_rate" set which is probably used for course correction on long shots. So if no target is passed down from the "TOOL_Weapon", it's probably going to miss.