Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: karajorma on August 31, 2003, 07:20:34 am

Title: A couple of things I asked for earlier
Post by: karajorma on August 31, 2003, 07:20:34 am
I asked for a couple things a while back and I thought I'd just link to them rather than bumping old topics.

Firstly the No Traitor Ships Flag (http://www.hard-light.net/forums/index.php/topic,16664.0.html). Goober said he might look into it once he access to VS again. Just thought I'd jog his memory about this one.

Secondly although I didn't post the topic I really want a -mod flag for FRED2_open (http://www.hard-light.net/forums/index.php/topic,16484.0.html). Is there any good reason this hasn't been implimented already?

Finally Persistant Variables (http://www.hard-light.net/forums/index.php/topic,15838.0.html). I believe from what I managed to see of the dev meeting yesterday before my connection folded that this might be on the way even without my prodding
Title: Re: A couple of things I asked for earlier
Post by: Goober5000 on August 31, 2003, 08:56:13 am
Quote
Originally posted by karajorma
I asked for a couple things a while back and I thought I'd just link to them rather than bumping old topics.

Firstly the No Traitor Ships Flag (http://www.hard-light.net/forums/index.php/topic,16664.0.html). Goober said he might look into it once he access to VS again. Just thought I'd jog his memory about this one.


Memory jogged. :) You may have to jog it again after I finish persistent variables.

Quote
Secondly although I didn't post the topic I really want a -mod flag for FRED2_open (http://www.hard-light.net/forums/index.php/topic,16484.0.html). Is there any good reason this hasn't been implimented already?


We're all scared of FRED. :) I dunno, talk to DTP.

Quote
Finally Persistant Variables (http://www.hard-light.net/forums/index.php/topic,15838.0.html). I believe from what I managed to see of the dev meeting yesterday before my connection folded that this might be on the way even without my prodding


I'm working on it.
Title: A couple of things I asked for earlier
Post by: karajorma on September 02, 2003, 05:32:36 am
Thanks for the persistant variables (I've been thinking up ideas for what I could do with this since I heard they were coming). Just to jog your memory again about the No Traitors flag again :)
Title: A couple of things I asked for earlier
Post by: karajorma on October 28, 2003, 01:59:58 pm
Sorry for the massive bump but this was a short thread anyway :D Thought I ought to bump this since it appears to have slipped Goobers mind again :)

While I'm here I thought I might as well ask a second time for something else I've mentioned before.

Is it possible to use persistant variables to determine the numbers for the team loadout options? I'm sure I'm not the only person writing a campaign which involves a single carrier/destroyer in a hostile situation.
This change would add a whole lot of depth to the campaign as we could make it so that the player has limited resources. Use up all of your ursa bombers and you don't get any more during the campaign (or until a set mission is reached when your carrier is reinforced).
 It would force the player to think on a strategic level as well. Considering the fact that the campaign is probably tracking the health of the capship as well it makes it much more interesting. Do you send out all your heavy fighters now knowing that you risk having the capship damaged throughout the campaign if you don't or do you save them for the final mission where you're likely to need them more?

The way I see it working is like this.

The Team Loadout editor would have an extra checkbox titled something like "Use persistant variables for number available" and a box called Persistant Variable. When ticked instead of using the number in the Extra Available box FS2 would check the name of the variable and use its value as the number of ships.

There are a few problems with doing this and I don't know if they would make it too hard to do

1) The game would probably have to check which ships were selected and modify the relevent variable once the mission was started.

2) The game would have to ignore this change if the mission failed (I assume persistant variables do this anyway though).

3) The game would have to modify the persistant varible for any ship classes that were the default(s) for alpha, beta and gamma wings since they are already present on the loadout screen and aren't counted in the Extra Available figures.  
  You could get round this by automatically assigning those wings to something rubbish like an escape pod forcing the player to actually choose a real ship every mission but it would be an awful, hacky way to do it and wouldn't make the player appreciate the campaign much

