Author Topic: Incidentally...  (Read 7940 times)

0 Members and 1 Guest are viewing this topic.

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
By chaining the key-reset to the key-pressed in the way outlined, the key-pressed will never re-evaluate until after the key-reset has occured.
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Ah, so the chain is the critical part there; thanks, I need to try that out.

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
No problem.  I became pretty adept at creative uses of chaining, repeat counts, and variables doing some of the missions for The Scroll of Atankharzim.  Pretty crazy chaining, actually.  It is a very powerful tool.
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
Quote
Originally posted by Fry_Day
how about a reset-sexp SEXP? basically it's if-, reset SEXP , so stuff like the Robotech TC could make a SEXP that changes ship form if you hit a key, and it wouldn't be single-use.


You mean a repeat function?  Look next to the event tree window in the Events editor...
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
Bumping again.  

I want my end-mission and toggle-shield sexps! :D
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
I just thought of a use for the end-mission sexp.
Code: [Select]

when
-and
--<
---distance
----Alpha 1
----docking bay (Waypoint)
---100
--facing
---GTD Aquitaine
---30
--end-mission


One way to get the player to exit via a docking bay; have a waypoint where the fighterbay would be, have the player fly towards the bay, and when he's close enough the mission would end.
"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
You can do something similar without any source changes, except that instead of automatically ending the mission it would do "allow-warp" and tell the player to land using Alt+J. If you disable the warp effect for Alpha wing, the player won't see his ship warping out either. I did a more advanced system in a mission I made for use with the Robotech MOD where you will get "reassigned" to another ship if the ship you took off from gets destroyed. Two of the ships would even complain if you buzzed the tower/flight deck. (Ala Top Gun borrowing a sound from Flight Unlimited II.)

Not saying an end-mission SEXP wouldn't be useful, but I'm still not sure how to arbitrarily end a mission. (I did look a bit, but still am not sure where the code that executes when you do alt+j is. But then I didn't try tracing it from the functions that try to catch the keypress.)
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 EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
Ok, I think I may have found the function call to use to make an end-mission SEXP. It doesn't have a delay associated with it, but someone else can probably put delay code in the SEXP. The function call:

gameseq_post_event(GS_EVENT_END_GAME);

seems to be what the game uses if you hit escape to bring up the abort mission dialog and choose yes. However, that won't work for multiplayer. Multiplayer should use the multi_quit_game() function in multi_endgame.cpp. I think. None of this is tested of course.
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 EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
Correction: That function will quit the game and boot you back to the main hall without a debriefing, so it's not what we want. Need to look over the various GS_EVENTs to find out what one might work.
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 EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
Ok, having managed to find the code that runs after the player's ship has managed to warp out, I think I may have found our end-mission code:

Code: [Select]

// we have a special debriefing screen for multiplayer furballs
if((Game_mode & GM_MULTIPLAYER) && (The_mission.game_type & MISSION_TYPE_MULTI_DOGFIGHT)){
gameseq_post_event( GS_EVENT_MULTI_DOGFIGHT_DEBRIEF);
}
// do the normal debriefing for all other situations
else {
gameseq_post_event(GS_EVENT_DEBRIEF);
}
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 penguin

  • Eudyptes codus
  • 28
  • Still alive.
Here's a wild and crazy idea for a sexp:  defun

If you're not familiar w/ LISP (which the sexp "language" closely resembles), defun allows you to define a new function -- in essence, to extend the language.

I wonder how tough it would be to implement... I can see lots of potential applications.
your source code slave

 

Offline aldo_14

  • Gunnery Control
  • 213
Quote
Originally posted by EdrickV
Ok, having managed to find the code that runs after the player's ship has managed to warp out, I think I may have found our end-mission code:

Code: [Select]

// we have a special debriefing screen for multiplayer furballs
if((Game_mode & GM_MULTIPLAYER) && (The_mission.game_type & MISSION_TYPE_MULTI_DOGFIGHT)){
gameseq_post_event( GS_EVENT_MULTI_DOGFIGHT_DEBRIEF);
}
// do the normal debriefing for all other situations
else {
gameseq_post_event(GS_EVENT_DEBRIEF);
}
[/B]


If you're after what i think, look at the red-alert code - it has (commented out) lines that dump the player into a standard debrief if the mission just finished is the end fo a campaign.  Possibly they decided to go straight to the end movie after implementing this, or decided to allow the player to die and thus skip the debrief.  Or something.

NB:  From gameseqeunce.h

Code: [Select]

#define GS_EVENT_DEBRIEF 33// go to debriefing


There is a whole bunch of interesting looking stuff in this file that may be of use....such as for impelementing a jump to command briefing sexp or something. :)

