Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: The E on September 12, 2010, 07:50:09 am

Title: More sexp variables
Post by: The E on September 12, 2010, 07:50:09 am
Another test build. This one has the max number of sexp variables bumped to 250, nothing else.

Please test for breakage, pilots and campaign save files may be affected.

http://blueplanet.fsmods.net/E/FSO%20sexp%20variable%206454.7z
Title: Re: More sexp variables
Post by: Kaoru on April 14, 2011, 04:08:28 am
E - with FSMods.net gone, this test build is no longer available. Is there any chance I could convince you to re-host, or PM me with the file, or some other esoteric solution that puts it on my hard drive? I'm in the middle of a War in Heaven playthrough and it's just bugging me too much not to have persistent hull and ammo and killcounts and such with checkpoints, so I'm just going to add those in on my own. I just need the bump in variables to do it.

Any help would be appreciated!
~K
Title: Re: More sexp variables
Post by: The E on April 14, 2011, 04:48:01 am
Since this has been in trunk for some time now, there is no need to do this. Just grab a build off of the nightly board. Also, fsmods isn't gone, however that file has been deleted. It served its purpose, and even if you could DL it, it would be 700 revisions out of date.
Title: Re: More sexp variables
Post by: Kaoru on April 14, 2011, 01:25:27 pm
That's an incredibly informative and helpful answer! Thank you very much! I'd only heard about FSMods being gone during the period when you couldn't download the Launcher, and checked the website right before I posted, only to be told it didn't exist - but I'm glad to hear that's incorrect, and it's still up and running. I'll go grab a nightly build and get to work, then - thanks again, E!
~K
Title: Re: More sexp variables
Post by: General Battuta on April 14, 2011, 01:28:09 pm
Hull should be persistent on checkpoints, at least on the player ship. I don't know about killcounts being feasible, ammo might be. The checkpoint system is so intricate though that I wouldn't be surprised if some glitches are creeping in.
Title: Re: More sexp variables
Post by: chief1983 on April 14, 2011, 02:12:05 pm
FSmods != FS2Downloads.com.  Different hosts I believe.  One of the few sites _not_ running on Hunter's Dreamhost account these days.
Title: Sort of re: More sexp variables
Post by: Kaoru on April 17, 2011, 08:05:59 am
Apologies in advance, since I am now guilty of both necroposting and somewhat derailing this thread, even if I am making use of the feature it was made to talk about, in the process!

Hull should be persistent on checkpoints, at least on the player ship. I don't know about killcounts being feasible, ammo might be. The checkpoint system is so intricate though that I wouldn't be surprised if some glitches are creeping in.
Actually, as I've found out through a bit of futzing around, ammo would be feasible and relatively easy, except for a few bugs in the ointment.

As far as I can see, there's no way to verify the player has the same secondary weapon in the same bank on subsequent playthroughs or attempts, or even the same number of secondary-weapon-banks (seeing as the mission has fighter-options with 1, 2, and 3 banks, and there'd have to be variable-recording hooks for all of them.) This causes a problem due to the get-secondary-ammo operator treating 'any number equal to or higher than the number of banks on a ship' as requesting the average, which made me grin and groan in my tests when it took the average between a bank of Hellfires and a bank of Paveways and gave me 83 of each. It also at one point determined I should have 160 Javelins. I was playing Aristeia at the time, so I guess FRED decided I should impersonate a formation of hoplites all on my own, huh?

