Author Topic: WOOT! Beam-free-all-by-default mission flag!  (Read 3840 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
WOOT! Beam-free-all-by-default mission flag!
I updated missionparse.cpp and missionparse.h to incorporate a beam-free-all-by-default mission flag.  Missions with this flag will load up with all capital ships having all of their turrets beam-free'd. :cool: No FRED2 update, but you can easily convert all your missions by adding 128 to the value next to the +Flags: option in your .FS2 file. :)

EDIT: It was surprisingly easy, too - I'm rather surprised no one investigated it before.  All I had to do was steal the beam-free-all code from sexp.cpp and run it for every ship that was loaded into the mission. :)

I've also added an anti-frustration beam-lock-all to run whenever a ship is destroyed, but this needed to go in ship.cpp.  Since I'm still messing around with ship.cpp for my ballistic primary conversion, I didn't commit it yet.
« Last Edit: December 03, 2002, 11:29:01 pm by 561 »

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
WOOT! Beam-free-all-by-default!
Ack. We've been over this before; having it on by default would break backwards compatibility. What we want is a simple checkbox in the ship properties to beam free it, instead of using SEXPs.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
WOOT! Beam-free-all-by-default!
No, no, no - that's exactly what I did - except that the checkbox goes in the Mission Specs dialog instead of the ship dialog. (I would never want to break backwards compatibility.) The default default is to have the beams locked.  By adding the "beam-free-all-by-default" mission flag, the beams become automatically freed by default.  You have to specify the flag on a per-mission basis.

Does that make sense? :) It works the same way as the "support-ships-repair-hull" flag.
« Last Edit: December 03, 2002, 05:24:11 pm by 561 »

 

Offline RandomTiger

  • Senior Member
  • 211
WOOT! Beam-free-all-by-default!
Quote
Originally posted by Goober5000
No, no, no - that's exactly what I did - except that the checkbox goes in the Mission Specs dialog instead of the ship dialog. (I would never want to break backwards compatibility.) The default default is to have the beams locked.  By adding the "beam-free-all-by-default" mission flag, the beams become automatically freed by default.  You have to specify the flag on a per-mission basis.

Does that make sense? :) It works the same way as the "support-ships-repair-hull" flag.


If you have done it right, well done.

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
WOOT! Beam-free-all-by-default!
Quote
Originally posted by Goober5000
second post
Ah.  Very good then.
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
WOOT! Beam-free-all-by-default!
Oh, I see. MUCH better. :):yes:
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
WOOT! Beam-free-all-by-default!
Assuming it works (And I'm sure you tested it before comitting it) then all we need is someone to add a checkbox and code for it in FRED2. One thing though, what happens if you try to run a mission with this flag using the original exe? (I probably would have added an entry after flags to be read with optional string rather then modify the existing flag stuff. The extra entry should be ignored by the original exe.)
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
WOOT! Beam-free-all-by-default!
It works - I checked. :) As for working with the original EXE, I see no reason why it wouldn't.  This addition simply checks to see if there is a 2^7 bit included in the mission flag, and if it is, it runs through the beam-free-all stuff.  The original EXE doesn't check for this bit, so it ought to work just fine.

...except that you wouldn't want to run this with the original EXE anyhow, because it wouldn't recognize the beam-free-all flag and so none of your ships would be beam-freed. :)

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
WOOT! Beam-free-all-by-default!
Dang, didn't know there were any flag bits (for anything) that weren't being used. :) And a value of 128 (for a mission that originally had 0 for flags) doesn't crash the original exe, which is good and bad. It means people wouldn't know that the mission's not working right, but on the other hand it doesn't look like the mission/FS2 is screwed up. Any missions built to use this feature would have to note that they require fs2_open version x or later. (Where x would probably be 3.4.) The method you chose is a lot easier then at least one of the methods previously discussed. (Which would have been an option thing that, when checked, would have FRED2 generate the needed beam-free-all SEXP code for the mission when it's saved.)

Hmm, another thing I just thought of, does the code work for ships that haven't entered the mission yet? (Normally you have to do beam-free-all once the ship has entered.) And does it work for ships in the second/third/etc. wave, not just the first? (This isn't a big thing for cap ships, but for fighters with beams it could make a difference.)
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
WOOT! Beam-free-all-by-default!
Quote
Originally posted by EdrickV
It means people wouldn't know that the mission's not working right, but on the other hand it doesn't look like the mission/FS2 is screwed up. Any missions built to use this feature would have to note that they require fs2_open version x or later.


This would have to be done anyway. If someone makes a mission that uses an FS2_Open feature, nine times out of ten its going to generate bogons and blue smoke when loaded into the original FS2. You can (and should) ensure that  FS2_open loads FS2 original missions, but you can't ever expect FS2 to open FS2_Open missions properly.
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline Inquisitor

WOOT! Beam-free-all-by-default!
Committ it, we'll make a test exe and see what happens.

If it's fubar, I'll just roll it back :)
No signature.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
WOOT! Beam-free-all-by-default!
It's committed and works fine on my machine. :)

As for the flag - keep in mind that since +Flags: is a bitfield, 128 is simply ORed to the existing flag.  In practical terms this simply means add 128.  The flag value doesn't necessarily need to equal 128.

Quote
Originally posted by EdrickV
Hmm, another thing I just thought of, does the code work for ships that haven't entered the mission yet? (Normally you have to do beam-free-all once the ship has entered.) And does it work for ships in the second/third/etc. wave, not just the first? (This isn't a big thing for cap ships, but for fighters with beams it could make a difference.)


The code is in the mission parsing routine, which means that upon loading the mission, the parser sets the default status of every ship to beam-free-all.  This should work with ships that haven't arrived yet as well as ships that start out in the mission.

As for whether it works for waves - I honestly don't know.  I can think of reasons why it could go either way.  If each successive wave of ships are simply duplicate instances of the original ships, it ought to work, because it will duplicate the beam-free-all flag along with everything else.  But this may not be the case.  The only way to know for sure is to load it up and test it. :) I'll generously leave this task to someone else, as I'll have a boatload of exam work over the next few days. :D

 

Offline Joey_21

  • 28
    • http://denebsystem.cjb.net/
WOOT! Beam-free-all-by-default!
:yes: Good work. :nod:

One of the exact things I've been waiting for.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
WOOT! Beam-free-all-by-default!
i can forsee this contributing to Battle Of Endor syndrome


but it kicks ass anyway :P
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
WOOT! Beam-free-all-by-default!
Quote
Originally posted by Kazan
... Battle Of Endor syndrome...

What's that?
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
WOOT! Beam-free-all-by-default!
2638 posts and you don't know what battle of endor syndrome is? lol


that's where you put WAAAY TO DAMN MANY cap ships in a mission
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
WOOT! Beam-free-all-by-default!
one Sathanus is good, twenty must be better :)
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
WOOT! Beam-free-all-by-default!
Quote
Originally posted by Kazan

that's where you put WAAAY TO DAMN MANY cap ships in a mission


I was envisioning the vast swarm of millions of TIEs seen from the bridge of the Falcon, actually. I hadn't even given a thought to capships yet.

The first time I'd even hear the phrase was a few days ago. I guess I don't read the threads you do.
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
WOOT! Beam-free-all-by-default!
it's been in fred termonology for years, so I gues you comeing more from the Iwar sect wouldn't have been exposed to it quite as much
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Petrarch of the VBB

  • Koala-monkey
  • 211
WOOT! Beam-free-all-by-default!
There is one symbol for this revelation of beamage:;7