BTW - Penguin - a scripting editor type thing would be really neat... i,e, as well as self defined sexps, being able to type in events in a text editor and then import that into a FRED mission.
« Last Edit: October 21, 2002, 04:04:05 pm by 181 »

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
Quote
Originally posted by penguin
Here's a wild and crazy idea for a sexp:  defun

If you're not familiar w/ LISP (which the sexp "language" closely resembles), defun allows you to define a new function -- in essence, to extend the language.

I wonder how tough it would be to implement... I can see lots of potential applications.


Oh yes, oh yes, oh yes, oh yes, oh yes!  If we could find a user friendly way to do that, that would be sweet beyond compare!

Having poked at sexps a little bit (see "Looking for this..." thread), I can say that if there were some sort of system that could provide some semblance of user-friendliness for adding new functions on the fly, it would be the Fredder's equivalent of a religious experience.
« Last Edit: October 21, 2002, 07:47:48 pm by 448 »
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
Quote
Originally posted by aldo_14


If you're after what i think, look at the red-alert code - it has (commented out) lines that dump the player into a standard debrief if the mission just finished is the end fo a campaign.  Possibly they decided to go straight to the end movie after implementing this, or decided to allow the player to die and thus skip the debrief.  Or something.


Actually, that code would dump the player to a debriefing if he was running the mission but not in a campaign. The campaign end code is in freespace.cpp.

Code: [Select]

case GS_EVENT_DEBRIEF:
// did we end the campaign in the main freespace 2 single player campaign?
if(Campaign_ended_in_mission && (Game_mode & GM_CAMPAIGN_MODE) && !stricmp(Campaign.filename, "freespace2")) {
gameseq_post_event(GS_EVENT_END_CAMPAIGN);
} else {
gameseq_set_state(GS_STATE_DEBRIEF);
}
Player_multi_died_check = -1;
break;
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 penguin

  • Eudyptes codus
  • 28
  • Still alive.
Quote
Originally posted by Sesquipedalian


Oh yes, oh yes, oh yes, oh yes, oh yes!  If we could find a user friendly way to do that, that would be sweet beyond compare!

Having poked at sexps a little bit (see "Looking for this..." thread), I can say that if there were some sort of system that could provide some semblance of user-friendliness for adding new functions on the fly, it would be the Fredder's equivalent of a religious experience.
Not sure how user friendly it would be -- have you ever looked at LISP code? :confused: :mad: :confused: :mad: :D

One issue I see with this is persistence and code sharing -- it might be nice to define some functions that are more "global" in scale (not limited to just one mission).  Hmmm...
your source code slave

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
Just so people know, the sexps shields-on and shields-off are now fully functional.  They do just what they sound like: turn the shields of a particular ship or ships on or off in the middle of a mission.

Next up: change-ai-level
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
Quote
Originally posted by Sesquipedalian
change-ai-level


Yeah, okay, forget that, at least from me. :shaking: :confused: :nervous:
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Fury

  • The Curmudgeon
  • 213
Quote
Originally posted by Sesquipedalian
Yeah, okay, forget that, at least from me. :shaking: :confused: :nervous:


Huh?
I think it is wonderful if you can change a ship's AI level on the fly. Fredders surely appreciates that.

 

Offline RandomTiger

  • Senior Member
  • 211
Why would you need that?

 

Offline Fury

  • The Curmudgeon
  • 213
For special events, I could make use of it in TBP missions.

Say, a command ship is destroyed and all surviving fighter pilots gets morale failure. Or when our boys and gals achieves a major victory over the enemy, they gets a boost to their morale.

Or if it is about Vorlons and Shadows. It is often speculated that their fighters are remote controlled, that usually means that without mothership those fighters are easy pickings. But on another view, their AI technology is surely capable of defending themselves fine even without remote control.

I can see a few occasions where changing AI levels on the fly will prove itself useful.

OK, perhaps it will not be used so often, but almost every event can prove to be useful sometimes. I have learned that lesson in several occasions when making missions, although original events are plenty, more can't hurt either.

Of course I and other TBP fredders have to wait until TBP officially uses SCP stuff... :shaking:
« Last Edit: October 23, 2002, 05:16:44 am by 173 »