Author Topic: Any way to tell version of FS2 being run?  (Read 2644 times)

0 Members and 1 Guest are viewing this topic.

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Any way to tell version of FS2 being run?
I know V hid some sexps like the award-medal (or whatever it is).  Might they have one that returns the version of the game?  I've been coding my multiplayer mission with retail FRED2 so they will be compatible with both retail and open.  I am planning on going back and doing fs2_open only versions of them but keep thinking wouldn't it be nice if I could just and them in now with a sexp like when fs2-version > 2 ....  I know the chances of it existing are somewhere between 0 and none but thought I'd ask.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Any way to tell version of FS2 being run?
http://www.hard-light.net/forums/index.php/topic,38294.0.html

You'll need to edit the mission in Notepad, putting the prefix before each line of the FSO-only event.
« Last Edit: January 26, 2007, 09:55:32 pm by Goober5000 »

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Any way to tell version of FS2 being run?
Wonderful!!!!.  Now for the next question.  What if the feature isn't available to say 3.6.9 final?  Actually one of the ones I'm thinking about using isn't in an officail release yet so I would need something like > 3.6.9.  If the 3.6.9 is already coded is in there what would it do if it saw lets say 3.6.10?
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Any way to tell version of FS2 being run?
If you played it with a 3.6.9 build, the feature would be ignored.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Any way to tell version of FS2 being run?
Ok so 3.6.9 is already in there? If the feature is already in 3.6.9 I just put the ;;FSO 3.6.9;; before it?  If I put ;;FSO 3.6.10;; befre it when lets say 3.6.10 RC1 comes out the stuff I coded for 3.6.10 will then be enabled?  If so man do I have plans for this.  Now to just get into FRED2_Open and see what's there.  Well maybe tomorrow.... Oh wait it is tomorrow....
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Any way to tell version of FS2 being run?
Was thinking about what this would do in multiplayer last night while trying to pass out.   Came up with some interesting scenerios some of which I actually remember.  The most intriguing one follows:

Define 3 variables ver1=1 ver2=2 & ver3=0
First event when-->true-->ver1=3 ver2=6 ver3=9
Second event when-->true-->ver1=3 ver2=6 ver3=10
Open up in notepad and put the ;;FSO 3.6.9;; in front of the first event and ;;FSO 3.6.10;; in front of the second.
Now lets say I have 2 bomber wings one named mu and the other nu
First wing arrival is set to ver1 < 3 or (ver1=3 & v2 <6) or (ver1 =3 & ver2 =6 & ver3 <= 9)
Second wing arrival ver1 > 3 or (ver1 = 3 & ver2 > 6) or (ver1 = 3 & ver2 = 6 & ver3 > 9)
Basically the first wing appears if the version is 3.6.9 or earlier the second appears if the version is 3.6.10 or later.

What happens if the host is running 3.6.10 and the client is running 3.6.9?  Maybe a bomber wing wouldn't make too much of a difference but what about 2 different caps with the same arrival cues in the same location?  Are we talking total mayhem or what?
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Any way to tell version of FS2 being run?
For the examples you give it won't cause the slightest problem AFAIK. SEXPs only run on the host machine. If the host machine triggers a SEXP that has an effect it thinks the other machines need to know about it will send the appropriate update packet to the clients.

So things like triggering an arrival should work fine.

The problems come from the fact that for several years no one coding has cared much about multiplayer. As a result there are lots of SEXPs (especially new ones) that don't send an update packet and really should do because nothing else is updating the clients. So basically if you're doing anything with the SEXPs you should test first to see if an update packet is needed. I've fixed a few SEXPs that needed one but there are a lot of them which need fixing.

Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Any way to tell version of FS2 being run?
Good to know.  Guess the next question would be since the host machine is determining the sexp events does the client need the feature in the code?  For example that add-remove-escort sexp priority change.  If I have it and the client doesn't will the ships show up in the right order on the client?  Then there is the cap huge beams attacking bombs "feature".  If I use the ship-turret-target-order and the client doesn't have a version with that will it cause any problems with the cap ship behavior or is that also all determined on the host side? 

Man my brain hurts thinking about this stuff sober.  Need to quit messing around on the computer and get my work done so I can hit the beer.


Thought of one more question on this feature.  Can it be used for ships and wings?  Say I have a mission at the ship limit for retail.  When the ship limit is done away with could I use this to add say a wing of 4 ships (ships 100-103) if I put it in front of both the ships and the wings? 
« Last Edit: January 27, 2007, 04:43:57 pm by FUBAR-BDHR »
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Any way to tell version of FS2 being run?
Good to know.  Guess the next question would be since the host machine is determining the sexp events does the client need the feature in the code?  For example that add-remove-escort sexp priority change.  If I have it and the client doesn't will the ships show up in the right order on the client?


I'd be pleasantly surprised if the add-remove-escort SEXP had any effect on client machines even before I fixed it. The SEXP code certainly isn't doing a multi callback so unless the HUD code is passing it on to the clients that there has been an update somewhere I doubt that it does.

Quote
Then there is the cap huge beams attacking bombs "feature".  If I use the ship-turret-target-order and the client doesn't have a version with that will it cause any problems with the cap ship behavior or is that also all determined on the host side? 

In that case you'd almost certainly be fine. The host does all the ai work and then notifies the client that a ship has fired a weapon and at what.

In most of these cases it is possible to take a rough guess if there will be a problem.

1) The commonly used [V] SEXPs can be assumed to be safe for multi. If there was a problem with one of these not working I assume you'd have noticed it already.
2) All conditional SEXPs are safe as they're only evaluated on the host anyway (unless they have a side effect of some sort - Can't think of any which do off the top of my head though).
3) Any change SEXP that touches functions which the host is completely responsible for can be assumed to be safe for multiplayer as the updates will be passed on by the already existing update code. That means stuff like AI functions should almost always work.
4) The Set ammo, Set weapon, end-mission and modify-variable SEXPs all work in multi. I know cause I fixed them. Taylor has fixed a lot of other multiplayer problems but as far as I know I'm the only one fixing SEXPs.
5) Assume any other SEXP that doesn't fit in one of the above mentioned categories won't work until you test it and make sure for certain it does.


Remember that in pretty much any case where this sort of thing happens the host is completely unaware that there is a problem. I've had cases where I've used the change-ship-class SEXP for instance and everything looked fine on the host machine when I changed a ship from a fenris into an orion. The clients however had weapons appearing from nowhere, continued to a fenris and found themselves bumping off an invisible orion shaped object (All collision detection is done on the host. Which is why you can get smacked by apparently non-rotating objects like the Shivan Comm Node or the Knossos portal if you're on a client machine)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Any way to tell version of FS2 being run?
Ok I'll be sure to test as both host and client.  I could just put client on secon monitor and join as observer.  If I remember correctly you can swith to the view of a player.  If I see something different on the 2 monitors then I know there is a problem. 

One final question.  If there is a standalone server (still crossing fingers on this one) situtation is the standalone the machine that does all the host functions mentioned above? 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Any way to tell version of FS2 being run?
In that case yes, the standalone does all the work and everyone sees the screw ups AFAIK.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]