4)  In the team loadout for the first mission the FREDder would have to spend a fair number of SEXP's setting the maximum number of ships for each class and assigning that number to a persistant variable. Automating this would be nice but if it's too much trouble any FREDder contemplating running a complex set-up like this should be capable of doing it themselves.
Title: A couple of things I asked for earlier
Post by: KARMA on October 28, 2003, 02:28:26 pm
from what I understood from the old post of goober about persistent variables, it should be possible to "create" variables (even money, for example), store them, and change them mission after mission, so everything should be really possible.
whip my ass (softly:p) if I'm wrong!:)
Title: A couple of things I asked for earlier
Post by: Goober5000 on October 28, 2003, 02:33:14 pm
Yes, that's possible per se, but the problem now lies in how to apply them.  It's a simple matter to use a variable as a sexp argument; it may be harder to tie it into the ship loadout.  I'll have to take a look at it.
Title: A couple of things I asked for earlier
Post by: karajorma on October 28, 2003, 02:53:36 pm
Quote
Originally posted by KARMA
from what I understood from the old post of goober about persistent variables, it should be possible to "create" variables (even money, for example), store them, and change them mission after mission, so everything should be really possible.
whip my ass (softly:p) if I'm wrong!:)


Almost anything is possible but since the team loadout is from before the mission there is no way to affect it with SEXP's as Goober says.

While theoretically using persistant variables as the numbers for the team loadout shouldn't be that hard the problems I mentioned may prove harder to solve depending on how the FS2 code does things.

Goober : Thanks for taking a look. If this gets done I'm definately using it in Seeds Of Rebellion and probably in TMA too. It will give people a a definate reason to use persistant variables and once they start using them they'll find it hard to stop :D
Title: A couple of things I asked for earlier
Post by: KARMA on October 28, 2003, 04:32:54 pm
Quote
Originally posted by karajorma


 since the team loadout is from before the mission there is no way to affect it with SEXP's as Goober says.


ahh ok sorry I missed your point:)
btw, about ship/weapon loadout I was thinking... if it would be possible to have a variable like "money", you may want  to give access to some ships/weapons only if you have enough money (but not only money.. for example, in karajoma's example, I may consider an amount of resources instead of a fixed number of ships, assuming that those ships will be somehow built with the resources..like Homeworld)
Title: A couple of things I asked for earlier
Post by: Lightspeed on October 28, 2003, 04:49:11 pm
well, not everything is possible. For example, a is-key-pressed SEXP which works with non-mapped custom keys doesnt exist (afaik). I actually only discovered that because i needed (and still need) one :lol:
Title: A couple of things I asked for earlier
Post by: karajorma on October 28, 2003, 04:57:20 pm
Trust me to forget the biggest obstacle to doing this and thereby make the problem ten times more complicated than it needed to be :)

You need to record which ships survived to the end of the mission anyway so why alter the variables at the start of the mission?
The simplist way to make this whole thing work I can think of is to have a SEXP which returns the number of ships of a certain class which have been destroyed. That number can then be subtracted from the PV. Doing things this way you get rid of the need to track which ships were selected regardless of which wing they were in. All you need is one SEXP for each class of ship you are keeping track of.

I'm assuming it wouldn't be too hard to make such a SEXP since the building blocks are already there in the is-ship-class SEXP.

Quote
Originally posted by KARMA
ahh ok sorry I missed your point:)
btw, about ship/weapon loadout I was thinking... if it would be possible to have a variable like "money", you may want  to give access to some ships/weapons only if you have enough money (but not only money.. for example, in karajoma's example, I may consider an amount of resources instead of a fixed number of ships, assuming that those ships will be somehow built with the resources..like Homeworld)


I could do that now actually :) After every level the mission uses the loop code to check if you want to buy something. If so it loads in a shop level where the players Money variable is checked and by a variety of key-pressed SEXP's you allow him to buy various things.

You'd probably require a different mission for each time the shop is available (since FS2 doesn't seem to like you reusing a mission twice) but you could even make it fun that way. Sometimes the station where you buy stuff would be under attack or require you to do something first.

Once you buy a ship you add 1 to the NumberOfAresFighters Variable. Of course you'd need the Team Loadout code I requested to be working before you could use it :)

Resources could be handled in a similar way and it wouldn't be hard to make a delay time between commencing work on a ship and having it appear in game. Wouldn't be too hard to have a gas miner or somesuch appear now and again and give the player resources depending on how much time was spent harvesting.