Killcounts are likewise unfeasible, for a simpler reason: There's an operator to get kill-count, that allows you to store it as a variable, but there's no counterpart that allows you to write a variable to, or even alter in any way, the player's kill-count. Drat.
FSmods != FS2Downloads.com.  Different hosts I believe.  One of the few sites _not_ running on Hunter's Dreamhost account these days.
Ahaaa. Thank you for the clarification, then! Glad that it's still trucking along, in any case. The more hosting sites the community has left, the better.
~K
Title: Re: More sexp variables
Post by: The E on April 17, 2011, 08:11:45 am
In my opinion, the WiH checkpoint system is a good compromise between what is possible and what is feasible; Adding in more stats to store wouldn't make it better or more maintainable.
Title: Re: More sexp variables
Post by: General Battuta on April 17, 2011, 09:43:11 am
You might be able to use get-secondary-weapon (or is it called is-secondary-weapon?) in recent builds, which Kara added.
Title: Re: More sexp variables
Post by: Kaoru on April 17, 2011, 09:55:45 am
In my opinion, the WiH checkpoint system is a good compromise between what is possible and what is feasible; Adding in more stats to store wouldn't make it better or more maintainable.
I think the system is brilliant, all the more-so now that I've actually looked at how it works. To be honest, I was just doing this for my own selfish wants - or trying to, at least! My main thrust was just getting a consistent kill-count in there, simply because I'm a kill-junkie, and it was breaking my heart to have to choose between re-playing the entire mission (on one of the harder difficulties I'm playing on) in order to rack up the kills again, or using a checkpoint and losing them all! Considering the absolutely nonexistent effect score, rank, and kill-count actually has on WiH, or any campaign, really, I don't consider this to be anything but my own maligned pique at work. A relic of days spent chasing high-scores.

There is a definite line between 'realism' (defined here as the preservation of positions, health, ammo, etcetera, or lack thereof) for the sake of itself, and realism for the sake of gameplay. The checkpoint system as a whole seems, to me, a design feature implemented to allow a more streamlined mission-experience in the event of failure, or replaying a mission later on. It's a gameplay mechanic, and works perfectly well without getting down to every last nitty-gritty detail, I agree.

Besides, the more details that are included in the checkpoint, the greater the possibility of a Dead Rising Save System. (For those not in-the-know, that's any save system with only one usable save file that has no safeguards in place to keep you from saving your progress at a point where it is impossible to complete your objectives, or the story, necessitating a complete restart anyway.) I wouldn't argue to change it in either the Director's Cut or for Part 2, it was just something I was going to do for myself. Thanks for your input, though, E!
You might be able to use get-secondary-weapon (or is it called is-secondary-weapon?) in recent builds, which Kara added.
How recent? I have Revision 7118 FRED2 open right now, and the only secondary-weapon operators I'm seeing are secondary-ammo-pct, get-secondary-ammo, secondary-fired-since, is-secondary-selected (which you might have been thinking of, but it doesn't work that way) and has-secondary-weapon (which is a conditional switch, it doesn't record what the player has in a form that can be stored as a variable, and thus wouldn't link in with the saved ammocount. ...Unless it was used as a precondition for restoring the ammo in the first place. Or could possibly be saved as a string and restored from there. Hm. Ideas. Complicated ones, though.)
~K

EDIT: Fixed up my wording as to the nature of has-secondary-weapon.
EDIT2: Fixed a reference to variables as opposed to numeric variables, to be less confusing and potentially-inaccurate.
Title: Re: More sexp variables
Post by: General Battuta on April 17, 2011, 10:19:41 am
I know how is-secondary-selected works, thank you very much. When I designed the checkpoint system I looked for ways to do what you're trying to do.  ;)

I'm looking at has-secondary-weapon, which as you say is a conditional switch, but which (like you said) can be used in combination with a when-argument to modify a string var to the weapon in the slot. It'd be complex as hell but it could work.
Title: Re: More sexp variables
Post by: Kaoru on April 17, 2011, 10:42:54 am
I know how is-secondary-selected works, thank you very much. When I designed the checkpoint system I looked for ways to do what you're trying to do.  ;)

I'm looking at has-secondary-weapon, which as you say is a conditional switch, but which (like you said) can be used in combination with a when-argument to modify a string var to the weapon in the slot. It'd be complex as hell but it could work.
Exactly. Probably eat up variables like nobody's business, but then that's what the extra 150 are for, to be used. Then the only question is whether the complexity is worth the result, and that's a judgment call that's gonna vary from person to person. In terms of the general user? Probably not. In terms of me? We'll see.

Also, relaaax. You have nothing to defend, the FREDing work you've done is nothing short of superb, especially considering you got your start working on WiH Pt. 1. I'm not questioning your knowledge at all, nor your expertise, both of which far outstrip mine. I was more demonstrating that I know what it does, as I'm a complete unknown in terms of this community, than suggesting that you didn't. Anyhow, my long-winded explanation aside, this still sadly leaves me without a persistent killcount. Drat. Ah, well. If I ever really got tired of shooting those zippy little buggers until they a'sploded, I probably wouldn't still be playing Freespace 2.
Title: Re: More sexp variables
Post by: General Battuta on April 17, 2011, 10:45:23 am
No worries, I wasn't worried.

It'd be great to find a way to set killcount. Though it might lead to a number of missions setting it to 100000 or something.  :nervous:
Title: Re: More sexp variables
Post by: Kaoru on April 17, 2011, 11:34:57 am
No worries, I wasn't worried.

It'd be great to find a way to set killcount. Though it might lead to a number of missions setting it to 100000 or something.  :nervous:
I think it'd take another operator-hook to do it - in other words, a code change. I'm not holding my breath for it, in terms of overall priorities, I wouldn't just consider 'ability to alter kill-count with a SEXP' to be at the bottom of the list, I'd imagine they would need an entirely separate list from the priorities list, just to find a spot for it. A list locked in a musty, sealed room, in the basement of a derelict building. Filled with spiders. That about describes the amount of enthusiasm I'd expect to see if someone made a feature request for such a minor thing.

...it might be interesting, though, if used cinematically. Combine a properly-scripted no-briefing mission as the intro to a campaign, with that killcount-altering possibility, and you could concievably launch a player right into the thick of a battle right at the start of a campaign, with a damaged hull, low secondaries, a decent killcount and a bone to pick with the screen-full of enemies still to come. I'm just rambling to try and think up some reasonable use for an operator like that, incidentally, because besides using it in a checkpoint system, I can't think of many.
Title: Re: More sexp variables
Post by: Dragon on April 17, 2011, 02:07:53 pm
In Wing Commander: Prophecy, your flight recorder was erased at one time and in WC2, you had it malfunctioning (twice!). Also, a WC4 novel had charactes shorting out flight recorders of their fighters to hide certain info. This operator would be a great way to indicate the loss of flight recorder (for storytelling purposes, as in all these examples).
Title: Re: More sexp variables
Post by: karajorma on April 17, 2011, 10:17:08 pm
Killcounts are likewise unfeasible, for a simpler reason: There's an operator to get kill-count, that allows you to store it as a variable, but there's no counterpart that allows you to write a variable to, or even alter in any way, the player's kill-count. Drat.

when
- (Whatever triggers the savepoint)
-ship-create
--NameOfShip[DefaultName]
-(use settings to place the ship far away behind the player)
-set-subsystem-strength
--hull
--1
-WeaponCreate
--Alpha1
--Harpoon
--(position near the ship you just created)
--NameOfShip[DefaultName]


Now all you need to do is make that loop an equal number of times to the number of ships you destroyed and you're done. The method you'd choose for the loop can be simple or complicated depending on how accurate you want the system to be. If you're really anal you can make it destroy ships with the same class (and even the same names!) as the ones killed in the earlier part of the mission which would mean you would retain the score, and correct ship type kills as well as the kill count.


EDIT : This thread really needs to move to the FRED forum since it's actually an interesting discussion of advanced FREDding techniques now. :)
Title: Re: More sexp variables
Post by: General Battuta on April 17, 2011, 10:21:27 pm
oh jesus, he's right  :shaking:
Title: Re: More sexp variables
Post by: StarSlayer on April 18, 2011, 02:53:13 pm
I Want Your Sexp
(http://www.realbollywood.com/news/up_images/george-michael6517.jpg)