Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Kusanagi on December 26, 2010, 05:12:36 pm
-
Need somehelp/mutual brainstorming with figuring out how to make a few things work with a combination of FRED, scripting, and the tables.
1) Mines
I know that certain mods such as Cardinal Spear and Derelict have used both ship classes and actual weapons as mines but they are all stationary. Basically in Homeworld, when a mine is sitting in space (either dumped there by a corvette or there by mission design) it hangs there until an enemy ship comes into range. It then activates and kamikazes into whatever got within range.
I've tried about half a dozen ways to replicate this effect with both weapons and various ship designs and a combination of the two. Having a ship play dead until something else comes in range and then activating an ai-chase-any and a kamikaze flag doesn't work. Tried setting the ship as either a cruiser or a fighter and it won't try to kamikaze.
The only other thing that I've thought about doing is having the mine as a ship and then spawning a weapon when something gets close with the "untargeted heat seeker" flag but this isn't working either, and that's just for mines that can be placed in FRED. I don't even know if it's possible to set a mine from a player ship that has this behavior...
2) Player docking
Is there any way to take control of the player ship and order it to dock with another ship? We need this for support frigates and the like. The idea would be to close within about 100 yards of the ship and hitting a button that would take control of the ship from you and have your fighter dock with the frigate for a few seconds. You then undock and get control back fully repaired and rearmed.
3) Repair Beams
Any combination of scripting or FRED that can make this possible? I'd like to be able to have a working repair beam that actually repairs damage when it hits as opposed to taking it away, even if it's for cosmetic effect. Being able to have a support frigate or corvettes rumble over to damage capital ships and repair them would be something amazing to have.
Any thoughts on the best way to accomplish these things?
-
For repair beam, try fire-beam SEXP and a beam with negative damage.
For docking, search FRED forums (the thread was called "Reprobator's noob-ish questions emporium" or something like this).
For mines, try to use an immobile missile with $Detonation radius: set, which would spawn a homing mine (and weapon-create to get it in FRED).
-
1) Mines
I know that certain mods such as Cardinal Spear and Derelict have used both ship classes and actual weapons as mines but they are all stationary. Basically in Homeworld, when a mine is sitting in space (either dumped there by a corvette or there by mission design) it hangs there until an enemy ship comes into range. It then activates and kamikazes into whatever got within range.
I've tried about half a dozen ways to replicate this effect with both weapons and various ship designs and a combination of the two. Having a ship play dead until something else comes in range and then activating an ai-chase-any and a kamikaze flag doesn't work. Tried setting the ship as either a cruiser or a fighter and it won't try to kamikaze.
The only other thing that I've thought about doing is having the mine as a ship and then spawning a weapon when something gets close with the "untargeted heat seeker" flag but this isn't working either, and that's just for mines that can be placed in FRED. I don't even know if it's possible to set a mine from a player ship that has this behavior...
If you have a limited list of ships which can come into contact with the mine, you might try using argument-based events to make it attack the specific ship that comes near it, and then later self-destruct it (with a special explosion set) as it comes within a certain distance of its target.
2) Player docking
Is there any way to take control of the player ship and order it to dock with another ship? We need this for support frigates and the like. The idea would be to close within about 100 yards of the ship and hitting a button that would take control of the ship from you and have your fighter dock with the frigate for a few seconds. You then undock and get control back fully repaired and rearmed.
Take control of the player ship with player-use-ai (http://www.hard-light.net/wiki/index.php/Player-use-ai).
3) Repair Beams
Any combination of scripting or FRED that can make this possible? I'd like to be able to have a working repair beam that actually repairs damage when it hits as opposed to taking it away, even if it's for cosmetic effect. Being able to have a support frigate or corvettes rumble over to damage capital ships and repair them would be something amazing to have.
Dunno if it would work, but a weapon with negative damage might do it. Or it all else fails, you can use a combination of arithmetic operators, hits-left and repair-subsystem to fake repair operations. Combine it with a distance operator so they only happen when the repair ship is close and it might even look decent.
-
About 1, if the mines are set up correctly as ships with the play-dead order, and are supposed to go kamikaze if enemies get sufficiently close, it should definitely work. Try to use ai-chase instead of ai-chase-any, that may do the trick.
Also, you may wish to take a look at this (http://www.hard-light.net/wiki/index.php/Script_-_Proximity_Trigger) script.
I believe there's a shortcut for 2. Just use player-use-ai and order the player's fighter/bomber to reach a designated waypoint to simulate a fake docking procedure. After that, you can repair the player via SEXPs as you would in a normal situation.
If it's impossible to create a beam that adds hitpoints, use a combo of fire-beam and set-subsystem-strength or repair-subsystem. That should be the cheapest way to represent repair beams.
:)
EDIT: Wow, two posts before my own. :yes:
-
Don't know if it helps, But i have experimented with a mine quite some years back.
WCS uses a correctly working IFF Missile. After launch, it tracks the closest enemy. Always funny, flee from an enemy, fire the missile in flight direction, and then it turns back and hit the enemy that follows you :)
I then used that entry for a mine. I just made it very slow, with an incredible long lifetime. That way, you can create mines that can be deployed within the missions from the player or other vessels..
Creating a stationary minefield with that effect, I have no real idea unfortunately. When I created one, with a proximity trigger, it mostly executed the entire minefield. If I gave the mines stronger hulls for direct impact explosion, they become to strong.
The only stupid idea I have, is that :
Create a mine, that is actually a stationary missile launcher. Try to script it that way, that it launches a single missile (a mine)
without any sound (set in the weapons.tbl) which could then follow the targeted ship. The "launcher" should vanish after it's secondary (only 1 mine allowed) is depleted. Complicated, but it could work.
For your information, the IFF Missile is done the same way.
The actual missile is invisible. It explodes right after start (without any explosion and sound) and spawns one single missile, that I copied from one of the retail synaptic bombs). That way, I got a working IFF missiles.
Try it. While writing this, I think it could really work that way :)
Good luck ! :)
-
For repair beam, try fire-beam SEXP and a beam with negative damage.
For docking, search FRED forums (the thread was called "Reprobator's noob-ish questions emporium" or something like this).
For mines, try to use an immobile missile with $Detonation radius: set, which would spawn a homing mine (and weapon-create to get it in FRED).
Beams or weapons in general with a negative damage don't work, just resorts to 0.
The first solution would work for a player launched mine and would have to be tweaked for the other mine at the beginning of a mission. Sounds like a good solution - I'll have to try it.
EDIT #1: When you take control of the player with player-use-ai, you can't give that ship a docking order.
-
**Trivial Psychic thinks we need a form of auto-generated minefield system using the same placement code as asteroid fields**
-
About 1, if the mines are set up correctly as ships with the play-dead order, and are supposed to go kamikaze if enemies get sufficiently close, it should definitely work. Try to use ai-chase instead of ai-chase-any, that may do the trick.
Also, you may wish to take a look at this (http://www.hard-light.net/wiki/index.php/Script_-_Proximity_Trigger) script.
I believe there's a shortcut for 2. Just use player-use-ai and order the player's fighter/bomber to reach a designated waypoint to simulate a fake docking procedure. After that, you can repair the player via SEXPs as you would in a normal situation.
If it's impossible to create a beam that adds hitpoints, use a combo of fire-beam and set-subsystem-strength or repair-subsystem. That should be the cheapest way to represent repair beams.
:)
EDIT: Wow, two posts before my own. :yes:
Can ships kamikaze into other ships with the "fighter" flag enabled? When the mine is set as a fighter, you can use the "ai-chase-any" flag. The problem is that the fighter won't kamikaze into anything - just get within about 150 meters of you and won't turn until you turn to face it.
Setting the mine as a cruiser only has it ram whatever capital ship you specifiy with the ai-chase command. How can I use an argument to get the ship to kamikaze whichever ship was the one that got close to it, including fighters?
I've had SOME luck with creating a weapon that explodes and spawns an identical mine that tracks a target, but still no go. I would want it to detonate when SOMETHING gets in range, and then the baby weapon has the "inherit parent target" flag. The problem is getting the original dropped mine to blow up in the first place when an enemy gets in range. No luck so far there :(
-
Well, I'd still say to use ai-chase instead as it makes events more effective. When <argument> is close to Mine X, Mine X will chase <argument>. It'd be even more effective thanks to string variables.
-
Are there any good threads or articles on the wiki that explain how to use the scripts/arguements? I think the script may be the best way to go, but I don't know how to get it to work in game.
-
Treat scripts as normal tables. Place the luas in data/scripts and the scripts themselves in data/tables. :)
-
Tried it...none of the examples in the wiki work, including the tutorial scripts and the one you linked end up working. The wiki desperately needs to be updated since so many command have either been dropped or changed from what they were.
I may have to just post in the scripting forum for the mines as that seems to be the way to go. Once a ship gets in range of the mine, "detonate" it so it spawns an identical mine that then goes after its target.
-
Have you created lua files properly?
-
I don't have a compiler, so no. I wasn't aware I needed to...something else that should be on the wiki :P
-
With help from several people, the mine script works for player launched mines. The second version, the one that has tracking mines as ships, doesn't work quite yet.
-
Are you using countermeasure POFs as mines?
-
Yes, as a placeholder until I get the Kushan mines converted.
Is there a suitable ingame model to test it with besides the countermeasure POF?
-
I'm actually interested on countermeasures. You know, they almost look like space mines, and there even was a campaign (Cardinal Spear?) who made them play that role.
-
For the mine, here is an idea:
A static object, which has an infinite lifetime. When a target gets really close, it explodes (with 0 damage and an invisible explosion) and spawns a maneuvrable heatseaker with great damage.
Launch mine >> Enemy ship approaches mine >> Mine explodes >> A mine-spawn comes from the mine >> The spawn homes in on an enema.
-
For the mine, here is an idea:
A static object, which has an infinite lifetime. When a target gets really close, it explodes (with 0 damage and an invisible explosion) and spawns a maneuvrable heatseaker with great damage.
Launch mine >> Enemy ship approaches mine >> Mine explodes >> A mine-spawn comes from the mine >> The spawn homes in on an enema.
Enema mines?! Yikes! :eek2:
-
Wouldn't that result in oddities should the ship evade the missile? And what if there are 2 or more ships within detonation range?
-
Wouldn't that result in oddities should the ship evade the missile? And what if there are 2 or more ships within detonation range?
That's essentially what the mine does right now, except that an untargeted heatseeker may go towards something besides the closest target. In my testing, if the mine wasn't set to chase a specific target and simply an untargeted heat seeker, a fighter could activate the mine which would then go happily chasing a capital ship much farther away.
This way, the mine will home in on whatever got in range and activated it from a piddly fighter to a huge destroyer. I give the weapon a lifetime of 60 seconds so you can evade it, or even better, drag it over to something else that explodes :pimp:
As to your second question, I believe that if two targets are in range when the mine goes active, the mine will go after the first one in the ship index.
Mobius, I sent you a PM with the script and the details.