Map script to simulate falling out of orbit

I am looking for functions that would help create a script as part of a map that would cause ships to fall if they were destroyed or disabled. This would be applied to maps where ships are in orbit or upper atmosphere. I think a rule that checks if health percentage > 0 or if the ship is in a disabled status would work, but It would also need to apply to salvage debris as well and I can’t think of a way to get those into a sobgroup.



I’ve seen SobGroup_Tumble() in the globals dump, which (depending on what you can feed it) might help. I have found no way to check for a ship being disabled though, if there is one do let me know, we could use it to fudge assimilation :smiley:

If the debris chunks have their own armour type you could put a thing at the bottom of the map which fires a big sphereburst weapon with a negative push (like our black hole). I know it worked on asteroids until we put a stop to that :smile:

You would have to go the rapid-fire, instant, long-range, invisible, negative push beam weapon route.

You could do the sphere burst weapon, but then you would affect all ships, not just those “targeted.”

You would also have to consider that an object with such a weapon could really only target 1 ship at a time to maintain consistency between “firing cycles,” so you would likely need more than 1 of such objects.

I remember a guy made a map for HW2 classic with moving asteroids. I can’t remember how it was done. I also can’t find it anymore. I appreciate that nothing in this post is any help…

Isn’t there a way to have sphere burst weapons target ships that have health under a specific point?

If there’s specific armour families listed in the weapon as having 0 accuracy and 0 penetration then those should be unaffected by a sphereburst I thought… that’s how we stopped asteroids getting dragged off the map with our black hole :thinking:

Nope, although a “finishing blow” kind of weapon would be kinda cool :smiley:

Radiation effect of the HW1’s Nova Station comes to mind.
The ships could also become CPU players to mean loss of control (the “yellow” player) …

1 Like

This would work fine for debris, but you can’t change the armour family of a ship mid-game.

Unfortunately so, but ships that are still “ships” and not firey chunks closely resembling a ship should be able to maintain orbit :thinking:

I’m willing to live with disabled ships sitting there, maybe there are anti grav failsafes until the systems are blown apart. I’ll have to play with the debris sucker guns

This definitely could be plausible enough, if not explicitly “canon.”

OK. It’s doable. Add another armor family and a new weapon and a shield of sorts, like we do in STC. When the shield fails the ‘new’ weapon will start working and the ship will plow into the planet. We use 2 types of weapons. One normal and one X weapon. It took a while to figure it out way back in HW2 days but it works very well. I’m sure it can be adapted. How bad do you want it. People give up too easily, Think outside the box…

I think I found an easier way to do this. The moving asteroids in mission 6 are done using selections. For example:

Selection_GetResources("myselection", "Salvage")
Selection_SetVelocity("myselection", {0, -100000, 0})

I believe that would send all the salvage cunks from destroyed ships “downwards” at their max velocity.

However, all the salvage chunks by default have:


So, you would need to modify that…

EDIT: actually, it is a bit different to how I thought it was…

  • The vector given to Selection_SetVelocity() is a velocity (speed + direction)
  • The number given to NewResourceType.maxVelocity is the maximum distance the salvage will move

So, to make this work for the jadeth map:

  1. /data/scripts/rules/deathmatch/deathmatch.lua


function OnInit()
    if getCurrentLevelName() == "2p_jadeth" then
  1. /data/leveldata/multiplayer/lib/movingsalvage.lua
function MoveSalvageRule()
    salvagecount = Selection_GetResources("AllSalvage", "Salvage")
    asteroidVector = {0, -50, 0}
    Selection_SetVelocity("AllSalvage", asteroidVector)
  1. Change NewResourceType.maxVelocity=0 to NewResourceType.maxVelocity=10000 in all slavage chunk .resource files

50 is probably a bit fast, the collectors were struggling to catch up with the falling salvage!