MSC Scripting Questions

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
This forum sticky is for questions that potential MSC Scripters may wish to ask.

If you want the source on a specific script, name it (or describe it best you can, if you don't know the specific file), and I'll post it up here.

Similarly, if you have any questions, post them in this thread. If you have a script that isn't working, please paste that too, preferably in [code] brackets.

Most all the documentation on scripting that is available can be found in your MSC install under %steam_path%\steamapps\common\Half-Life\msc\test_scripts

More specifically, as stated in "!test_scripts_go_here.txt":

!test_scripts_go_here.txt said:
• ms.stx - Primary reference file
- The formatting in this document is difficult to read, however, as it also doubles as a syntax file for EditPlus:
http://www.editplus.com/download.html

• Scripting_AllDocs.txt
- Is the original script write up by Dogg with some edits, but it is not as up to date as the ms.stx

• Scripts_Read_Me.txt
- Provides some additional info regarding syntax and common problems.

In that folder are several subfolders with about a thousand example scripts. These can be opened with any text reader (eg. Notepad), though EditPlus, configured with the ms.stx, will also provide syntax highlighting. These examples are automatically updated with each new patch, and we usually add a few more with each update.

Using test scripts requires no compiling. Merely place your new script file in the test_scripts folder, and follow the instructions at the top of test_scripts/!test_scripts_go_here.txt on how to configure your server or listenserver to use them with the test_scripts map . Keep in mind, one limitation of the "compile-less" script system is that you can't add custom items (more of an internal limitation than an anti-cheat feature - unlike the fact that test_scripts will not function on [FN]).

If a mapper uses your script, and it's published, you'll get one reward from Sembelbin in that patch. Should you prove proficient, we'll get you the compiler and start you on learning how to do items and spells.

Good luck, and happy creature creation.
 

Abarcine

New Adventurer
Heroes of Dawn
Joined
Aug 12, 2015
Messages
26
Reaction score
0
what would be most useful to you for me to start to learn and how would I begin going about it.
 
  • Thread starter
  • Admin
  • #3

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Geeze... Where to start.

The most time consuming things (outside of items/spells) are usually monsters - especially boss monsters - but bosses tend to be rather advanced. Plus, they do require you to have a bit of jack-of-all-trades thing going, as you'll probably need to tweak models and figure out how the mob interacts with its boss chamber. Thus it helps if you have both minor modeling and mapping skills, though I suppose you can squeak on by without them, provided you keep things simple.

Simplest things to do are usually non-combat NPCs. These days, that usually means learning how the menu interaction system works as well.

I suppose the first thing to do, would be to get the test_scripts system to work, and make sure you can make "test_scripts/how_to_make_a_monster" spawn on the test_scripts map.

Next step after that would be a "hello world" task. MSC equivalent to that would be to create an NPC, perhaps named "Hello World" that says "Hello World" when hailed (catchspeech), and then maybe allows the same with menu interaction (game_menu_getoptions). Lastly, to get him preemptively greet you when you come into range.

Most everything for that is covered in the three scripts found in msc\test_scripts\example_scripts\npc\shender_east

Rigging up an NPC to charge for something is covered in example_scripts\npc\edana\mergur.script

Rigging up an NPC to require an item is covered in example_scripts\npc\generic\tutorial_npc_req_item.script (which is fully commented, much like how_to_make_a_monster.script.) Mind that you have to work with existing items (I think item_ratskull does exist, but item_torch, or health_apple, are typical placeholders.)

Once you can do all that, Oyster is the only person coming to me with new script requests lately (not that there aren't thousands in the backlog). I think he needs dwarves that do various things, but I'm not sure as to the details. You'd have to contact him for more info. Most of his current requests are fairly simple IIRC, though he's also good at coming up with stuff I've no idea how to accomplish. Several example dwarf NPCs are in example_scripts\npc\generic\ and a complex and slightly dated Forsuth in example_scripts\npc\the_wall.

Could use a new giant spider boss for his latest map (like, REALLY giant, and intended to work while the players sit in the middle of a web that is about 1024 units across) - maybe have it suspended over them and striking. That's advanced stuff though, and will almost certainly require model tweaking. Map needs quite a bit of tweaking as well - dunno when I'll get the chance to go back to that.

Feel free to ignore the following, as it kinda turned into me thinking to myself while I looked at the task list, but it does help explain why I ain't got much in the way of "useful and simple" things to do, so I'll keep it here in a quote:
Thothie looks a the task list and squirms said:
Looking at the immediate to-do list...

The Lightning Forged skeleton (example_scripts\monsters\skeleton_lightning) needs its entire scan/zap system redone from scratch - though that'd be pretty advanced, and I'm not sure how to go about it in such a way that'll both be optimal and prevent it from shooting through things. I suspect trading out the $get_tsphere for a slower damaged base scan maybe the only way to go.

There is a report that the Ice Skeleton (example_scripts\monsters\skeleton_ice.script) is preventing heals during its target acquisition process, but glancing at the script, I don't see how.

I kinda wanna replace "can't attack" and heavy stun (effects/effect_stun and effects/heavy_stun) with a debilitating visual effect that slows your attacks but doesn't stop them - also rather advanced. These scripts are in test_scripts\reference_scripts\effects though.

Wanna move some effects to the scriptflags system, but that's hella-advanced, and I didn't make scriptflags particularly easy to use, favoring dynamic usage over simplicity. Main idea would be to move the elemental resistance system to it, for reliability, as well as move most of the DOTs there, and cause the system to always favor the DOT with the highest damage rating, so that a lower level player applying a DOT wouldn't screw over a higher level one applying the same DOT. effects/speed also needs to be converted to a stacking scriptflag.

Simplifying the dual-wield penalty and parry system for reliability in reference\player\externals.script. (Probably also involve scriptflags - dernit, isn't there anything easy in here?) You'd have to use [override] on existing events and stick them in test_scripts\player_externals.script.

Finding out if/why the golden axe quest completion crashes the server (means you'd need access to additional scripts).

Finding out if/why the orc poisoner can cast poison cloud on you from anywhere, and can stun you with it (this might be simple, but requires additional scripts).

effects/effect_burn's client end not removing fire sprites sometimes (probably requires learning client side scripting, which is pretty advanced.)

Adding some new requested externals to monsters, but all require knowing how to make and compile maps... grrr...

Coming up with a way to make a new auto-adjustment system that's universal and lets low and high end players work together. I suppose one could use test_scripts\npc_externals.script to [override] events in reference_scripts\monsters\base_self_adjust.script, but I've barely gotten to the concept stage with this - and most of my current concepts involve tagging every single weapon and spell with quality tiers and mobs with class tiers, which isn't real viable, development time-wise.

Coming up with some ways to fix a bunch of script-fixable exploits that I can't talk about here...

....and most everything else is item related stuff (especially the shield thing, that my characters are immune to for some reason, and some sxbow gitches)... Dernit.

Well crap.

Seeing as how most everything that needs doing is hella-complicated (save maybe whatever simple dwarf NPCs Oyster is after), it seems ya might be best off just working on your own monster and boss creations after you get the basics down - perhaps by making variants of various existing monsters in the, rather extensive, example_scripts collection.

If you aren't feeling particularly creative, after you got the basics down, maybe I can come up with some monster/quest concepts of varying difficulty that mappers will want to use. Once you're beyond the basics, maybe we can get you the compiler, more tools, and look seriously into some of that rambling.

There are some useful script related console developer and debug commands that I didn't include in the documentation. Remind me to send you a set.
 
Top