Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: wistler on June 18, 2012, 03:41:59 pm
-
Hi,
Is there any way of locking a missile bank on the players ship until a set time when it can be unlocked, used, and then relocked when its empty.
I'm trying out an idea I had about rewarding the player certain missiles during the game, but I can only get it to work by changing the load out of a missile bank already in use. It's a bit more clumsy then the idea I had in mind, which was a missile bank that was offlimits to the player until he achieved a particular goal.
Basically I'm asking there's a lock / unlock secondary banks command in FRED that affects specific banks rather then all missiles.
-
probably not, might make a nice request. In the mean time secondary ammo looks to be your best bet.
-
You could make two versions of a ship, one with the extra bank and one without, and then switch the ship in mid-mission
-
That could work. But you would have to have a lot of ships in your table if you start combining.
-
When
is-secondary-selected
Playership
Bank to lock (#)
lock-secondary-weapon
with a high trigger count.
To unlock do the same event but with the other bank and use unlock-secondary-weapon... or just use an if-then-else argument to do it all in one event.
You can put further checks in place to find out which bank has the weapon to lock if you need to.
-
Have you tried the set-secondary-ammo sexp under subsystems and cargo? You could set the player's ammunition to 0 when you don't want them using the weapon and give him/her back the weapon's ammuition (saved as a variable using get-secondary-ammo) when you want to.
-
I'll give that a try next chance I get, thanks.
-
Personally, I'd create a weapon called "Locked" and make that the weapon the player has when you don't want them using their missiles.
I think that's a much more elegant solution than simply changing the number of missiles available. Although there may be some flaw in that plan I've failed to consider.
-
As a work around, is there a way to check what missile is in a bay before i change it, and then have the bay change back to that original missile.
Seems a bit more practical then making the player loose an entire bay for a mission, and it would also allow the player to pick their load-out.
-
When-argument
-any-of
--list of missiles allowed in the mission
-has-secondary-weapon
--ship-name
--Weapon Bank
--<argument>
-modify-variable
--Locked-Missile[None]
--<argument>
Should do it. You can later use that string variable to add the missile back.
-
That's worked great, thanks Kara. :yes: