Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: karajorma on January 26, 2008, 04:18:10 am
-
Did some refactoring on the team loadout code I made (almost 2 years ago now!) and it should work much better now. I'll be adding this stuff to HEAD eventually. I doubt it will be commited to the 3.6.9 branch for some time, it almost certainly won't be in 3.6.10 unless it gets a lot of testing now. So if you want it soon you'll have to prove it's bug free.
Here's how it works.
(http://www.hard-light.net/wiki/images/TeamLoadoutEditor.jpg)
The loadout screen will now accept variables for both ship names and their quantities. The Ships Editor now allows you to set a new flag (Set Class Dynamically). If this is set for a ship the game will check if the loadout contains any ships of this class. If it doesn't it will then look to see if any alternatives have been set in the all-new Alternate Ship Class Editor.
(http://www.freespacefaq.com/Misc-Pics/Alt_Ship_Class.jpg)
The game will then run through the list and see if any of them are in the loadout available to it. If it finds something the ship is changed to that class. If you specify a default the game won't even check if there are any left (Allowing you to say that the player can fly Hercs or Ares if there are any left but should fly a Myrmidon if there aren't any). The Alternate Classes act as suggestions (unless marked as default) if none are found the game simply checks if there is anything in team loadout that can be assigned before finally sticking the player with whatever you assigned him to in the mission file if that's the only choice.
You can find the builds here (http://www.freespacefaq.com/Misc-Downloads/Builds/Team_Loadout_Build.7z).
EDIT : For those who are wondering what you'd use this for. Together with persistent variables you now have a system that allows you to buy ships or add a strategy level to the game where the best ships are produced at a certain rate and if your wingmen use them all up you have to fly crappier ships.
-
103 views and no comments? You guys suck! :(
I'm going to go away an' code a super new feature and you're all gonna be all "wow!" and "Karajorma's is so cool!" and "I want to have your babies" and I'll be all like "Too late *****es!" :ha:
-
This is awesome :) It really needed the ability to use variables for both ship names and numbers available. So many possibilities with this, amazing possibilities.
-
103 views and no comments? You guys suck! :(
I'd guess there's at max two dozen FREDers skilled enough to want this. That's why you're not getting any comments.
-
Oh I figured it would be fairly niche but I expected at least a few questions asking what it did etc. :D
It's this sort of thing that mainly stopped the SCP adding stuff just cause it was cool. Now stuff gets added whenever one of the major campaigns asks for it because that way we know it gets used. I know I may have originally (http://www.hard-light.net/forums/index.php/topic,17130.msg356819.html#msg356819) asked for team loadout to change this way, but I'm not the (http://www.hard-light.net/forums/index.php/topic,38957.0.html) only (http://www.hard-light.net/forums/index.php/topic,43509.msg894978.html#msg894978) one (http://www.hard-light.net/forums/index.php/topic,45828.0.html).
-
BSG could certainly use this. It is a rag-tag fleet after all.
TBP could probably use it in a mercanry campaign setting or even as part of the general story arc.
Individual people could use it for multiple stand-alone missions or mini-campaigns or larger. It could even be incorperated into the multi-player campaign missions.
Sadly, for someone such as myself, to know it's usefulness would be knowing how to accomplish it outside of FRED.
-
YES. This is exactly what I was looking for to get ETF going again. :D
-
What I most need is feedback on the kind of SEXPs needed to make the system work at mission end. Right now it's 100% up to the FREDder to decide how to change the variables at the end of the mission.
The HEAD version had a test SEXP called Deal-with-team-loadout that simply checked for ships that had the Team Loadout Store Status flag set which were destroyed in the mission and then edited the first variable it found which had ships of that class in it. This version doesn't have any SEXPs yet but I'm adding some soon. Right now I'm thinking about having a couple of general clean up SEXPs that will do all of the work and a couple of specific ship specific SEXPs that can be triggered by exits or ships being destroyed.
If anyone wants others better to shout out sooner rather than later.
-
I'm sorry Kara I would be very interested but I'm half expecting FSOpen to drop support for TBP in anything newer than 3.6.9. So 3.6.10> features are slightly irrelevant.
-
I doubt we're planning to drop support for TBP really. The only problems I can see are things that should have been done becoming more of an issue (setting MOI on ships for instance).
-
103 views and no comments? You guys suck! :(
I hate multiplayer, thats why i haven't posted. But then again, nobody cares about me :P
since i'm here, whats HEAD?
-
I didn't know this feature was multiplayer specific. I'm confused. :nervous: :shaking:
-
It's not.
As far as I know it should also work in multiplayer missions but the main idea behind this change was to add a new feature for the single player game. In fact since it really is only of any use in a campaign that's the least tested aspect of it.
-
So the idea, then, is to say "well, two of my wingmates were in Lokis with stock armament, and they died, so next mission I will have two fewer Lokis available, and two fewer Subachs and Prom-R's," etc etc.
Assuming it's done correctly at least.
I'm going to work on messing with this with a couple of test missions. Twill be a couple days.
-
So the idea, then, is to say "well, two of my wingmates were in Lokis with stock armament, and they died, so next mission I will have two fewer Lokis available, and two fewer Subachs and Prom-R's," etc etc.
I like that. Since i always order my wingmen to depart when they are at critical hull integrity.
That means i order them to go home a lot :P
-
And under this system that style of play would be rewarded as you'd have those ships available in the next mission. :)
So the idea, then, is to say "well, two of my wingmates were in Lokis with stock armament, and they died, so next mission I will have two fewer Lokis available, and two fewer Subachs and Prom-R's," etc etc.
Yep, that's probably the main use. But for instance you can reward good play with extra ships or weapons ("Your actions prevented the freighters from having to withdraw so we have now been resupplied successfully").
The main problem at the moment is that there is no easy way to tell which ships your wingmen were in when they died if you changed the class during the briefing. That's why I wanted some feedback. I wanted to know which SEXPs people want now. Adding a new SEXP is very little work really as the system already can do most of the hard work. Right now the only times I can think of that people will want to edit the variables holding the number of ships for the next mission will be when ships depart or when they are destroyed. If you think other times might need to be checked often give me an example and I'll stick it in.
-
would this allow something such as a scripted commodity system? to make trading mods possible?
i see potential uses for this in a pirate campaign. where ships and weapons can be bought, stolen and lost and sold.
-
would this allow something such as a scripted commodity system? to make trading mods possible?
Not really. At the moment it's fighters and bombers in a team belonging to a player only (i.e friendly only or red and green teams in TvT). There's scope to make it work with any ship class by adding a second editor for everything else though. That said, I hate FREDding GUI work. About 60-70% of the work this involved was making FRED not choke on this feature. FS2 was relatively easy to get working in comparison.
i see potential uses for this in a pirate campaign. where ships and weapons can be bought, stolen and lost and sold.
Yep. The two main ideas I had in mind were behind enemy line campaigns (where you had limited resources) and mercenary/pirate campaigns.
-
When I first saw the topic I thought it was going to be about the multi player team loading fixes so I didn't bother to read it. Now that I have it sounds like it could have quite a few uses. In the future when muti has improved and in game joining is working it could be very interesting. Add in a way to save variables in multi and each player could bring his own ships and weapons to a game. With some other features it could even be possible to loose those ships and weapons at respawn and have to pick new ones from your reaming arsenal. In a TvT the other team could "capture" your weapons when you die.
Dang. So many ideas so little time.
-
would this allow something such as a scripted commodity system? to make trading mods possible?
Not really. At the moment it's fighters and bombers in a team belonging to a player only (i.e friendly only or red and green teams in TvT). There's scope to make it work with any ship class by adding a second editor for everything else though. That said, I hate FREDding GUI work. About 60-70% of the work this involved was making FRED not choke on this feature. FS2 was relatively easy to get working in comparison.
from what it looks like all i need to do is get script access to the variables. so when you land at wallachia station, and the buy/sell menu pops upand you buy a satyr class fighter or a container full of bosch, or a hacked trebuchet. i can just add one to the variable and receive that ship and or weapon. id like the crates to be traacked as well. so that in a defend the depot mission, loosing a crate would be costly.
-
When I first saw the topic I thought it was going to be about the multi player team loading fixes so I didn't bother to read it. Now that I have it sounds like it could have quite a few uses. In the future when muti has improved and in game joining is working it could be very interesting. Add in a way to save variables in multi and each player could bring his own ships and weapons to a game.
Right now it works only at the team level. I'd like to see this work at the player level too as it would add a lot to multiplayer but doing that would require quite big changes I suspect (I'd have to find a way of saying x ships of class y belong to player z and prevent the other players using those ships. Furthermore I'd have to find a way of passing that information on to the clients). That said it's certainly something I'd love to see happen.
With some other features it could even be possible to loose those ships and weapons at respawn and have to pick new ones from your reaming arsenal. In a TvT the other team could "capture" your weapons when you die.
Not only possible to add but I reckon it might not even be difficult. To make the idea work I'd simply have to get both client and server to subtract 1 from the loadout totals as soon as a ship respawns (easy), Call the swap parse class function either just before or just after respawn (not particularly hard I'd imagine) and design a new packet to pass on the revised ship numbers upon a change (Can't see this one being too hard either).
The only difficult bit is having the player pick which ship he can use. Right now I could probably code it to simply give the player the next ship in line very easily. You'd start with whatever you picked and slowly work down to the crappy ships towards the end of the mission (Using alt classes would easily allow the FREDder to choose the order in which the player gets access to ships).
It might be possible to allow the player to choose which class and weapons he uses on respawn. I don't particularly fancy making an in-game interface for it but what I could do is code in all the back end stuff and simply give scripting access to the team struct data. The player can then pick the ship he wants, and have the server call the swap_parse_object() function to swap the players ships and weapons and then pass the information on to the clients to inform them which ship the player is now flying.
Adding SEXPs to change the information in the team struct is probably possible. That would allow you to have mission events affect what is available (i.e if the enemy blow up your destroyer suddenly a lot of your possible respawn choices or maybe even your actual number of remaining respawns change).
from what it looks like all i need to do is get script access to the variables. so when you land at wallachia station, and the buy/sell menu pops upand you buy a satyr class fighter or a container full of bosch, or a hacked trebuchet. i can just add one to the variable and receive that ship and or weapon. id like the crates to be traacked as well. so that in a defend the depot mission, loosing a crate would be costly.
I was discussing something along these lines with Wanderer only yesterday, do you not already have access to variables? (in HEAD builds if not in the 3.6.9 branch)
-
from what it looks like all i need to do is get script access to the variables. so when you land at wallachia station, and the buy/sell menu pops upand you buy a satyr class fighter or a container full of bosch, or a hacked trebuchet. i can just add one to the variable and receive that ship and or weapon. id like the crates to be traacked as well. so that in a defend the depot mission, loosing a crate would be costly.
I was discussing something along these lines with Wanderer only yesterday, do you not already have access to variables? (in HEAD builds if not in the 3.6.9 branch)
its possible. there are so many things in scripting ive never tried to do. but my understanding of mission design is minimal at best. so making my script work with missions would be a challenge.
-
Yeah, that's why myself and Wanderer were talking. I can't script and he can't FRED but between us we can probably find a few new things to do with the system.