See why I'm so upset more FREDders aren't thinking of things to do with persistant variables? I come up with stuff like this EVERY time I think about them :)

Quote
Originally posted by Lightspeed
well, not everything is possible. For example, a is-key-pressed SEXP which works with non-mapped custom keys doesnt exist (afaik). I actually only discovered that because i needed (and still need) one :lol:


*Repels thread Hijacker*

Seriously though The 1 to 4 keys are not used for anything in single player. Can't you use them?
Title: Re: Re: A couple of things I asked for earlier
Post by: Taristin on October 28, 2003, 06:13:05 pm
Quote
Originally posted by Goober5000

Quote
Originally posted by karajorma
Secondly although I didn't post the topic I really want a -mod flag for FRED2_open. Is there any good reason this hasn't been implimented already?

We're all scared of FRED. :) I dunno, talk to DTP.
 [/B]


Actually, Kazan was attempting it. :D Don't know his status.
Title: A couple of things I asked for earlier
Post by: KARMA on October 28, 2003, 06:34:53 pm
ehy it's nice the idea of a shop level :) I never thought about it. My idea was a bit more primitive, with money gained if you achieve mission goals (obiously), or more resources gained if you for example succesfully protect the tibanna gas transport/platform etc etc and the possibility to buy/build at any turn (something simple.. a ship avaiable only if you have enough resources, that will be depleted if you chosse to use-and therefore buy/build- that ship)
well yes, you're right, you need to connect the loadouts to the campaign variables anyway
Title: A couple of things I asked for earlier
Post by: Trivial Psychic on October 29, 2003, 12:01:26 am
As far as a shop level, as was suggested, have it outside an Arcadia or something, then use a different system than the "Is Key Pressed" or whatever sexp it was.  You've got a series of cargo containers and a group of freighters at your disposal.  Depending on which resources you want to "buy", you can use player orders to tell which freighters to dock to which cargo units and depart on the player's command.  That method, while a little more time consuming, is cooler.

Later!
Title: A couple of things I asked for earlier
Post by: Goober5000 on October 29, 2003, 12:04:42 am
Agreed. :yes:
Title: A couple of things I asked for earlier
Post by: KARMA on October 29, 2003, 04:40:22 am
ok, let's start dreaming...:)
a new knossos is found, the new GTD Kickass with many support ships pass through it, but then the knossos explode and the node collapse. You have to make your way to home, you are in an unknown region surrounded by shivans, with limited resources.
The Kickass has some autorepairing systems, some support ships can be converted to factories, but they all require resources; you can convert some transports into mining ships to collect plasma from nebulaes and metals from asteroids, you can try to stole ships and resources to shivans. And you also have some science vessels, that will be converted in order to develop new technologies.
During the missions it will be often necessary to protect the mining ships (or you gain less resources), the factories (or there will be a production slowdown of new ships), the science vessels (or it will take more to develop new technologies).
The system is adapted to your strategies: if you often use bombers, more bombers will be built, and there will be more tech advancements for the bombers (not necessarily new ships, new stats too). If you choose often torpedoes, more powerful torpedoes will be developed, if you call in, as reinforcementes specific ship types ( awacs, interceptor wings, etc) there will be upgrades in this direction, in order to have more ships of this type, and more advanced.
Succesfull contacts with new species, ancient artifacts studyed, enemy ships captured may cause tech advancements.
The idea is to define some variables, like *bombers* *interceptor*.... *torpedoes* *fireforgetmissles*... *techadvancements*..*resources*... and many others, and assign them a value after each mission, depending by what happened, and use those values to define the loadout. It would be cool to have a random number generator, but it would be also possible to use some predefined levels (example: if value *bombers* is > of 20, then faster bombers will be avaiable, if value is >60, the bomber type  XXX will be aviable...etc etc)
Persisten variables could also be cool to define the AI level of your wings... if a wingmen survive, in the next mission he will be stronger..etc etc
Well, this is a campaign I'd really like to play:)
damn I need to start learning FREDding, one day or the other:p
Title: A couple of things I asked for earlier
Post by: karajorma on October 29, 2003, 06:27:46 am
Might be nice to limit the weapons available in a similar way. That would be harder to do as far as numbers are concerned (it would be much harder to check how many missiles were left unfired etc even without the added hiccup of support ships) but it would be very easy to only allow new weapons once the blueprints had either been researched or bought.

