Author Topic: Intrasystem Warping: 20% Less Hassle Than Before!  (Read 6332 times)

0 Members and 1 Guest are viewing this topic.

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Intrasystem Warping: 20% Less Hassle Than Before!
Through the use of the scripting system, ships can now be warped out without leaving the mission. Basically, once they warp out, they are put into a limbo state.

Attached is an example of how you can use this, using the script-eval SEXP to access the scripting system, along with the scripting.tbl file needed to define the functions used in the example. ("mn.getShipByName('Alpha 2'):warpOut(false)" is a bit long for FRED)

Also, for testing, I added a debug console command; 'warp'. 'warp true Enemy' will warp in the ship called "Enemy", while 'warp false Enemy' will temp-warp it out. Leaving out the name will use the player ship's target instead.

IMPORTANT: When using scripting functions with script-eval, do not ever use double quotation marks ("); always use single quotation marks('). If you use double quotation marks, you will royally screw up your SEXP tree.

Example files:
http://fs2source.warpcore.org/temp/wmc/intrasystem/scripting.tbl
http://fs2source.warpcore.org/temp/wmc/intrasystem/intrasystem.gif

The build:
http://fs2source.warpcore.org/exes/latest/C21052006.zip
« Last Edit: May 21, 2006, 03:48:55 pm by WMCoolmon »
-C

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Intrasystem Warping: 20% Less Hassle Than Before!
Very nice.

Since I can't see the code yet though, how are ships in limbo handled by the code? What SEXPs can you use with them? Are they treated as vanished or departed for the duration that they're gone?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Re: Intrasystem Warping: 20% Less Hassle Than Before!
'vanishing' a ship is the same as killing it or making it a depart, in the sense of comparing it to the limbo.

Basically, ships are still present - they just aren't drawn, don't move, and the AI doesn't think etc. So SEXPs can still be used on them, probably all of them. All I did was create a limbo flag and modify the various places in the code where it needed to be checked for, plus modify the warpout functions so that you can specify a false warpout.

They do add a departure event to the mission log, though. I did this because I figured that there might be circumstances where the FREDder wanted to do an intrasystem warp, but wanted it to look like the ship had left for good. For the same reason, the ship is removed from the escort list.

The wingman gauge does show faux-departed ships; I figured that allies would be able to tell what their other ships were doing.
-C

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Intrasystem Warping: 20% Less Hassle Than Before!
Fair enough. Definitely gets my thumbs up :yes:
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Axem

  • 211
Re: Intrasystem Warping: 20% Less Hassle Than Before!
So then could this also be used to make a ship pop into a hangar for a bit (say for repairs, rearming), then come on out again?

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Intrasystem Warping: 20% Less Hassle Than Before!
While this sounds very cool, we're supposed to be in a code freeze. :p Where are your five fixed bugs?

 

Offline Ransom

  • M. Night Russel
  • 210
  • It will not wait.
    • Rate of Injury
Re: Intrasystem Warping: 20% Less Hassle Than Before!
Wow, this is incredibly useful. Until now I've been doing it in a really hackish manner, this'll make my life a lot easier.

 

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Re: Intrasystem Warping: 20% Less Hassle Than Before!
While this sounds very cool, we're supposed to be in a code freeze. :p Where are your five fixed bugs?

I really don't want to fix bugs, I haven't committed anything to CVS, and this was already in my codetree before the five bugs rule came about. Nagging me about fixing bugs - which I'm rarely very good at, unless it's very obvious and/or in my own code, is not the best way to motivate me to do something that I already don't want to do. :)
-C

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Intrasystem Warping: 20% Less Hassle Than Before!
What be these 5 bugs?
The Trivial Psychic Strikes Again!

 

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Re: Intrasystem Warping: 20% Less Hassle Than Before!
Goober, phreak, and I were required to fix five bugs before our next feature commit (Goober already has done that, I believe) to reduce the number of bugs in mantis. And phreak hasn't been active since that was instated, I believe. Taylor has been a bugfixing machine, and karajorma has been helping out, but I still don't really relish the thought of squinting at lines of code on a computer screen to track down a bug, that I don't even know if it's valid anymore, or if I can even reproduce.

OTOH, it's not like never bugfixing is going to give a product that anyone wants to use, so I feel a bit obligated to do so, if I want to commit features. So I am not happy about it at all, but I do feel obligated to abide by it.
-C

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: Intrasystem Warping: 20% Less Hassle Than Before!
It would be nice if someone could get around to my support ship bug. I just checked in the karajorma 5/17 version and it's still a problem. It takes a little work to produce but occurs pretty consistently.

Anyway, this is a cool feature. It should make this simpler than the old way of doing it (using the duplicate ship with some screwy ASCII character that FS2 doesn't recognize in its name :D). I need to give it a try some time.

 

Offline Ransom

  • M. Night Russel
  • 210
  • It will not wait.
    • Rate of Injury
Re: Intrasystem Warping: 20% Less Hassle Than Before!
Was this ever committed?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Intrasystem Warping: 20% Less Hassle Than Before!
Yep.

To the main CVS branch, not the 3.6.9 one.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Ransom

  • M. Night Russel
  • 210
  • It will not wait.
    • Rate of Injury
Re: Intrasystem Warping: 20% Less Hassle Than Before!
EDIT: That's right FS2, abruptly start working as soon as I give up and make a post about it.

There's another problem now. It seems once the ship's warped back in, SEXPs no longer affect it and any messages in its name will be delivered by Command as though it was still departed.
« Last Edit: August 06, 2006, 02:28:25 pm by Ransom Arceihn »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Intrasystem Warping: 20% Less Hassle Than Before!
Now that IS odd. Because I know you can affect ships which were spawned using the Ship-Create SEXP and that should be less likely to work than this. Mantis the problem and I'll take a look at it if Goober or WMC don't.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Ransom

  • M. Night Russel
  • 210
  • It will not wait.
    • Rate of Injury
Re: Intrasystem Warping: 20% Less Hassle Than Before!
Done.

The mission I attached there uses two SEXPs I know don't work, but I haven't really used it much yet so I'm not sure how many SEXPs aren't cooperating. Apparently some do work, as I discovered when I used self-destruct for the purposes of the test mission.