Hard Light Productions Forums
FreeSpace Releases => Scripting Releases => Topic started by: FelixJim on February 07, 2013, 04:13:41 pm
-
Updated 19/06/2013
Sometimes, you're playing a new mod, flying a new ship, using new weapons, facing new adversaries, and you're not sure how they all fit together. Is that a weak, cannon-fodder fighter you're flying, or a top of the range killing machine? Are those 4-volley dogfighting missiles, or heavy-duty bombs? Is that capship you're trying to take down deadly to fighters or other capships?
Do you memorise the entire techroom before the mission? NO! Do you alt-tab out to the wiki to read up on all this new equipment every ten minutes? NO! Do you blunder about with trial and error? Unfortunately, yes. UNTIL NOW!
With this script, you can simply tap Alt-1 at any time during the mission to read up about the ship you're flying:
(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:
- Text will overspill text boxes if the font size is too big, screen resolution too low and/or there is simply too much text. Should be fixed once Mantis issue 0002891 has been resolved.
- For the ship specifications and target specifications sections, the Max Speed entry will scale with current ETS. Should be fixable once Mantis issue 0002889 has been resolved.
- The secondary bank capacity will return the maximum number of the current secondary type loaded.
- Turrets and subsystems are not always clearly named.
- Background images will not work from inside VPs.
- The SEXPs unlock-primary-weapon, unlock-secondary-weapon, unlock-afterburner and allow-warp are run whenever the "techroom" is left; this may interfere with mission logic.
Coming in version 0.5:
- Fix for Known Issue 1. m!m has a patch in the works for this: http://scp.indiegames.us/mantis/view.php?id=2891, it's just waiting to be reviewed and things (good old m!m).
- Fix for Known Issue 2. What I needed to do this appeared in 9986 (good old Niffiwan).
- The way the script handles centring of strings will be much improved thanks to something I spotted in one of WMCoolmon's scripts (good old WMCoolmon).
- Most excitingly: I've finally worked out how to access files inside VPs. The .txt files I've been trying to work with are no good, but .cfg files are great! This means the text files for settings and custom descriptions will be renamed from blah.txt to blah.cfg, and moved from data\scripts to data\config, and the auxiliary script will be completely chucked out as redundant and henceforth unsupported, which will unfortunately require anyone using these to do a little cleaning. This is thanks to a conversation with Axem which prompted me to re-look over the way the mediaVPs team did things (good old Axem, good old mediaVPs team).
- Fix for Known Issue 5 - background images will load from inside VPs properly in version 0.5.
- Hopefully a fix for Known Issue 6 - I haven't looked into how yet, but I am at least aware of the issue.
-
this is incredibly cool!
-
Thanks! Have you got it working or are you just going by the screenies?
-
W00t, this thing looks awesome. I'll see if I can get it to work this w-e.
*grabs code*
-
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)
-
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.
-
Looks great. Why did I never get the idea to do this? :yes:
On pressing Alt-2, the game is "paused" (well, no, time compression is set to 1%, this was the best I could manage)
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.
-
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.
-
Bump for new version of the script with new features. First post edited accordingly.
-
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]
-
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)?
-
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.
-
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.
-
Hooray!
-
Finally! REAL Information!
-
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.
-
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).
-
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
-
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.
-
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.
-
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.
-
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:
- FREDer functions. Lots of FREDer functions. You can really tweak the script to your liking if you have a specific use in mind for your mod. Download the FREDer pack for more information
- Boxes! It's amazing how much better this looks with boxes. Can be turned off in settings
- New model rotation. Swivels and zooms semi-randomly. The old, simple rotation can be re-enabled in the settings if you don't like the new method
- Ability to edit and centre titles (off by default)
- Flashing "Press [key] to close." message. Flashing can be tweaked or turned off in the settings
-
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.
-
: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.
-
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.
-
:yes:
-
Updated to v0.32
Bugfixes:
- Default model rotation now goes at correct speed
- All functions stored in the 'imt' table - should prevent conflicts
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:
- Comment script properly
- Set up a separate optional settings file so that you can update the script without having to change anything
- Smooth out model spin more
- Look into a solution for text overflowing boxes
- Decide whether setting this up as a complete mod would make it more accessible to ordinary players and be worth it
- Any other suggestions I think are worth adding. Feel free to ask for things!
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.
-
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.
-
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!
-
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?
-
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:
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.
-
: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...
-
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:
- Restarting the mission no longer causes FSO to crash
- Requirement for "End of File" at the end of imt_descriptions.txt removed, fixing a bug where FSO would crash if it was not present. It is removed from the sample imt_descriptions.txt, but documentation still erroneously demands you have it in place. It won't cause any harm if it is there - it'll be treated as just another custom description.
New features:
- Settings file support added, but it is unoptimised, has not been fully tested and no sample file or documentation exists yet - I do not recommend you rely on this feature yet
- Ability to set the colour of the text and border (not separately yet and untested)
- Script is mostly commented now
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.
-
Updated to version 0.4.
New features (in no particular order):
- Presence in techroom override added - can now set the techroom description to appear regardless of the ship's presence in techroom (off by default)
- Colour settings added - colours for the title, text, border, press-to-close, subsystems at high health, subsystems at low health and "Disabled" message can now all be set individually. The subsystems and "Disabled" message can also be set to use the regular text colour (off by default)
- Ability to set settings via imt_settings.txt is now in a state where I can recommend using it; example file and documentation included in modder pack
- Settings for the positions of all elements added
- Setting to centre title removed, as it's replaced by the above - hint for suitable value included in script comments and modder documentation
- Ability to set custom descriptions for ship classes in imt_classdescriptions.txt added
- Ability to set custom descriptions for specific ships tweaked slightly - now the last custom description applied will be used, not the first
- Ability to edit settings from FRED using imt.c() added; should be used carefully, this is a powerful function
- Auxiliary script added to modder pack to provide an alternative to the auxiliary text files - imt_settings.txt, imt_descriptions.txt and imt_classdescriptions.txt will not work from inside a VP, but the auxiliary script will
- Settings added to disable the target specifications section for specific IFFs and ship classes
- Ability to set background images added
Bugfixes:
- Users can no longer crash FSO by passing bad data through imt_settings.txt
- Not exactly bugs, but all magic numbers eliminated from script and some optimisations (not significant enough to notice, but what the heck) performed
Worth reiterating: Script will still happily work if you just drop it into data/tables without any of this extra stuff.
-
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.
-
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!
-
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).