As for the idea about having wingmen get better every time they survive a mission we can do that with the change-ai-class SEXP so that's already possible (although it would require a lot of SEXPs to do that way).
Title: A couple of things I asked for earlier
Post by: terren on October 29, 2003, 06:31:48 am
Sounds awsome, I was thinking of something similar earlyer today, but I was puting a lot more limits on the player, limiting the number of primarys and secondarys by variables, although not knowing anything more about fred then how anoying it is to try to learn, I have no clue if you can tell what a ship's load out is at the start/end of a mission.  Hopefully it can be done, a campain using limited resorces would be awsome.
Title: A couple of things I asked for earlier
Post by: Flaser on October 29, 2003, 10:44:07 am
With some clever interface work as well as broader mapped keys we could actually develop Freesapce Commader
Title: A couple of things I asked for earlier
Post by: kasperl on October 29, 2003, 11:00:00 am
that would be nice, really nice.
Title: A couple of things I asked for earlier
Post by: Zarax on October 29, 2003, 12:56:49 pm
that would be really good...
My old Rise of GCA campaign was based on such stuff before being scuttled...
Anyways, i may retake it if circumstances will change...
OT: You should really add codec support for the game sound effects, creating high quality weapon sounds that takes little space would absolutely rock!
WMA in particular is awesome, i've seen some experimental stuff on other game projects and it works very well...
Just imagine having 7.1 channels 96khz ingame sound!
Title: A couple of things I asked for earlier
Post by: kasperl on October 29, 2003, 01:03:15 pm
Zarax, no offence, but you might want to read the FAQ before asking for more fileformats and stuff like that.
Title: A couple of things I asked for earlier
Post by: Goober5000 on October 29, 2003, 04:35:19 pm
Thanks, kasperl. :)
Title: A couple of things I asked for earlier
Post by: Flaser on October 29, 2003, 05:08:05 pm
...and go for OGG BTW. Reason? It is FREE!!

Back to topic:

Is there a way to add more instruments to your run of amile FS ship?

No I don't mean new HUD componenets, I know the HUD is a jumble, however is there a way to exctract some of the data the instruments use, then use that data to creata your own iunstruments?
How mangable are those values, is there anything that easly accesable?

The reason is that several projects could benefit form this kind of thing.
There was the real role playing quite a while ago, as well as the ever persistent demand for flying/managing capships, not to mention plans for making a usuful tactical map *maybe somthing extracted from the FRED code...- as well as the so much rumored gunboat class.
Title: A couple of things I asked for earlier
Post by: Goober5000 on October 29, 2003, 11:09:54 pm
Quote
Originally posted by Flaser
Is there a way to add more instruments to your run of amile FS ship?

No I don't mean new HUD componenets, I know the HUD is a jumble, however is there a way to exctract some of the data the instruments use, then use that data to creata your own iunstruments?
How mangable are those values, is there anything that easly accesable?


:wtf: :wtf: :wtf: What?
Title: A couple of things I asked for earlier
Post by: Bobboau on October 29, 2003, 11:35:43 pm
something about makeing new HUD gauges,
I'd like to renovate the HUD code someday
Title: A couple of things I asked for earlier
Post by: karajorma on October 31, 2003, 05:25:54 pm
BUMP!

Didn't want to risk Goober forgetting about it again :D
Title: A couple of things I asked for earlier
Post by: Goober5000 on November 01, 2003, 11:58:11 am
:D

:nervous:
Title: A couple of things I asked for earlier
Post by: WMCoolmon on November 01, 2003, 03:03:48 pm
Quote
Originally posted by Flaser
...and go for OGG BTW. Reason? It is FREE!!

Back to topic:

Is there a way to add more instruments to your run of amile FS ship?

No I don't mean new HUD componenets, I know the HUD is a jumble, however is there a way to exctract some of the data the instruments use, then use that data to creata your own iunstruments?
How mangable are those values, is there anything that easly accesable?


He wants to take the data displayed in the HUD gauges (Like ship speed, % of afterburner remaining, whether autotargeting is on...) and use it to make his own.