Hard Light Productions Forums

FreeSpace Releases => Scripting Releases => Topic started by: FelixJim on February 07, 2013, 04:13:41 pm

Title: In-Mission Techroom Script v0.4 (Updated 19/06/2013)
Post by: FelixJim on February 07, 2013, 04:13:41 pm
(http://s23.postimg.org/qzgmmp1ef/screen0010.png) (http://postimg.org/image/qzgmmp1ef/)

Alt-2 gives info on your weapons:

(http://s23.postimg.org/e9ce9ltg7/screen0012.png) (http://postimg.org/image/e9ce9ltg7/)

(http://s23.postimg.org/5jfb8rbyv/screen0015.png) (http://postimg.org/image/5jfb8rbyv/)

And Alt-3 gives info on your target:

(http://s23.postimg.org/on8mp3ot3/screen0013.png) (http://postimg.org/image/on8mp3ot3/)

(http://s23.postimg.org/jysmtwzmf/screen0011.png) (http://postimg.org/image/jysmtwzmf/)

(http://s23.postimg.org/5gvflx8bb/screen0014.png) (http://postimg.org/image/5gvflx8bb/)


The game is paused whilst you're in one of these screens until you press the same key combination again, upon which the game is unpaused and you can continue playing.


Installation:

Download the attached file (bottom of this post (this has been deleted by a ninja at the moment, so go for the second option)) or extract imt-sct.tbm from data\tables in the modder pack. You can put it in any existing mod, including the mediavps, or an entirely new mod and edit the mod.ini of the mod you wish to use it with to load the mod you've just created.
Optional: Open up the file using a text editor such as Notepad++, and edit the values in the settings section near the beginning to your liking (includes options to change keybindings if they're clashing with something else).

Modder pack: This script can be tightly controlled via FRED and various auxiliary files; the modder pack contains the (same) script, documentation and example mission and auxiliary text files. Download it here: http://www.mediafire.com/?c5emoq9knnnu0p9
You do not need FRED to use the script! It will work just as-is if you dump it in \data\tables; this is just if modders want to use it for a specific purpose. The modder features are too numerous for me to test all the possibilities thoroughly - I've done what I can, but keep this in mind, especially if you're using the features in odd ways.

I'd be especially grateful for any suggestions for improving this script further.

Known Issues:

Coming in version 0.5:
Title: Re: In-Mission Techroom Script
Post by: Phantom Hoover on February 07, 2013, 05:32:54 pm
this is incredibly cool!
Title: Re: In-Mission Techroom Script
Post by: FelixJim on February 08, 2013, 02:30:03 am
Thanks! Have you got it working or are you just going by the screenies?
Title: Re: In-Mission Techroom Script
Post by: X3N0-Life-Form on February 08, 2013, 02:51:12 am
W00t, this thing looks awesome. I'll see if I can get it to work this w-e.
*grabs code*
Title: Re: In-Mission Techroom Script
Post by: niffiwan on February 08, 2013, 03:24:04 am
very cool  :yes: We should figure out how to give LUA a pause hook (or whatever it's called, I'm noobish with the whole C++/LUA integration thing)
Title: Re: In-Mission Techroom Script
Post by: FelixJim on February 08, 2013, 06:54:43 am
very cool  :yes: We should figure out how to give LUA a pause hook (or whatever it's called, I'm noobish with the whole C++/LUA integration thing)
I was thinking about asking how hard one of these would be to add, but by then I'd got the rotating model working and I doubt I'd be able to do that if the game was entirely paused. It's not exactly necessary, but it does look good.

EDIT: Added installation instructions to first post.
Title: Re: In-Mission Techroom Script
Post by: Admiral MS on February 08, 2013, 10:26:21 am
Looks great. Why did I never get the idea to do this?  :yes:

Quote
On pressing Alt-2, the game is "paused" (well, no, time compression is set to 1%, this was the best I could manage)
Code: [Select]
mn.runSEXP("set-time-compression !0.001!")does also work and give you something closer to a paused game. I don't think this would affect your rotation.
Title: Re: In-Mission Techroom Script
Post by: FelixJim on February 08, 2013, 10:52:30 am
Code: [Select]
mn.runSEXP("set-time-compression !0.001!")does also work and give you something closer to a paused game. I don't think this would affect your rotation.

I always assumed using sexps = must use integers , so thanks for pointing this out to me. And no, the model rotates on a frame by frame basis, so it's immune to time compression effects. Updated script in first post with reduced time compression.
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: FelixJim on April 21, 2013, 12:53:54 pm
Bump for new version of the script with new features. First post edited accordingly.
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: Apollo on April 21, 2013, 01:37:32 pm
What build does this require? I crashed on pressing ALT-1 and I'm not sure if it's a scripting error or an incompatibility.

EDIT: I tried to reproduce it with a debug build, but it crashes when I commit.



[attachment deleted by ninja]
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: FelixJim on April 21, 2013, 01:48:34 pm
I've just tested with 3.6.18, 3.6.7 RC1 and r9638 and it worked fine for me, so unless you're using an older build I don't think it's a build issue. Can you tell me any more? What mod and build you were using, what ship you were flying, what did the error say, things like that. Mod developers might have set their ships up in some way I wasn't expecting, so that could be causing a problem.

EDIT: Are you using an older version (I called the old version viewship-sct.tbm, which you appear to be using) or did you just rename the newer version (imt-sct.tbm)?
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: Apollo on April 21, 2013, 01:51:49 pm
I did it with the mod I'm developing, so there's some possibility it's a problem on my end.

Give me a minute and I'll test it with 3.6.12 mediavps.
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: Apollo on April 21, 2013, 01:56:27 pm
I'm using the newer version but it has an old filename because I replaced everything in the old file with the new stuff.

That may be causing problems. I'll rename it and try again.

EDIT: That fixed it.
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: FelixJim on April 21, 2013, 02:07:08 pm
Hooray!
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: Hoot on May 12, 2013, 03:13:06 pm
Finally! REAL Information!
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: mjn.mixael on May 12, 2013, 03:26:47 pm
So, I like this script! Here's a couple thoughts after using it a bit.

You should lock the player's weapon keys when in a tech room screen and unlock them afterwards. You can run SEXPs in the script to do that.

You might consider adding a title line to each tech screen saying 'Player Ship Info', 'Player Weapon Info', and 'Target Info'... or something like that. Just to be clear about exactly what each screen is. You might also consider adding a line that says what keypress is needed to exit the current tech screen. 'EXIT: Alt-1' or something.

Nice work on this.
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: Black Wolf on May 12, 2013, 11:14:13 pm
Can this be turned on and off on a per mission basis? I'd love to make this one way to differentiate the capabilities of specific ships, or give the player an extra ability for a specific type of mission (I have some very specific TI missions in mind that this would slot very nicely into).
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: mjn.mixael on May 12, 2013, 11:23:53 pm
Can this be turned on and off on a per mission basis? I'd love to make this one way to differentiate the capabilities of specific ships, or give the player an extra ability for a specific type of mission (I have some very specific TI missions in mind that this would slot very nicely into).

HEY! Don't steal my ideas!  :p
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: FelixJim on May 13, 2013, 05:48:27 pm
Finally! REAL Information!

I'm glad to have helped satisfy your thirst for knowledge!

So, I like this script! Here's a couple thoughts after using it a bit.

You should lock the player's weapon keys when in a tech room screen and unlock them afterwards. You can run SEXPs in the script to do that.

You might consider adding a title line to each tech screen saying 'Player Ship Info', 'Player Weapon Info', and 'Target Info'... or something like that. Just to be clear about exactly what each screen is. You might also consider adding a line that says what keypress is needed to exit the current tech screen. 'EXIT: Alt-1' or something.

Nice work on this.

You're right - I ought to be locking the player up as much as I can - definitely look into incorporating that.

There are already small titles to each screen in the top left - I did want to have bigger and better ones, but couldn't come up with a way to do that within the confines of scripting (N.B - if you want to screw with your players, try changing the font size directly via scripting). I'd have to include a new font or some graphics I think, which is moving more towards a mod than a simple script. I can't make up my mind if that's a good, bad, or neither thing though. "Please press [whatever] to exit" should be straightforward to add though.

Can this be turned on and off on a per mission basis? I'd love to make this one way to differentiate the capabilities of specific ships, or give the player an extra ability for a specific type of mission (I have some very specific TI missions in mind that this would slot very nicely into).

Yeah - easily done! Slightly better than a per-mission basis, I'll stick in a feature where you can turn parts on and off by sexp and then you're free to switch it off and on at will. To be honest, this is a very simple script, and if you want bits tweaked for a specific use I'm happy to do that within reason, or you can turn whatever other scripters you have to hand loose on it. I'll certainly add in an on/off feature at FREDer discretion though.

And thank you all for feedback! All these promises given, bear in mind I am in exam season at the moment, so I'm unlikely to get around to all this as quickly as I'd like. RL is a curse upon us all.
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: mjn.mixael on May 13, 2013, 07:21:21 pm
There are already small titles to each screen in the top left - I did want to have bigger and better ones, but couldn't come up with a way to do that within the confines of scripting (N.B - if you want to screw with your players, try changing the font size directly via scripting). I'd have to include a new font or some graphics I think, which is moving more towards a mod than a simple script. I can't make up my mind if that's a good, bad, or neither thing though. "Please press [whatever] to exit" should be straightforward to add though.

I'll settle for the titles being centered at the top. :) That would make them more noticeable at far less of a cost.
Title: Re: In-Mission Techroom Script (Updated 21/04/2013)
Post by: FelixJim on May 15, 2013, 09:04:09 am
I'll have a look at it - I'm a big fan of having everything perfectly left-aligned but at least an option for a centred title wouldn't go amiss for others.
Title: Re: In-Mission Techroom Script v0.3 (Updated 06/06/2013)
Post by: FelixJim on June 06, 2013, 07:16:25 am
Bump for great justice! And partially because the script's been updated. But mostly for great justice. Check back to the first post.

New features:
Title: Re: In-Mission Techroom Script v0.31 (Updated 06/06/2013)
Post by: FelixJim on June 06, 2013, 07:30:37 am
A few minutes after uploading v0.3 I suddenly thought of a scenario in which a mistaken FREDer could crash FSO - this is now fixed in v0.31 - so make sure you have that version.
Title: Re: In-Mission Techroom Script v0.31 (Updated 06/06/2013)
Post by: mjn.mixael on June 06, 2013, 09:45:25 am
:yes:

Something I just noticed recently.. You have a script function or variable (I'm not sure which) that's called 'loadship'. That's the exact same on as in Admiral MS' Shipave script! :) I did a find and replace on the old script the clear the conflict.
Title: Re: In-Mission Techroom Script v0.31 (Updated 06/06/2013)
Post by: FelixJim on June 06, 2013, 11:15:36 am
Ah, that would cause problems, yes. All the variables are stored in a table called "imt" to avoid just this thing, but I really ought to store all the functions in there as well. Seeing as doing this will break any mission making use of the FRED functions I'm going to make a push now and release a fix - the chances of anyone releasing anything this evening using this script are low enough for me to not worry too much.
Title: Re: In-Mission Techroom Script v0.31 (Updated 06/06/2013)
Post by: mjn.mixael on June 06, 2013, 11:29:35 am
:yes:
Title: Re: In-Mission Techroom Script v0.32 (Updated 06/06/2013)
Post by: FelixJim on June 06, 2013, 01:08:01 pm
Updated to v0.32

Bugfixes:

Future updates to the script should not cause break any previous usage from now; (aside from having to reedit the settings, but this might be fixed later) should be drag-and-drop replacements.

Future plans:

I also forgot to mention that in the 0.3 update the ability to switch between screens without going back to gameplay first was added.
Title: Re: In-Mission Techroom Script v0.32 (Updated 06/06/2013)
Post by: mjn.mixael on June 06, 2013, 03:54:34 pm
Well, as long as you are asking for suggestions... :)

One thing I found myself wanting was an easy way for us non-scripters to change the default text/border color. Default to green, but I'd love to be able to specify an RGB of my own.
Title: Re: In-Mission Techroom Script v0.32 (Updated 06/06/2013)
Post by: FelixJim on June 06, 2013, 05:57:51 pm
One thing I found myself wanting was an easy way for us non-scripters to change the default text/border color. Default to green, but I'd love to be able to specify an RGB of my own.
That would be a useful thing to have - it'll be added in. Thanks for the suggestion!
Title: Re: In-Mission Techroom Script v0.32 (Updated 06/06/2013)
Post by: mjn.mixael on June 06, 2013, 07:52:41 pm
So, I'm going to be a total modder here.. but well, I am! :) Take or leave whatever, but I'm going to expand on my previous request.

Looking through the script to find the chunks to change, I came across the fact that it seems that you change the color of the text of the subsystems based on health? That, and the fact that I found the main places to change the colors made me want a little more control to really make it look nice and fit the style of my mod.

I'd love to be able to set the border color and the text color separately. Bonus points for the following, but may be overkill. :nervous: Setting the title text color, the 'press this button to return' text color, and setting the health color values each would be extra handy.

So there, it is.. you can give me that blank stare now. :)

That said... I'm loving this script.
(http://i282.photobucket.com/albums/kk264/mjnmixael/Private/ImageBin-13_zps4232c366.jpg)

Lastly, I thought of something you may or may not be able to do with the custom descriptions. If I understand it correctly you have to use a script call to assign a custom description to a ship? What about a way to link a custom description to a ship class in the imt.descriptions.txt? My idea, as I was reading about custom descriptions, was to use that as a way to add notes and hints on tactics and strategies for hostile craft. But I wouldn't want to do that if I needed to run a whole bunch of script calls at the beginning of each mission. Did I just make sense?

It also seems as if the script is having a hard time getting tech descriptions from XSTR("TEXT",####). Ship wasn't in the techroom. So... instead, how about a setting to allow non-techroom ships regardless?
Title: Re: In-Mission Techroom Script v0.32 (Updated 06/06/2013)
Post by: FelixJim on June 07, 2013, 05:38:30 am
All your colour requests are perfectly doable - I've been looking at user-set colours for the based-on-health colours, and setting the border colour, title colour and press-to-leave colours separately should simple enough to add in as well. The colour system needs looking at anyway - I have a feeling there's a potential bug in there somewhere.

The custom descriptions feature was purely designed for specific ships, but there's no reason a similar, but separate, feature shouldn't be set up for an entire class without having to do anything FRED-side. I can see a new file called imt_classdescriptions.txt taking a form like:

Code: [Select]
GTF Hercules: Custom Description.
SD Demon: Custom Description.

These would be applied automatically, but any custom descriptions applied using imt.dsc() would take priority.

A straightforward true/false setting would be useful allow for letting you access ships not in the techroom. It'll be added!

In other news, I've got the new settings system set up (although it still needs a bit of  rearranging to improve efficiency) - you can store your settings in a text file which override those in the script. This'll mean you don't have to reset all your settings every time I update the script.

And thanks for all these suggestions - it's good to have someone take an interest. The scripting board doesn't seem to get much love generally.
Title: Re: In-Mission Techroom Script v0.32 (Updated 06/06/2013)
Post by: mjn.mixael on June 07, 2013, 07:28:20 am
:yes:

That all sounds great to me!

I try to make sure I pay attention to new scripts because they allow us FREDers to do things we otherwise couldn't. Admiral MS' shipsave script, for example, was originally intended to replace Red Alerts but I found it highly useful for checkpoints and in-mission cutscences with it's copy-ship functions. I have a few useful ideas for this script as well, especially with all the FRED based control you added...
Title: Re: In-Mission Techroom Script v0.33 (Updated 07/06/2013)
Post by: FelixJim on June 07, 2013, 03:02:41 pm
Hotfix release
I can't believe I released something with this huge a bug - the previous version would crash every time you restarted a mission. I wonder how many more releases I can squeeze into such a short time.

Bugfixes:

New features:

This is a hotfix release to fix a major bug, and the new features are in whatever state they happened to be in, if you catch my drift. Several colour settings are commented out as they are not implemented yet.
Title: Re: In-Mission Techroom Script v0.4 (Updated 19/06/2013)
Post by: FelixJim on June 19, 2013, 11:00:56 am
Updated to version 0.4.

New features (in no particular order):

Bugfixes:

Worth reiterating: Script will still happily work if you just drop it into data/tables without any of this extra stuff.
Title: Re: In-Mission Techroom Script v0.4 (Updated 19/06/2013)
Post by: BLARGHER on June 19, 2013, 08:34:08 pm
This is very nice. Complements the Tech Room without making it redundant, which can be quite hard to do. This would have been particularly nice for WoD and DE too. If my mod ever comes out, it will certainly have this.
Title: Re: In-Mission Techroom Script v0.4 (Updated 19/06/2013)
Post by: FelixJim on June 20, 2013, 07:01:09 am
Mods like WoD and DE were part of the inspiration for this, yeah; as good as all that new stuff is, it can be a little overwhelming at times. And good luck with your mod!
Title: Re: In-Mission Techroom Script v0.4 (Updated 19/06/2013)
Post by: FelixJim on January 25, 2014, 05:05:13 pm
Bump. Updated first post with some very stimulating "Coming Soon!" features. I don't know how soon because I'm waiting mainly for this patch: http://scp.indiegames.us/mantis/view.php?id=2891 to go through and beyond nagging good people who give up their time to help us all out of the kindness of their hearts I can't hurry that along. Anyone considering using this script might find it helpful to know what's in the pipeline, that's all (especially as the way settings work is undergoing a backwards-compatibility-breaking overhaul).