Jump to content
The Dark Mod Forums

Using the TDM/DR documentation/wiki


teh_saccade

Recommended Posts

http://forums.thedarkmod.com/topic/9082-newbie-darkradiant-questions/page-323

// the discussion is sliding way out of newbie questions, so figured it'd be good to make a new thread regarding this.

This first stuff is not really related - a preamble.


The bar opens fine without the function - It only won't reset to closed (is possible to lock the safe with the bar preventing it from closing).

Idk if anyone else noticed, in game, that the bar on the safe didn't close without that line - or if it's even necessary in most instances.
Therefore, is it such a thing really necessary when there are other, more easily understandable and documented, solutions to fabricating such device as a sliding bar, bound to a door?

What is harder to understand and isn't documented is how the combination lock works.

The new-style combination lock is a nice step up from /prefab/tdm_wheel_lock.pfb - testmap and script found: http://forums.thedarkmod.com/topic/11190-working-combination-lock-download/

Unfortunately, despite being "nicer", ANJ safe combo lock is more complicated in design and function (such as disabling player weapons, scroll wheel) - so I'm still with Destined in including it as a prefab object numberwheel with a wiki page containing the information on how the scripts and DR stuff makes it work...

If the combo-mech was /prefab/tdm_numberwheel_lock.pfb - with description that there was a wiki page that provided a generic script for tdmbase01/script/numberwheel[_lock].script and gui for people to use, explaining the reason for the calls (eg. setting/getting processStim for lock/unlock, calling gui msg, disableWeapon, digits, how to change the combination by checking the float stim/response, why its necessary to #ifndef, etc...)...

It's a complicated thing for people to figure out, when they say they have no scripting experience at all and are new and want to learn, not even knowing where to start and relying on workarounds...

If no-one's willing to take the time to explain... only simply, "go figure it out" - it's a rabbit-hole of confusion, give up and make and yet another key-hunt round a nice-looking mansion/city area.

Is it like a top-secret recon mission where compartmentalisation of the information means that it's for the safety of everyone involved that only each person knows what they need to know?
Or is it about helping people find answers and directing them to the information, explained, so that each person knows what they need to knoiw..?

I've not seen anyone use the "motion/noise detector" or "[fake] laser tripwires" or "camera (portalsky method doesn't work any longer, so now it's more mechanical)" or searchlights or even a simple floor-trap flagstone that slams a gate over a treasure room that's rushed at (or door step through to prevent backtrack to grab boxes to escape, must face problem, etc...) or - as extension - even stepping stone puzzle (failure result in particle emitter of "poison gas" and playerhurt, until back to start and pull reset switch - solution scrawled in glyphs around level, locations of which are in readable/codex, must find cos objective trigger) in any FM.

/* I realise that I scrubbed my mapping thread, when in a bad mood... so... my bad. Also that taking the time to provide an adequete explanation - in a forum - of why and how something works is often a lot to read and digest and difficult to make as concise as a few tweets, and I've been warned about the length of my posts in the past 'cos ain't no-one got time for wall of text. */

And the script and method for that kinda stuff is a piece of piss to understand, (for eg, searchlights) with a simple tutorial on nurbs and movers and calling the script and how to get AI to interact with objects when alarmed. Which is basically how every trick and trap I make works, mechanically and using simple, documented solutions, pieced together, rather than complicated scripting and messing with the game).




void searchlight()

{

        $anchor.time(40);

        $anchor.accelTime(.1);

        $anchor.decelTime(.1);

        $anchor.startSpline($spline1);

  

//spine2, anterotation, is to direct searchlight in correct direction



        $anchor.time(40);

        $anchor.accelTime(.1);

        $anchor.decelTime(.1);

        $anchor.startSpline($spline2);   



}



void main()



{



}

You know, that's all it takes to get a basic searchlight pattern to add tension to a courtyard and force a player to time movement between the revealing light and the patrols. More "action" less "I'm gonna have a smoke break 'til he comes around again and KO him".

Maybe


killswitch{

switch = false;

}

 

while ( switch == true ){

loop;

}

to not have to fiddle with timing and the "blink" reset to start of curve and also to keep it moving no matter where the "loop" ends, allowit it to be killed by AI or player, if not more simply call/end searchlight by mechanical switch in-game - one that AI is set to use when alert.

Track the light towards player location, based upon how AI looks for the player's likely hiding spots, and suddenly it's as if the AI at the searchlight is actively searching... until they're shot in the head with an arrow - in which case the light is "dead" too,

(['killswitch' also targets named AI entity, ends searchlight mover], or the light's disabled [mechanical switch])

or location passed with or without incident or whatever...

How often do I ask non-rhetorical questions, or questions not designed to provoke discussion into an issue?

The questions I ask can usually only be answered by someone such as Obsttorte or Stumpy or an active dev.
Often, they might go unanswered 'cos it's above paygrade or no time to explain in such detail.



Modular design with assets and perhaps explanation to help learn, allowing increase in creativity and mission diversity or achieving vision.
or
Here, catch.
or
Go figure it out.

First is more work, but helps people a lot.
Second is less work, simply provide a solution.
Third is no work, ship without a rudder.

In short, it'd be really nice to get more hands on deck with updating the wiki.

As and when required/prompted by newbie questions, so it's easier for people to find and understand the answers to the questions they need to ask and take the time to go figure it out:
http://wiki.thedarkmod.com/index.php?title=Special:RecentChanges

No-one's born a brain surgeon, but everyone can pick someone's brains.
People CAN learn to be a brain surgeon, if they have access to the edu-material on how to become one, know where to search and find - and can understand it.

----

I've included a case study, using the current documentation, trying to discard as much pre-existing knowledge of DR and rely solely on the wiki and forum for answers - not asking any questions.

A simple challenge for the player:

Entering a corridor, the door slams shut behind.
A series of scythes swing across the path to safety, as an ornate door slowly opens to reveal a zombie shambler.

There is no way back - the player is under pressure to run from the zombie (potentially lethal damage if caught), while timing their sprints along the corridor between the scythe traps (potentially lethal damage, increasing in speed/damage given).

Ultimately, to escape, they must leap across a dangerously deep pit (potentially lethal fall damage - fake, safe drop into water, where there is some hidden loot and escape via ladder).

The player is placed into peril and must react - if they fail the traps or get caught by zombie, damage or death. If they fail the jump - believe might die, but actually safe and can grab hidden reward. Succeed the jump - zombie is held up by scythes (and clip), so has time to notice ladder and perhaps explore the pit if they're uber-cool and pass the challenge 100%.

The only danger is "inside" the trap. Once past - there's uncertain safety. Except I've revealed it now, so it's not uncertain, heh.

post-0-0-80268800-1519665690_thumb.jpg

So - Here's a route I might take to go about achieving this, knowing nothing about DR and relying purely on existing documentation.

Hopefully it will remind the veterans just how much there is to figure out in order to something basic such as this, and greens just how difficult it can be to realise a simple gameplay concept.

Big challenge for new mapper:


 

The new-style combination lock answer is one example of "go figure it out".
The doors on a diagonal is not quite the same (the raising doors make a great way to escape a level due to the extra height provided, if diagonal, then - awesome).
If that was in the wiki, it'd be a good example of "design explanation" that'd be a great addition to the doors wiki page. Along with many other questions that have been asked and answered in the forum on other topics.
Things such as the modelling issues that Kitsune was running into and managed to solve aren't collected in the wiki and/or explicit. Again, "design explanation".

Location system question that came up recently - the answer might be found here, if the person knew what to look for..: http://wiki.thedarkmod.com/index.php?title=Location_Settings - that's an example of "Here, catch the ball".

'Cos, you know, "show inherited properties" isn't checked by default... Also, how to know the spawnargs to look up and add, unless you've read and - more importantly - understood the Location Settings wiki page..?

Look at all those lovely spawnargs listed on that page... ambient_light_fade_time - making that longer would mask the sudden green area within one of Spook's FMs during a location change... He figured it out, cos he's an investigative mapper (and someone pointed it out, thinking it was a bug).

 

 

So this leads to the case study of how I would have to go about figuring something out, using the available documentation to me on Dark Radiant and in the forum, and just how frustrating and warren-like it can be to use, in its current state..:

 


Reading that page again about locations, I realise that one of my traps/design features can be a simple script using the location system instead of mucking around with more complicated stuff. "Call_once_on_entry" - bam. Problem solved in a far more elegant manner and it frees up a whole bunch of mechanical wiring in DR using triggers and movers and s/r stuff.

I learned something, because it was documented and easy to understand - I'd've never have thought about that, because I'm a noob and idk wtf I'm doing.

If someone had pointed me towards http://wiki.thedarkmod.com/index.php?title=Making_Moveables_Damage_Things (http://forums.thedarkmod.com/topic/4723 is now 404) - plus the fact that it didn't work... I probably wouldn't have cried so much when moveables no longer caused damage and not be constantly getting stuck under movers that act as elevators (eg, Thief's Den).

IIRC - the solution to me crying about the "movers don't cause damage no more" thing was "add playerhurt spawnarg to everything". A "Here, catch the ball".

Now, because I know I can start the corridor's swinging scythes and slam shut the door behind (to stop a player backtracking and grabbing boxes/chairs to block the movers), releasing a zombie to add tension so the player is under pressure to negotiate the traps in front of them and escape the zombie - cos zombies can't jump and mantle over the water-filled pit at the end of that corridor (no damage if player falls)...

The bottom of such pit containing some loot at the bottom and a ladder up - so failure to make the jump isn't punishment, but an unexpected reward, and curiosity exploration is also rewarded.
It's only a spawnarg to make the zombie not take damage, but still get pushed back - lessening tension as the trap is further negotiated...

Additionally I can also mitigate damage from initial "hasty mistakes under duress" by players mis-timing a sprint through a swinging mover scythe along a nurbs, make the end of the corridor more challenging (at which time the pressure and tension to get the timing of the sprint correct is less, because the zombie is further away, so ramp damage with "need to get it right" being less...), by using the provided solution for variable damage based upon velocity:

Changing the moveable's def.

BUT:

Does it still work, seven years later..?
Because: http://wiki.thedarkmod.com/index.php?title=Moveables#Complete_List_of_Default_Key.2FValues_for_Moveable_entities does not list this key...

So, have to assume that the moveable must be converted to a model, to include the def for variable damage - not simply a brush on a mover with player hurt spawn-arg or whatever it was, because the "making moveables cause damage" page doesn't state that and brush mover would have to be converted to a model and have a def file, etc..: I'd have to guess.

The only reason I'd be able to guess it'd have to be a model is because I've taken the time to learn that models use defs, but worldspawn brushes don't.

BUT:

What if I didn't know how to change something into a func_static..? It doesn't explain... The answer lies hidden in the patches page of the wiki: http://wiki.thedarkmod.com/index.php?title=Patches#Trim_Arches
Oh, how simple...

Perhaps I ought to update the instructions on the "moveables" wiki page that say, "convert to func_static" to say, "change the brush to a func_static by right-clicking in the grid-view and converting to func_static"..? Because that'd be more helpful than having to search "func static" in the wiki - that returns this: http://wiki.thedarkmod.com/index.php?title=Special%3ASearch&search=func+static&go=Go (which is no help).

But - oh wait... how do I export my brushwork as a model, to import to follow those instructions on the moveables page..?
The "Models" page that's linked isn't much help..: http://wiki.thedarkmod.com/index.php?title=Models

Having read the forum in the past, and knowing there's a DR option to export my brushes as obj or convert to ase... If I didn't know these functions, perhaps I'd think - crap, I have to do all of that again in Blender?

I'll try convert to .ase, which is not in the wiki:


Error while executing file: commands\convert_to_ase_and_replace.py:

Traceback (most recent call last):

  File "D:/DarkRadiant/scripts/commands\convert_to_ase_and_replace.py", line 418, in <module>

    execute()

  File "D:/DarkRadiant/scripts/commands\convert_to_ase_and_replace.py", line 159, in execute

    GlobalSelectionSystem.foreachSelected(walker)

  File "D:/DarkRadiant/scripts/commands\convert_to_ase_and_replace.py", line 140, in visit

    import re

ImportError: No module named re

Oh - it didn't work... maybe pathing might be incorrect as /commands\convert has \ and / so no \o/ joy. Probably I've not updated my DR or the script just does a Simon the Sorcerer and doesn't work atm.

This means I'll have to go and export that nice brush and mesh-work I've done as an .obj, but I know that only because I bothered to explore DR and ... but wait a sec - didn't I see "convert to model" when I was doing "convert to func_static"..? I'm sure I saw it in "doors" when I was doing the A-Z one time... the "convert to model" thing. Also, I'm not making a door, I'm making a swinging scythe trap...

Perhaps I could try making it a prefab? But how would I know about that unless I already knew... hmm...

No, that doesn't work and there's nothing on the wiki about "converting brushes to models" - there's "brushes vs models" that leads to a dead end on modwiki... So I guess I'll have to try exporting the whole lot as an obj using the script (if it works), as the only reference that's found is here: http://forums.thedarkmod.com/topic/15602-dark-radiant-export-to-obj-file-format/

Well that worked, and even with \ and / Done writing OBJ data to C:\Users\user\Desktop/box.obj

But what do I do with the .obj?

So I guess I'll have to check the wiki for "modeling" help, rather than look up "models".
Well, the Modeling pages on the wiki tell me to use DR's file/export as obj... That's not quite the way I did it, but I'm using my pre-existing knowledge of DR - so that page is out-dated.

So I'll have a quick search in the wiki for help with "modeling" and read those pages:
http://wiki.thedarkmod.com/index.php?title=Modeling

This gives me a basic idea of what I'm doing...

Let's hope it looks the same and has kept the textures. As my default .obj editor is photoshop, and I'm used to Zbrush... nope - it's simply the brushes in white.

But I know there's some help on the forums for that because I've looked in the past, so that's where a google search comes in and it would be useful if the modelling pages in the wiki explained how to do this, in case I don't know how to search the forums for answers, once every 15 seconds (why google "forums dark mod xxxxxxx"), rather than ask a question where someone may or may not point me to a wiki page or forum post or say, "here, catch"...

But first of all, in order to follow the tutorial on modelling I need to get the file open in Blender.
So - Importing the file into Blender, first I notice that there's none of the texture saved (np), but also that it's no longer the same .obj that I saw in photoshop... I exported a cube and in Blender it's an extruded triange.

Strange.

Let's try another option and export as .ase.

http://wiki.thedarkmod.com/index.php?title=Creating_an_ASE_model_using_multiple_Materials

Oh that says I have to use blender also... but I've exported my model using DR's script... So is all that stuff about separating meshes and applying textures still relevant? Idk... I'm not going to rebuild everything again - I've already done it once and I've an .ase file ready to test.

The instructions are simply, "Now create a testmap and place your model into it. Load it into the game and voilà".

Wtf do I do that? "place my model into it, and voila"..?

Well I guess I'd better search the wiki for "import model", which leads me to this page: http://wiki.thedarkmod.com/index.php?title=Modeling_-_Basic_Tutorial - this tutorial, like the other on creating .ase models for DR, tells me that I must put the model in the correct place and then edit the .ase to use the correct textures, as appropriate for Doom3, to display in DoomEd's model browser.

That's a little confusing, because I'm not using DoomEd - I'm using DarkRadiant - but I've enough common sense to follow the convention for models because I read the Basic Modeling Tutorials.

I'll take a look at the DR exported .ase to see if it has retained the texture - it doesn't open in any of my graphics software (eg, photoshop) so I'd better follow the instructions and check the text.

Well - Notepad++ reports in the Material list that there's MATERIAL_COUNT 1 and that the *BITMAP is "\\purgatory\purgatory\doom\base\textures\darkmod\wood\panels\panel_carved_round_dark" and this is the texture that I had set to test for the cube.

So - now I know that DR exports my brush and mesh/patch-work as as .ase fine and retains the texture information, as well as the offset - and I notice that it has *BITMAP_FILTER pyramidal, which might account as to why Blender thought it was not a cube... - I'll try with to use DR's export .ase script with two brushes with different textures/materials.

Keeping the wood, that will form a small part - hopefully it will export the other brush as keeping the heavy rust.

Oh, how great, it does. MATERIAL_COUNT 2 and *BITMAPS are as they should be.

Nice - that's how I can model in DR using brushes and patches and retain all the texture and surface information, rather than have to deal with using modeling software and imports and exports and manual changes of text files to paths for materials and textures that I might spend hours looking for...

So now I have the model and I know where to place it because I read the modelling pages earlier and I saw there's a convention for Model Folder Structure:
http://wiki.thedarkmod.com/index.php?title=Model_Folder_Structure

So I'm going to put it in /dungeon.
But... the Model Folder Structure tells me to put it in a models/dungeon, that I can't find in either DR or TDM folders...

So I'm going to look at the TDM folder and find anything related to models, where I find "tdm_models01 & 02.pk4". I guess this must be the place to put the model, now, not in a folder - but in the base .pk4... which means... I'll need to figure out later how to pack my FM so that the model I'm shipping with my level is included for everyone else.

Using 7-zip to open the archive, rather than rename it to .zip and back again - I find that the file is in use by another process (DR), so that means I must save my map and close DR in order to copy the file.
But 7-zip crashes because of a bug in 7-zip, so... reopen and repeat. Success.

Hopefully, the model will appear in DR now. Hopefully...

Luckily, because I read the A-Z Beginner's guide, I know that I can "right-click and create model" to add a model - and... oh great, it's actually there, just as it looked as the brush/mesh model I created in DR before, in the DR model browser, in the Dungeon section.

Not quite how the documentation instructed me to do it, but it's there and that's what matters.

The texture sizes are the same as the original brush-work, the size is the same. Everything's the same - and I didn't need to open blender once, really. Which is great, because it didn't look right and now I can export all my intricate brushwork buildings as models with simple collision meshes - if I ever wanted to put a building in a map that was nothing more than a facade and not-enterable.
Now, I need to create a collision mesh for the model - which according to http://wiki.thedarkmod.com/index.php?title=Moveables I can do by following the instructions on how to create a collision model, rather than following the Modeling tutorials in creating a collision model - kind of a strange place to find the collision model tutorial, but at least it appears in a wiki search and I remembered it from earlier since I'm trying to make a moveable...

Since I already have the original brushwork - perhaps I can use this as the basic brush to create the collision mesh.

Using pre-existing knowledge - I'll try to merge the brushwork using the CSG merge:
CSG Merge: Failed - result would not be convex.

Well, it was worth a shot. "Best fit" will have to do for those concave angles.

There's a small bug here in that - after using this tool and getting this error, the "undo" function in DR no longer works for anything before getting the CSG Merge: Failed. So it's a good thing that I'm working in a testmap and not in my main mission file. Anything I do after will still undo and redo fine.
So, after a little re-rigging of the brushwork I want to use as a collision model - to remove the convex parts so it CSG merges - I'll return to following the instructions to make the brush func_statics into a collision model.

I get an unspecified error that states it can't export the collision model... oh dear... but it CAN'T export the collision model to the same path as the model... because the file is in use in DR :)

DOH. but the error allowed me to see that the collision model had "moved" to a different point - evidently I'd not lined up the origins, so that's a quick fix using the origin property - setting both to 0,0,0.

So - reading the instructions again, it says to export the collision mesh as an .ase with the collision texture. But wtf is the collision texture hidden? I guess the easiest way to find any texture is to open a map that contains that texture and select it so it gives me the Shader and Definition paths.

It's textures/common/collision. Snap back to the testmap, and it's nice that the collision texture is still selected for me to easily right-click and apply to my selection.

So it would appear that, while there is no need to merge, since the collision model will be exported - it is a good way to test that the collision model will follow at least one of the rules for cm's - no convex faces. Also, in re-rigging it, I've made sure that the faces are reduced to be as simple as possible. It says a max of 12. The origins are also lined up in DR, due to previous fail highlighting this.

It appears there's another bug with the undo - accidentally dragging the cm, I can't undo the drag after the "failed to save cm" message. And DR crashes... Reopening without even having the testmap in the recent file list. Luckily I've learned to be OCD with saving testmap001-999.

No matter what I do - there's no way that I'll be able to make the collision model using this method as DR appears unable to save the file into the model01.pk4 as the file is in use.

So screw that - I'll have to find out how to stick it to the model.
If I didn't already know - this is where I might need to ask a question... However, I already know there's a spawnarg named "bind" that will parent the model to the cm: http://wiki.thedarkmod.com/index.php?title=Bind

Changing the name of the imported model from "func_static1" to "scythe", it's possible to add the spawnarg "bind" to the cm.

Now I'll group the selection of the model and its bound collision mesh, so I can move them into position.

Now there's the model and a bound collision mesh. Idk if that's needed, because http://wiki.thedarkmod.com/index.php?title=Making_Moveables_Damage_Things says that there might be a small knockback, if using "damage_generic" - although, to me, this looks to be a spawnarg that's been called a def.
http://wiki.thedarkmod.com/index.php?title=EntityDef

Which means all this messing around with the model and collision mesh might be entirely pointless and not required at all.

In fact, after reading a page again, I'm fairly certain that the "def":
"damage" "<name of your damage def, INCLUDING the "damage_" prefix>"
ISN'T a def - but a key/value, which means they're spawnargs that I could've applied to my original brushwork group...
AAAAARRRRRRGGGGGHHHHH!!! FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK.

So all that crap with the model and collision model was a waste of time?!!

BUT. Looking on the bright side - in doing it, I've learned that I can export brush-mesh-work as .ase and also test out a collision model/mesh made from brushes in DR using certain functions, which is useful.

The model already has those base materials defined... so it will inherit things such as whether or not an arrow will stick into it or what noise it will make when hit with a sword.

So - since the model's there, I'm going to try to make it a move in a pendulum motion, so it slices across the corridor and hurts the player if they get hit by it.
The problem is... the actual scythe isn't going to be a mover. The mover will be an invisible cube to which the scythe is bound. The invisible cube will move along a NURBS curve, using a small script.
http://wiki.thedarkmod.com/index.php?title=NURBS_Curves

A shame that link is 404, but I have the doom3world.org content saved in my DR note blog, so...

Adding a "damage" spawnarg with the additional "min & max DamageVelocity" spawnargs... I have no idea wtf to set these to, so it will be trial and error, starting with random numbers - I'm applying this to collision mesh, that is "bind" to the model.

Pretending that I know what that wiki entry says, because I'm using the wayback machine to read it or whatever...

I make a small, nodraw box that I place at the lowest part of the scythe, and create a "pivot" because it might be that the scythe is simply going to float along the curve rather than swing like a pendulum.

This entails a cylinder func_static onto which the the scythe - shaped like an anchor - is "hanged".

I make a nurbs curve for the swinging path and make a location that, upon entering, calls the script to start the nodraw cube moving along the nurbs - however, I've no information on how to script the [de]acceleration for the cube to move along this curve - so perhaps I'll look in the script repository to find it, after learning a little about scripting basics:

http://wiki.thedarkmod.com/index.php?title=Scripting_basics

This lets me know how to call a script and how to call a script that will be triggered by entering the location:
http://wiki.thedarkmod.com/index.php?title=Location_Settings#Script_calls

Now I have to add the script to the FM and try to achieve things this way.

Does it work?
Not as expected.

I want the scythe to swing back and forwards as a pendulum. Causing damage if it hits the player (or any non-protected AI) and this does not achieve the swinging motion I want.

So - being the type of person I am... I give up on this idea and make a mansion mission without traps.

----

However, because I'm the type of person I am... I know there's another solution, as what I want to achieve is possible within TDM ('cos I've done it before and it doesn't require models or scripts - only DR functions and some mechanical solution).


So - after all that complicated shit and a run-around the wiki. I've learned a few things and found a whole bunch of pages that give me an inkling into what the game was like in 2011.

So, I search the wiki for "move" and discover the page about moving platforms that gives me a few new spawnargs to play with:

http://wiki.thedarkmod.com/index.php?title=Platform_That_Moves_When_Button_Is_Pressed

Specifically - the accel_time and decel time. That's great. That's what I want. Except not for a laterally moving platform. I want something that rotates around an axis.

"Rotate" sounds like a good thing to look up, so I'm going to type that into the wiki, which scores me the same page.

"Rotater" (dicktater) or "rotating" is another word that describes the action I want - so I search that and find this page:

http://wiki.thedarkmod.com/index.php?title=Elevators,_multi-floor

This page - idk where, I can't remember, tells me there's such a thing as a "func_rotating"

Perhaps this is useful... If I redesign my idea. Rather than the scythe rocking back and forth as a pendulum - I can fake the effect by having it continually rotate by binding it to a cylinder that is spinning, while re-jigging the corridor so that there is enough space for the scythe to pass through a gap in the wall and ceiling, rather than only nest into the walls.

To test the idea quickly - I open an old "environment" map that is simply a mesh with a flat space and player start point and quickly rig up some func_rotating cylinders, operated by a switch and bind a func_static to one of them with damage min/max spawnargs in order to test. Not bothering with accel or decel times because I want to simply test if:

1 - the rotating thing works and
2 - the "scythe" (in this instance a small block, bound to a rotating cylinder) is going to do damage.

Now I've set that up, I need to go back to figuring out how to put my design into a playable level and how to get it working in TDM - going back to the A-Z beginner's guide, I remember DMAP:

http://wiki.thedarkmod.com/index.php?title=Dmap

I copy my test2.map from my testmap folder into TDM map folder (that's starting to get a little cluttered... have to sort these out into directories....) and open the console using control+alt+` and &dmap test2.map

Passes without issue, so I load it to play with &map test2.map, as described in the Beginner's Guide:
http://wiki.thedarkmod.com/index.php/A_-_Z_Beginner_Full_Guide_Start_Here!
http://wiki.thedarkmod.com/index.php?title=Dark_Radiant_Must_Know_Basic_Intro
It doesn't work - so it appears that the "damage" spawnarg isn't doing its job.
There is are entity classes that causes damage that might be bound to the cylinder.

But - I will have to look at the wiki to figure that out, so I search the wiki for "damage" and discover that the pages I've been using are from 2006 and 2011, which is quite a long time ago:

http://wiki.thedarkmod.com/index.php?title=Special%3ASearch&search=damage&go=Go

So, it's probably a good idea to go with a more recent wiki page, that is from the last year or so.

It appears that the damage spawnarg might have been supersceded by stim/response, but this is getting into scripting - and I want to avoid that, because I like to keep things as simple as possible.

http://wiki.thedarkmod.com/index.php?title=Stim/Response_Key/Values

Since searching the wiki is not turning up anything useful - perhaps at this point, I'd ask a question.
Rather than ask anyone in the forum, as I want the answer right now - I ask google, "dark mod wiki damage spawnarg" and it returns as the first hit something that looks promising:

http://wiki.thedarkmod.com/index.php?title=Triggers

I can already see the one I want because it's been visited before and is purple, but I want to look at "trigger_hurt". But first, it's important to read how the triggers work. The page tells me how to create one using a worldspawn brush and right-clicking it to become an entity (that will not function if overlapping others [other triggers]). It also tells me that I need to target something. I want to target the player - so how do I do this..?

Google helps again with "target player dark mod" and it returns:
http://forums.thedarkmod.com/topic/16412-setting-spawnargs-on-player/

that explains that there might be some difficulty in getting the trigger hurt to target everything on the map, but - perhaps a compromise can be made and it would only be the player and AI or objects in the area. But it turns out that a trigger_hurt entity will hurt anything that can take damage, 10 points per second.

http://wiki.thedarkmod.com/index.php?title=Triggers#trigger_hurt

This explains a little about the def_damage and damage.def file - referenced earlier in the wiki page on how to get movers causing damage, that was difficult to understand. It mentions def_damage, but there is no further information on this. But it does hint that I might find damage in the root for entity classes.

The trigger_hurt will damage the activator - either the player or AI (not objects, sadly, which would require stim/response and possibly scripting - which I don't want to have to do, because I don't know anything about scripting yet - I simply want to build a trap... that's activated by a script called by the location system, but, eh well... I'll figure required scripting when I have to), but does allow some control of the amount of damage based upon proximity to the entity that is set to cause damage. Furthermore, can do things such as destroy boxes and other things that are scripted to take damage and "die".

This would be good for a "graze" if the player barely scrapes past the scythe, or a lethal hit if they are caught with it. But - first to try the simple trigger.

Back to DR and follow the instructions to make a trigger_hurt to place on the test scythe.

It works - every time the player comes into contact with the trigger_hurt, it causes 10 points of damage per second, just as the wiki article stated.

So - without having to delve into scripts or anything too complicated - with some reading in the wiki, I've found a very simple solution to achieve the scythe trap that I wanted to make.

While it'd be good to start it off with a script called by the location system, it's not really necessary, as - now I now about triggers, I could produce the same effect with a "trigger once" to turn the traps on and open a sarcophagus door to release the zombie and use another trigger to turn all the traps off.

There's no going back, anyway, so it doesn't matter in which position the scythes end, although it'd be nice to return them to a hidden position... there are other ways to "delete" them as the player jumps across the pit to escape the zombie chasing them down the trapped corridor. From a level design point of view - because there is hidden loot at the bottom of the pit, in the water that is there as a safety net in case the player fails the jump - the zombie being trapped between scythes (as it is invincible) is a good thing, as it removes the fear of descending into the pit to explore, or having that area made off limits by the zombie somehow dropping into it.

But, because I wanted to ramp up the damage along the corridor, perhaps because the scythes spin faster and the zombie is further away and the player is a little less tense, more focused - a quick look at the stim/response system isn't going to hurt.

Not hurt me, anyway... Hopefully hurt the player.

http://wiki.thedarkmod.com/index.php?title=Stim/Response_Key/Values#Damage_Stim

Straight away - I see: "Note: There is now a stim/response editor accessed via the Dark Radiant entity menu which makes it easier to set these key/values."

Which makes it far less intimidating - so I search on how to use the stim/response editor in the wiki:

http://wiki.thedarkmod.com/index.php?title=Stim/Response_Editor

It's fairly simple, it appears, and contains trigger effects, so I can mess with this fairly simply. It even tells me where to find the editor in DR.

The stim/response editor is very useful for faking such things as cameras and motion detectors, by using an AI to respond in a certain mannner, eg, pull a switch that causes an alarm and chaos if they become alerted by the player's footsteps on a noisy floor (fake motion detector - player must sneak v. slow or "disable" the system by turning it off and closing the tiny tunnel through which the AI is able to hear the player moving. Just make sure there's no moss arrows available up until that point, or until after the system is disabled).

There is a small bug with the stim/response editor in that sometimes, after editing a response, it is impossible to change unless the editor is closed and re-opened.

Not knowing how to use the stim/response editor for damage like this - I follow the instructions on the wiki and set the stim to be the damage. The player is vulnerable to a damage effect. I set the response to be a trigger, damage, target _SELF, but... idk the damage def... there is nothing in the wiki about this and idk where to look for the types of damage (nowhere tells me that there is a list in ..\darkmod\tdm_defs01.pk4\def\ of the different types of damage_def).

But I DO know from http://wiki.thedarkmod.com/index.php?title=Stim/Response_Key/Values that there is an "atdm:damage_simple" that should be directed at _SELF.

The stim is set to be active, have a magnitude of 5 and a falloff exponent of 5, chance 100, leaving the bounds to the default values. Just to test.

All of these properties should now be visible in the entity spawnarg list. I change the trigger_hurt back to func_static

While checking these properties - I notice that the stim/reponse editor has removed the "bind", so I must put this back in order to re-attach the "blade" to the func_rotating.

Hopefully, this will cause 50 damage with a close hit and less the further away the player is - that's a decent graze from a heavy swinging scythe..

But... I've never managed to get the stim/response working for damage like this. Tried pretty much every combination, response only, stim only, etc...

So, now I have two options open to me as the wiki doesn't really explain well how to do this and I'm too dumb to figure it out.

Either ask and hope someone answers with an explanation as to what I'm doing wrong - likely get tossed a ball to catch and try to figure it out myself.

Or - re-think the design and go back to the original trigger_hurt that causes 10 damage and have 10 scythes to negotiate, the last few being doubled up (two placed together), which would prove lethal if failing every timed sprint (or less if the zombie hits).

That's kinda good enough for a short section of gameplay - but the solution to the problem of "how do I make a corridor of swinging blades for the player to have to run past, while being chased by a zombie" took a lot of reading, a lot of failure and still isn't quite as I'd like it to be.

I don't even need to touch scripts. Can do it all with triggers and spawnargs and basic level design.



The reason - other than for this is because the documentation in certain places, such as the stim/response editor is not much more than a single example to copy that does not explain anything.



This makes it very difficult to simply walk into Mordor and figure out what is not working and why.



It seems that it would be useful - for, eg, getting crushed under an elevator - to set damage stim/response on one face of the elevator brush for almost insta-death for anything crushed underneath.

As it is, having to settle for something like the nodraw trigger_hurt works for being crushed under an elevator... it's not the best way and - without the reference and documentation updated as things come up - there's no choice but to have to ask a question, the answer to which often doesn't explain much, or settle for a solution that isn't quite what was wanted.



But... that's an example of the run-around behind being able to figure out how to do something only one simple thing from a simple scenario, without having to nag about it and hope someone tosses a ball that contains the solution without an explanation.

If it was painful to read - that's good. Because it was painful having to go through the whole process to find out, "that'll have to do, 'cos can't figure how to do it 'cos there's some missing reading available atm for tdm".

Also having to type it all... ouch.

 

  • Like 1
Link to comment
Share on other sites

its just a place for anyone to ask questions or something they can't get their head around. If another newbie comes and asks simple questions then they are likely to get an answer, they shouldn't be told to go and search for it, they might be given a link to a place in the wiki where it can be explained better than just a few lines in the forum.

 

As for the combination lock all it needs is a bunch of models of different number/letter/symbol wheels with option to easily change graphics on wheels, bunch of models of different sliding bolts.

 

and a script to control it all.

like the combination lock in thief 2, where the locks combination was kept in a variable and all a modder had to do was change the value of the variable.

Link to comment
Share on other sites

You kinda hit the point right there, Stumpy - from the miles of letters in that post (medal for reading it, btw) - there are a lot places in the wiki that are in desperate need of some updating.

----

A system that is used at a place I volunteer, to ensure accuracy and validity of information/data entered into archive/documentation:

One person submits the information (author).
It is then checked by two people, who comment/discuss on the information (triage).
Editor then determines final, based upon their competency, taking triage under advisement (updated/published).

While it's not exactly de rigour for an author to also be editor or triage, due to bias, such things do happen.
However, this is a subjective field in psychopharmacology and not a precise topic such as one particular computer game's wiki.

I trust a wiki article written by someone like Grayman: http://wiki.thedarkmod.com/index.php?title=Security_Camera <--- it's very complete. I know kung fu.
But idk about something more "free" such as this: http://wiki.thedarkmod.com/index.php?title=Stim/Response_Editor <--- that is a few lines on a more complicated thing.

First is thorough and helpful, well documented for a single module - I understand how to use it and will anticipate it in design (eg, remove my own versions of a security camera, because this is 10,000x better. Maybe change the model...).
Second is nothing useful, poorly documented, to understand how to do many more things with your own lego bricks (eg, understand how to use the stim/response editor to cause damage to stuff cos the examples don't work).

If I knew how to say "damage to the security camera using stim/response, triggers this script that removes it from the gameworld and replaces it with a broken camera model and turns off the camera, with a chance of setting an alarm state, etc..." - perhaps I could destroy it with a fire arrow as well as turn it off or KO the guard watching or sneak under it or whatever...

----

I can't update what I don't fully understand myself, in order to help others understand by giving them a link to the wiki where it can be explained more than in the forum.

Link to comment
Share on other sites

I believe you have the same problem here that most have: Even if you are willing to update a Wiki page, you lack the required background knowledge. I have worked with the S/R system a bit and thus I understand what the author of the Wiki tries to convey, but in order to correct the page, I am not confident, that what I write is actually true.

On the other hand, people who have the background knowledge to write these articles are mostly involved in other projects and I believe that it is a lot more worthwhile for people here that they focus their limited time on these projects rather than updating Wiki articles. I will see that I can find some time and try to improve the article mentioned by you. Even though I am not 100% sure, if everything I write is right, it hopefully still improves the article.

  • Like 1
Link to comment
Share on other sites

Even if you don't have time to edit the wiki, making files with notes during your projects is always a good idea. I have quite a lot of those now, mostly on stuff like modeling workflow, materials, sounds, and performance tricks. You can always post them later. Having someone (preferably English native) review articles before posting them on wiki would be nice, but who would have time for that?

Edited by Judith
Link to comment
Share on other sites

I can be your test subject for the S/R page, Destined.
Need to learn faster to keep up with things and figure easier solutions in TDM level design, rather than bitch about things changing faster - testing wiki pages would be a good method to accomplish this.

I'll have time to help update documentation after a shadowbreak. Appears that an upcoming unity project has fallen to pieces before it's past concept. The rest is my own stuff, ad hoc.
Maybe after a camping trek round the SWCP for a month or so to get the legs and lungs working again after sitting down so long, drinking cold tea and eating cigarettes.

Need direction, or at least a method to figure (or a way people can flag) which pages need a check/redirect to update.

In my 20's, as a break from MCSE/CCNA, some reason decided to qualify under Chapterhouse in proof-reading and copy-editing and was a member of the SfEP - have worked on games engine and database software documentation before.

Might have a bit of ring-rust, but pretty sure checking wiki articles/tuts isn't much different from BVT.
Here's a reference.

Link to comment
Share on other sites

I started to rewrite the article on the S/R Editor. For this I tried to play around with it a bit, so I understand all the args available. However, I was not able to even create a simple damage Stim (even though I used the setup described in the S/R key/values article). I am sure, I have done this before, but somehow it does not work right now. I used a chair as the source of damage (I just picked a random model) and gave it a damage stim that is active, with a radius of 100, a magnitude of 30 and a Falloff Exponent 1. This should kill the player as soon as he nears the chair, but nothing happens. Can anyone tell me, what I am doing wrong? It is difficult to write the article, if I cannot set up a S/R pair myself...

I also tried a simple Response: Frob -> remove _SELF, which also did not work. I will try to create a new map and see if this is just a problem of my system...

Link to comment
Share on other sites

Yeah, I don't get why it's not working either... // I've even changed the numbers of the args it places, in case they were incorrectly ordered, like "srclass 9000" etc...

Have you tried another damage def? I've tried suicide for insta-death but that doesn't work using the instructed stim/response set-up either. Not tried fire or anything.

Edited by teh_saccade
Link to comment
Share on other sites

Different spawnclasses respond differently to different stims, or they do not at all. What entity did you try to use the frob->remove SELF thingy on?

 

BTW: There are trigger entities available for damaging the player. And damage always requires a damage definition.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

For the remove self I used some chair (so a func_static). I will have a look again this evening (tomorrow morning the latest). I am quite sure that I have done this with this setup. I will just try it in a new test map. Shouldn't the response to a stim be the one I define, regardles of the spawnclass? Apart from pre-defined responses, I mean. If these are present, is natural that they show some sort of response.

 

I thought the damage stim should also work an the player, as the player has a damage response by default (will confirm this again, as soon as possible). The setup I used is as it is described on the "Stim/Response Keys/Values" page. If it does not work, I will also correct the description there.

Link to comment
Share on other sites

Ok, I am at a loss, why it did not work in the first map. I have tried the same setup again in a fresh map and now the damage stim as well as the remove response work. The only discernible difference is, that in the first map I have had a custom stim type defined (that was not used anyway).

 

The damage response on the player is defined as a damage 10 on self by default (it is the damage_low damage type), so for a damage stim, there is always a response from the player. But I noticed that the "use boundaries" tick box had no effect, when I tried it on a nodraw brush converted to a func_static. I had to actually hit the origin of the block (which I only noticed by chance). I will try that again later.

 

On a side note: When I tried to remove the custom stim type in the first map, DR crashed (I tried three times before giving up).

Link to comment
Share on other sites

So, this would be the article I have written for the Stim/Response Editor:

In order to avoid typing each arg for stims and responses as descibed on the page[stim/Response Key/Values], the stim/response editor was introduced. For an explanation on what Stims and Responses are in general see also [stim/Response page].

If you want to add a Stim or a Response to an entity, select the entity and then go to Entity->Stim/Response... to open the Stim/Response Editor. The Stim/Response Editor has three tabs: Stims, Responses and Custom Stims. As stated on [stim/Response] an entity can have Stims and Responses at the same time, but is not able to pass a Stim on to itself.
In order to add a standard Stim, select the "Stims" tab and either select a Stim type in the drop down menu on the bottom or press the "Add" next to it. If no Stim type is selected, a "Frob" Stim is selected by default. Select the Stim you want to edit in the list on the left (if no Stim is selected, all buttons on the left are greyed out). On the right side you can change all key values of the Stim, instead of typing them manually as described in [stim/Response Key/Values]. This page also describes, which arg does what.

The Response Editor is a simplified way to create small scripts without any deeper knowledge about scripting.
In general, it works similar to the Stim Editor: You select the stim to which the selected entity should respond (again, if no type is selected, when you hit "Add" Frob is the default type). However, this only tells the entity that it should show a response to a certain stim type. In order to actually have something happen, you have to add an effect. To do this, you have to right-click in the "Response Effects" window and hit "Add new Effect". Double clicking on the line (or usind right-click and "Edit") you can now edit the effect, you want to have. Available effects are:
Activate Response: Activates the Response for the stated Stim Type on the stated Entity. E.g. the player has to give a fire stim to a furnace in order to have a door react to a frob Stim.
Activate Shooter: Activates the stated Shooter. E.g. can be used to activate a trap.
Activate Stim: Activates the Stim for the stated Stim Type on the stated Entity. E.g. adds a damage stim to the furnace after the fire stim is given.
Add Target: Adds the stated Target to the stated Entity. Can for example be used to add a new path_corner to a patrol route.
Apply Stim: Fires a Stim of the stated Stim Type to the stated Target. The Source can be changed, but does not have to.
Blind AI: Blinds the stated AI as if a flash bomb has been used on it.
Clear Targets: Removes all Target-args from the stated Entity
Damage: Applies a damage type to the stated Target. Damage Defs can be found in the def file "tdm_damage.def".
Deactivate Response: Deactivates the Response for the stated Stim Type on the stated Entity.
Deactivate Shooter: Deactivates the stated Shooter. E.g. can be used to disarm a trap.
Deactivate Stim: Deactivates the Stim for the stated Stim Type on the stated Entity.
Disable Effect: Disables only one Effect on the stated Entity. The Effect is defined by two numbers (e.g. 2_3), which means that the Effect with the number 3 on the Response with the number 2 is disabled. The respective numbers can be found in the first column of the according window.
Enable Effect: Enables only one Effect on the stated Entity. The Effect is defined by two numbers (e.g. 2_3), which means that the Effect with the number 3 on the Response with the number 2 is disabled. The respective numbers can be found in the first column of the according window.
Fade Light Color: Changes the colour of the stated Target Light to the stated Color over a time of Fade Time seconds.
Frob: Frobs the stated Entity as if it had been frobbed by the player.
Gas Knockout: Knocks out the stated Target as if it had been hit with a gas arrow.
Heal: Heals the stated Target by the stated Amount.
Kill: Kills the stated Target.
Knockout: Knocks out the stated Target as if it had been hit with the blackjack.
Turn extinguishable Light Off: Extinguishes the stated extinguishable Light.
Turn extinguishable Light On: Reignites the stated extinguishable Light.
Turn Light Off: Turns off the stated Light.
Turn Light On: Turns on the stated Light.
Move To Position: Moves the stated Entity to the stated Position (coordinates: X Y Z). If the box "Relative to old origin" is ticked, the Entity is moved (X Y Z) units from its current location.
Move To Random Position: Moves the stated Entity to a random position in the "Within Radius" range.
Play Animation: Plays the stated Animation for the stated Entity. The Animation can be limited to only one channel (like only the head or similar), but you should leave this blank, if you don'T know what you are doing.
Play Sound: Play the entity's stated Sound. The channel can be limited (e.g. to the player voice or ambient), but this can also be left blank.
Play Sound Shader: Play the stated Sound Shader on the stated channel (as before the channel does not need not be defined). This is not limited to inherent sounds of the entity.
Remove: Removes the stated Target from the map.
Run Script: Runs the stated Script. For more on scripts refer to [link]
Set AI Team: Change the stated AI's team to the stated Team. For a list of which AI belongs to which team by default, refer to [TEAM-page]
Set Angles: Set the stated Target's rotation to the stated Angles (in pitch/yaw/roll). As with Move To Position, this is also possible relative to the current angles.
Set Frobable: Sets the stated Entity frobable (box ticked) or unfrobable (box unticked).
Set Light Color: Changes the colour of the stated Target Light to the stated Color. In contrast to "Fade to Color", this happens without any transition.
Set Model: Changes the current model of the stated Target to the stated Model. E.g. can be used to set a model to a broken model after recieving damage.
Set Skin: Changes the current skin of the stated Target to the stated Skin.
Set Spawnarg: Changes the value of a Key (=spawnarg) on the stated Target to a stated Value.
Spawn Entity: Creates an entity of the stated Entity Class at the location Origin (X Y Z). E.g. can be used to create new loot through an event.
Spawn Particle: Creates an emitter that emits the stated Particle (including its .prt ending) at the location Origin (X Y Z) that stay there for stated Lifetime seconds. If no Lifetime is given it stays infinitely.
Start Stim Timer: Starts the timer of the stated Stim on the stated Entity. For information about how a timer on a Stim works, refer to [link].
Stop Stim Timer: Stops the timer of the stated Stim on the stated Entity. For information about how a timer on a Stim works, refer to [link].
Teleport (Set Origin): Moves the stated Entity to the stated location New Origin (coordinates: X Y Z). If the box "Relative to old origin" is ticked, the Entity is moved (X Y Z) units from its current location. [not sure where the difference to Move To is, though; maybe this ignores obstacles, Move To does not?]
Toggle Effect: Disables the stated Effect if enabled or enables the stated Effect if disabled on the stated Entity. The Effect is defined by two numbers (e.g. 2_3), which means that the Effect with the number 3 on the Response with the number 2 is disabled. The respective numbers can be found in the first column of the according window.
Toggle Light: Turns off the stated Light if on or turns on the stated Light if off.
Trigger: Activates the stated Target Trigger entity as if activated by the stated Activator. [if I remember correctly, this does not count as a trigger Stim. For this you would have to target a trigger entity, that then targets the entity you wish to receive the trigger Stim.]

This gives you a variety of options what you can do without you learning to write scripts on your own. You can add several effects with one response type. If you want to have several random effects, tick the box "Random Effects" and type the amount of random effects you want. Note that each effect can be picked several times (e.g. if you have one effect and use "Random Effects: 3" the same effect will be used three times)

Examples:
Arrow Trap:
First you have to create a func_shooter entity and position it, so the arrow points to where you want it to fire (note that this entity does not have a model! If you want one, you can put the shooter in front of an appropriate model). Define the projectile you want it to shoot (fire arrow by default) and see if the pitch needs changing. Now you have to create an activator, which can be done with the Stim/Response Editor: Create a brush, give it the NoDraw texture and convert it to a func_static. Place the entity, where you want the shooter to be activated (note that the radius of the Player Stim is 350 with a Falloff Exponent of 3 around the player, which results in an effective radius of around 100) and open the Stim/Response Editor. Add a Response "Player". To that Response add the Effect "Activate Shooter" with the name of the shooter as "Shooter Entity". Now the shooter will start firing as soon as the player comes close to the NoDraw entity. There are three options now: If you leave the setup as it is, the shooter will continue shooting without end. If you give the shooter an ammo value that is not -1, the shooter will stop shooting some time (dependent on the ammo amount) after the player goes away from the NoDraw entity. If you want the shooter to fire just once, you have to add the Effect "Deactivate Effect" and target the first effect that activates the shooter.
You can also make it possible for the player to disarm the trap. Create a response on another entity that fits what you want the player to do to disarm the trap (e.g. simply a Frob, if the player just has to push a button, a Water response, if the player has to shoot a water arrow on a circuit board or a furnace; the possibilities are andless) and add the same "Disable Effect" effect as before. You can also use the effect "Remove shooter", but in this case, the shooter can not be reactivated (e.g. by reigniting the furnace in the example before). Note that in this setup the trap will exclusively react to the player and will not to any AI.
Change Patrol:
You can change the patrol route of an AI through a response, e.g. if the player stole a specific loot item. Give the loot item a Response "Frob". Add the effect "Add Target". As the "Entity" do not use the AI, but the path_corner from which you want the AI to leave the old path and enter the new one. As "Target" put in the first path_corner of the new path. If the new path circles back to the old path, the path forks at this point, if it does not target any path_corner in the old path, the AI will stay on the new path.

 

All text in squared brackets is editorial and refers to stuff I need to change, when putting it up on the Wiki.

I would completly remove the current article as I have no clue what it should accomplish. If I understand correctly it calls for a trigger, when an AI is frobbed? Instead I would add a couple of more examples.

As always constructive critisism and corrections are very welcome.

 

EDIT: I added the examples in more detail.

Edited by Destined
  • Like 1
Link to comment
Share on other sites

Speaking about things that are in dire need of updating, I think new mappers would appreciate a revised or new version Beginner's Guide to Scripting, as Fidcal never finished it: http://wiki.thedarkmod.com/index.php?title=A_Beginner%27s_Guide_to_Scripting

 

The same goes for particles, particle editor and making custom particles: http://wiki.thedarkmod.com/index.php?title=Category:Particles

  • Like 1
Link to comment
Share on other sites

for the chair just surround chair with invisible brush changed to func_static and put s/r on that func_static, else if you increase the bounding dims you cant get near chair.

 

there's a predefined entity in dark radiants entity list that does the same function, there is a chance that the code clear up done by some people may have altered the way s/r works. eg the like radiation damage only works now inside a invisible entity.

 

the s/r system isn't part of the original doom 3 code its roughly based off the s/r system in thief and thief 2, dromed, it doesn't work the same way though.

Edited by stumpy
  • Like 1
Link to comment
Share on other sites

Speaking about things that are in dire need of updating, I think new mappers would appreciate a revised or new version Beginner's Guide to Scripting, as Fidcal never finished it: http://wiki.thedarkmod.com/index.php?title=A_Beginner%27s_Guide_to_Scripting

 

The same goes for particles, particle editor and making custom particles: http://wiki.thedarkmod.com/index.php?title=Category:Particles

I agree. However, I am not firm enough in either of these topics to dare to update these articles :(

 

for the chair just surround chair with invisible brush changed to func_static and put s/r on that func_static, else if you increase the bounding dims you cant get near chair.

 

there's a predefined entity in dark radiants entity list that does the same function, there is a chance that the code clear up done by some people may have altered the way s/r works. eg the like radiation damage only works now inside a invisible entity.

 

the s/r system isn't part of the original doom 3 code its roughly based off the s/r system in thief and thief 2, dromed, it doesn't work the same way though.

On the second map everything worked as supposed. I used a bench model there and even changed it to the chair for testing purposes. The error mus have been something else. As long as "use bounds" is not ticked, it works on any entity.

 

I have read that the code is based on Dromed. I have never worked with that, but I think the system is quite intuitive. A Stim type triggers a Response if the latter is defined for the respective type. That is the most basic "if" function, if you will.

Link to comment
Share on other sites

Thanks for the pointers, Judith.

Destined - nice one with the list and explanation - I will look at it over the weekend (snowed in, anyway...)
Does this mean that you and Stumpy have figured out the damage stim thing?

I used the same method - a func_static that was surrounding the brushwork, yet it refused to work. If it's because the damage only works with invisible entities, then that might explain a lot about why it was failing.

Also... the damage entities in the list (eg, 25, 50, 75) etc... I was under the impression that these were depreciated doom3 assets and didn't work.

Wonder what the problem is with "use bounds", but - if the damage is ramped by proximity to the nodraw/invisble func_static, then perhaps it's not required... or fighting with some other arg and that's the issue?

Thanks for the assist - the intro and list look comprehensive (also clarifying about the trigger stim needing an actual trigger to trigger... :/ ) and the examples are very useful by elaborating on specific details in context.
If you don't mind, I'll remove the didactic language and rejig some grammar so the examples are simplified without losing your instruction.

There might be a lot of pages needed to expand on some of the S/R terms...

  • Like 1
Link to comment
Share on other sites

For me the damage Stim worked just by putting it on an entity. I will have a look at the "use bounds" box on Sunday. Also, wanted to add an example that uses a couple more stims and responses. Something like the furnace mentioned in some of the examples with two parts: Reacting to a water stim to extinguish and reacting to a fire stim. Something like that...

 

As I said, constructive criticism is very werlcome. Just post your corrected version here and I will put it on the Wiki Sunday afternoon. It looks like I have some time then.

The Stim/Response Key/Values explains the Stim args quite well. I am not sure, which pages else you mean.

Edited by Destined
Link to comment
Share on other sites

Destined - would it be possible to have a spoilered copy of text content of your .map file so I can take a look at how you got the damage thing working in DR?

Also, the entity classes at the end of the list, such as "damage_triggerhurt_25" do not work - they remove the brush from TDM.
// and for some reason stop me from being able to copy the map from my DR maps folders to darkmod/maps while both are open - have to close TDM in order to copy due to win permission error.

However, the list of those "damage" classes provides a short list of the damage defs available to use, without having to dig into the TDM/damage.def file to find all the types of damage:

 

[/code]

/*
Damage definitions (additional to the ones defined in doom3/base/pak000/def)

Tels 2007-11-24 Base class for all damage definitions to cut out double definitions:
*/

entityDef atdm:damage_base
{
"inherit" "atdm:entity_base"
"editor_displayFolder" "Internal/Weapons/Damage"
"editor_usage" "Don't use. Base class for all TDM damage objects."

"editor_bool no_pain_anim" "When set to 1, the damaged entity won't play a pain animation. Defaults to 0."

"knockback" "0"
}

entityDef atdm:damage_none
{
"inherit" "atdm:damage_base"

"damage" "0"
"kickDir" "0 0 0"
"push" "0"

"kick_time" "0"
"kick_amplitude" "0"

"editor_usage" "This damage entity does not inflict any damage at all."
}

entityDef atdm:damage_simple
{
"inherit" "atdm:damage_base"
"damage" "10"
"no_sound" "1"
"no_pain" "1"
"editor_usage" "Defines a simple damage base class with 10 points, with no sounds or anything."
}

entityDef atdm:damage_low
{
"inherit" "atdm:damage_base"
"damage" "10"
"no_sound" "0"
"no_pain" "0"
"editor_usage" "Defines a simple damage base class with 10 points"
}

entityDef atdm:damage_generic
{
"inherit" "atdm:damage_base"
"damage" "20"
"no_pain" "0"
"kickDir" "1 0 0"
"push" "6"

"editor_usage" "Defines a simple damage base class with 20 points"
}



entityDef atdm:damage_water
{
"inherit" "atdm:damage_base"
"damage" "30" // the elemental has 20 health
"no_sound" "0"
"no_pain" "0"
"editor_usage" "The damage done to a fire elemental when it is hit with an water arrow."
}

entityDef atdm:damage_gas
{
"inherit" "atdm:damage_base"
"damage" "3" // the elemental has 20 health, and the GAS stim is
// broadcasted every 0.3 seconds, so that should
// make it last roughly 6.something seconds.
"no_sound" "0"
"no_pain" "0"
"editor_usage" "The damage done to a fire elemental when it is inside a gas cloud."
}

entityDef atdm:damage_fire
{
"inherit" "atdm:damage_base"
"damage" "10"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
"burn" "1" // play sizzle sound on player
"editor_usage" "Defines a simple fire damage base class with 10 points."
}

entityDef atdm:damage_holy_water
{
"inherit" "atdm:damage_base"
"damage" "140" //raised from 80 to address issue #0003620
"no_sound" "1"
"no_pain" "1"
"editor_usage" "Damage dealt by holy water."
}

entityDef atdm:damage_holy_water_effect
{
"inherit" "atdm:damage_base"
"damage" "0"
"no_sound" "1"
"no_pain" "1"

"smoke_wound_flesh" "tdm_holy_water_hit.prt"
"smoke_wound_undeadflesh" "tdm_holy_water_hit.prt"
"smoke_wound_undeadbone" "tdm_holy_water_hit.prt"
"mtr_wound_flesh" "" // TODO

"editor_usage" "Damage effect made by a direct hit of a holy water arrow."
}

entityDef atdm:damage_energyballDirect
{
"inherit" "atdm:damage_base"
"damage" "20"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
"burn" "1" // play sizzle sound on player
"editor_usage" "Damage effect made by a direct hit of an energy ball."
}

entityDef atdm:damage_energyballSplash
{
"inherit" "atdm:damage_base"
"damage" "20"
"radius" "50"
"knockback" "20"
"push" "20"
"attackerDamageScale" "0.2"
"attackerPushScale" "0.2"
"gib" "1"
"editor_usage" "Damage effect made by an indirect hit (splash) of an energy ball."
}

// the name of this entity is hard-coded into the C++ source:
entityDef damage_fall_soft
{
"inherit" "atdm:damage_base"
"damage" "1" // greebo: this damage is scaled by the code
"kickDir" "0 0 -1"
"kick_time" "100"
"kick_amplitude" "1"
"no_sound" "1" // don't play default damage sound
"snd_damage" "tdm_player_damage_softlanding"
"editor_usage" "Damage effect when the player falls softly. Damage is scaled by the code depending on speed."
}

// the name of this entity is hard-coded into the C++ source:
entityDef damage_fall_hard
{
"inherit" "atdm:damage_base"
"damage" "1" // greebo: this damage is scaled by the code
"kickDir" "0 0 -1"
"kick_time" "300"
"kick_amplitude" "1"
"no_sound" "1" // don't play default damage sound
"snd_damage" "tdm_player_damage_hardlanding"
"editor_usage" "Damage effect when the player falls hard. Damage is scaled by the code depending on speed."
}

// Damage caused by something thrown by a guard
entityDef atdm:damage_winebottle
{
"inherit" "atdm:damage_base"
"damage" "5"
"kickDir" "1 0 0"
"push" "6"
"mtr_blob" "genericDamage"
"blob_time" "300"
"blob_size" "400"
"blob_offset_x" "400"
"knockback" "10"
"kick_time" "1100"
"kick_amplitude" "0.25"
"dv_time" "100"
"smoke_wound_flesh" "bloodwound.smoke"
}


entityDef atdm:damage_rock
{
"inherit" "atdm:damage_base"
"damage" "5"
"kickDir" "1 0 0"
"push" "6"
"mtr_blob" "genericDamage"
"blob_time" "300"
"blob_size" "400"
"blob_offset_x" "400"
"knockback" "7"
"kick_time" "1100"
"kick_amplitude" "0.25"
"dv_time" "100"
"smoke_wound_flesh" "bloodwound.smoke"
}

// grayman #2816 - used by thrown moveables

entityDef atdm:damage_moveable
{
"inherit" "atdm:damage_base"
"damage" "1" // scaled by mass & velocity at time of impact
"scale_damage" "1" // scale damage before applying it
"knockout" "1" // can cause a knockout, but mass and velocity also play a part
"knockout_power" "0" // powered-up knockout, not used
"push" "6"
"kill_all" "0" // if = 1, allow the moveable to kill what it strikes
"editor_usage" "Damage effect when a moveable hits an AI. Damage is scaled by the code depending on speed."
}

entityDef damage_suicide {
"damage" "9999"
"noArmor" "1"
"noGod" "1"
}




entityDef damage_triggerhurt_5 {
"damage" "5"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
}

entityDef damage_triggerhurt_10 {
"damage" "10"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
}

entityDef damage_triggerhurt_15 {
"damage" "15"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
}

entityDef damage_triggerhurt_25 {
"damage" "25"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
}

entityDef damage_triggerhurt_50 {
"damage" "50"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
}

entityDef damage_triggerhurt_75 {
"damage" "75"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
}

entityDef damage_triggerhurt_100 {
"damage" "100"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
}

entityDef damage_triggerhurt_1000 {
"damage" "1000"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
}



entityDef damage_crush {
"damage" "9999"
"gib" "1"
"gibNonSolid" "1"
"noArmor" "1"
"noGod" "1"
}

entityDef damage_gib {
"damage" "9999"
"gib" "1"
"noArmor" "1"
"noGod" "1"
}

entityDef damage_explosion {
"damage" "70"
"radius" "200"
"push" "10000"
}

entityDef damage_explodingbarrel {
"damage" "300"
"radius" "140"
"push" "2000"
"knockback" "100"
"gib" "1"
}

entityDef damage_Smallexplosion {
"damage" "50"
"radius" "50"
"push" "5000"
"knockback" "50"
}

entityDef damage_HugeExplosion {
"damage" "500"
"radius" "256"
"push" "10000"
"knockback" "200"
}

entityDef damage_moverCrush {
"damage" "1"
"gib" "1"
"gibNonSolid" "1"
}

entityDef damage_painTrigger {
"damage" "10"
}

entityDef damage_noair {
"damage" "10"
"delay" "3.0"
"kickDir" "0 0 0"
"noArmor" "1"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"no_air" "1"
}



entityDef damage_fatalfall {
"damage" "300"
"kickDir" "0 0 -1"
"noArmor" "1"
"knockback" "0"
"kick_time" "300"
"kick_amplitude" "1"
"no_sound" "1" // don't play default damage sound
}

entityDef damage_lightBreak {
"damage" "1"
"radius" "5"
"push" "20000"
"knockback" "20"
}


entityDef damage_lava {
"damage" "15"
"kickDir" "0 0 0"
"mtr_blob" "genericDamage"
"blob_time" "0"
"blob_size" "0"
"blob_offset_x" "0"
"knockback" "0"
"kick_time" "0"
"kick_amplitude" "0"
"dv_time" "100"
"burn" "1" // play sizzle sound on player
[/code]



Without being able to get the damage S/R working - I can't test using something such as "atdm:damage_moveable/moverCrush" on the player, which would be a simple way of making a mover cause damage based upon its velocity/instadeath on getting crushed under an elevator)

The spoilered list (the content of damage.def) would be a useful page to create and link from the S/R page for available "damage defs".
But, until it's possible to get the S/R damage working - there's no way to test them all to see if they all work as described.

Do you even exploding barrel and gib in TDM, m8?
Have a feeling only those prefixed by "atdm:" will work, but want to try them out anyway...

// wondering if a trigger multiple can be placed over the thing to cause damage and it trigger the "damage_moveable" or "damage_triggerhurt_n"
// for some reason - after setting entity class as one of the "damage" entities - on creating a new brush, it's impossible to create an entity from ANY worldspawn brush at all, even after restart... oh dear... what have I done here..?

// For some reason - choosing to create one of these damage entities has activated a bunch of filters, so it appears that no draw and clip entities or worldspawn brushes are being deleted when I deselect them...

Edited by teh_saccade
Link to comment
Share on other sites

It's still Saturday in Samoa for at least another 5 hours...

I'll add/fix formatting and stuff later, unless you want to make some headers and sections and breaks and stuff - I think I've forgotten the wikicode for most of it, but have added stuff like header sizes and bold and hopefully nesting (can't remember bullet points for the list or numbered list for instructions - will have to check once it's up and can see the page not as forum post)

Is there a glossary of common dromed/TDM/DR terms on the wiki?
eg, [entity], [arg] (which also could do with standardising... key, arg, spawnarg, value, etc... tend to be interchangable in some instances throughout some wiki pages), [frob], etc...

It might be useful. "Frob" isn't a word I've ever heard outside of thief, really - it's shorthand for "frobnicate": To manipulate or adjust, to tweak. One frequently frobs bits or other 2-state devices. eg, please frob the switch, thanks.

(and I've never used the word "frobnicate", in my life).

Nice article, Destined - clear and concise.

Think that expanding the wiki glossary would be good in order to help navigation from keywords to relevant articles / further reading.
Would also serve as a good hub to work out from in updating pages.




==== Stim / Response Editor ===


The Stim/Response Editor was introduced to save typing each arg for every stim and response on the page, [stim/Response Key/Values] that also contains more specific descriptions as to what each Stim/Response [arg] does. // glossary / standardise arg/spawnarg*

For more general reading on stims and responses, please see also the [stim/Response page].

// Stims & Responses format nested / bulleted.

== Stims ==

To add a stim or response to an entity, open the Stim/Response editor:
Select the entity and - from the menu bar - go to Entity > Stim/Response.
The Stim/Response Editor has three tabs: Stims, Responses and Custom Stims.
As stated on the [stim/Response] page, an entity can have either or both Stims and Responses, but is not able to use a Stim effect on itself.

To add a non-custom Stim, select the "Stims" tab.
From here, it is possible to add a Stim from the drop-down menu next to the "Add" button, clicking the Add button and choosing a stim from the "Type" drop-down menu at the top ("Frob" being the default) or using a keyboard shortcut by pressing the initial letter of the Stim type you'd like to add.

Select the Stim to edit from the numbered list on the left.
If no Stim type is selected, all options presented on the right are greyed out.
The options on the right side of the editor allow changes to all key values of the Stim, removing the need to type and enter manually all key values as listed and described in [stim/Response Key/Values].


== Responses ==

The Response Editor is a simplified way to create basic scripts without need for deeper knowledge on scripting for TDM.
It works similar to the Stim Editor, but for adding Stims that will act as entity responses.
In the Responses tab, the Stim to which the selected entity should respond is selected in the same way as the Stims tab.

However, this only tells the entity that it must show a response to a certain Stim type. For a response to happen, there must be an effect.
To add an effect, right-click in the "Response Effects" window and press, "Add new Effect".
Double-clicking the numbered Response, or right-clicking it and choosing "Edit", open the "Edit Response Effect" box in which it is possible to select the target entity, type of Stim (as args) and the Response effect itself.

----

=== Available effects are: ====

// bullet list these, I forget the wiki code for that...

'''Activate Response:''' Activates the Response for the stated Stim Type on the stated Entity.
;..E.g. the player must give a fire stim to a furnace in order to have a door react to a frob Stim.
'''Activate Shooter:''' Activates the named Shooter entity.
;..E.g. Can be used to activate a trap.
'''Activate Stim:''' Activates the Stim for the stated Stim Type on the named Entity.
;..E.g. Adds a damage stim to the furnace after a fire stim is given.
'''Add Target: ''' Adds the stated Target to the named Entity.
;..E.g. Add a new path_corner to a patrol route.
'''Apply Stim:''' Fires a Stim of the stated Stim Type to the named Target.
;..The Source can be changed, but is not necessary.
'''Blind AI:''' Blinds the named AI as if a flash bomb has been used on it.
'''Clear Targets:''' Removes all Target-args from the named Entity.
'''Damage:''' Applies a damage type to the stated Target.
;..Damage Defs can be found in the def file "darkmod/tdm_defs01.pk4/defs/tdm_damage.def". // *wiki page req. [damage defs]*
'''Deactivate Response:''' Deactivates the Response for the stated Stim Type on the named Entity.
'''Deactivate Shooter:''' Deactivates the stated Shooter.
;..E.g. Can be used to disarm a trap.
'''Deactivate Stim:''' Deactivates the Stim for the stated Stim Type on the named Entity.
'''Disable Effect:''' Disables only one Effect on the named Entity.
;..The Effect is defined by two numbers (e.g. 2_3), meaning that the Effect numbered 3 on the Response number 2 is disabled. The respective numbers can be found in the first column of the Response Effects window. // clarification/testing req.*
'''Enable Effect:''' Enables only one Effect on the stated Entity.
;..The Effect is defined by two numbers (e.g. 2_3), meaning that the Effect numbered 3 on the Response numbered 2 is enabled. The respective numbers can be found in the first column of the Response Effects window. // clarification/testing req.*
'''Fade Light Color:''' Changes the colour of the named Target Light to the stated Color over a time of Fade Time seconds.
'''Frob:''' Frobs the named Entity as if it had been frobbed by the player.
'''Gas Knockout:''' Knocks out the named Target as if it had been hit with a gas arrow.
'''Heal:''' Heals the named Target by the stated Amount.
'''Kill:''' Kills the named Target.
'''Knockout:''' Knocks out the named Target as if it had been hit with the blackjack.
'''Turn extinguishable Light Off:''' Extinguishes the named extinguishable Light.
'''Turn extinguishable Light On:''' (Re)ignites the named extinguishable Light.
'''Turn Light Off:''' Turns off the named Light.
'''Turn Light On:''' Turns on the named Light.
'''Move To Position:''' Moves the named Entity to the stated Position (coordinates: X Y Z).
;..If the box "Relative to old origin" is ticked, the Entity is moved (X Y Z) units from its current location.
'''Move To Random Position:''' Moves the named Entity to a random position inside the "Within Radius" range.
'''Play Animation:''' Plays the stated Animation for the stated Entity.
;..The Animation can be limited to only one channel (such as only the head or similar), but is best left this blank, unless sure of intent. // req. list animation channels (1=ANIMCHANNEL_X)*
'''Play Sound:''' Play the named entity's stated Sound.
;..The channel can be limited (e.g. to the player voice or ambient), but this can also be left blank. // req. list sound channels (SND_CHANNEL_X)*
'''Play Sound Shader:''' Plays the named Sound Shader on the stated channel (as before the channel does not need not be defined). This is not limited to inherited sounds of the entity. // req. list sound channels*
'''Remove:''' Removes the named Target from the map.
'''Run Script:''' Runs the named Script. For more information on scripts refer to [scripting_basics].
'''Set AI Team:''' Change the named AI's team to the stated Team.
;..For a list of which AI belongs to which team by default, refer to [AI_Relations_(Editing)#AI_Types_.28Teams.29]
'''Set Angles:''' Set the named Target's rotation to the stated Angles (in pitch/yaw/roll).
;..As with Move To Position, this is also possible relative to the entity's current angles.
'''Set Frobable:''' Sets the named Entity as frobable (box checked) or unfrobable (box unchecked).
'''Set Light Color:''' Changes the colour of the named Target Light to the stated Color.
;..In contrast to "Fade to Color", this happens without any transition.
'''Set Model:''' Changes the current model of the named Target to the stated Model.
;..E.g. Can be used to change a model to a broken model after recieving damage.
'''Set Skin:''' Changes the current skin of the stated Target to the stated Skin.
'''Set Spawnarg:''' Changes the value of a Key (Spawnarg) on the stated Target to a stated Value. // consistency req. between [arg/spawnarg], glossary entry link*
'''Spawn Entity:''' Creates an entity of the stated Entity Class at a given location Origin (X Y Z). E.g. can be used to create new loot through an event. // glossary [entity]*
'''Spawn Particle:''' Creates an emitter that will emit the named Particle (including its .prt extension) at the location Origin (X Y Z) that stay there for stated Lifetime seconds. If no Lifetime is given it stays infinitely. // glossary and/or link for [particle]*
'''Start Stim Timer:''' Starts the timer of the stated Stim on the named Entity.
;..For information about how a timer on a Stim works, refer to [stim/Response_Key/Values], E.g. Key: sr_timer_time_N. // stim type id?* req. S/RK/V update*
'''Stop Stim Timer:''' Stops the timer of the stated Stim on the named Entity.
;..For information about how a timer on a Stim works, refer to [stim/Response_Key/Values], E.g. Key: sr_timer_time_N. // stim type id?* req. S/RK/V update*
'''Teleport (Set Origin):''' Moves the named Entity to the stated location's New Origin (coordinates: X Y Z).
;..If the box "Relative to old origin" is checked, the Entity is moved (X Y Z) units from its current location. // (not sure where the difference to Move To is, though; maybe this ignores obstacles, Move To does not?) clarification req. untested*
'''Toggle Effect:''' Disables the stated Effect if enabled or enables the stated Effect if disabled on the named Entity.
;..The Effect is defined by two numbers (e.g. 2_3), meaning that the Effect numbered 3 on the Response numbered 2 is disabled. The respective numbers can be found in the first column of the Response Effects window. // clarification?/untested*
'''Toggle Light:''' Turns off the named Light if on or turns on the named Light if off.
'''Trigger:''' Activates the named Target Trigger entity as if activated by the stated Activator. // (If I remember correctly, this does not count as a trigger Stim. For this you would have to target a trigger entity, that then targets the entity you wish to receive the trigger Stim). req. test/clarify [triggers] glossary/link*


The Response list gives a variety of options that allows for many effects without the need to write scripts.

It is possible to add several effects with one response type by checking the box, "Random Effects" and entering the number of random effects to be used.
Note that each effect can be used multiple times. E.g. Selecting only one effect and setting "Random Effects: 3" will use the same effect three times.

----

== Examples: ==

==== Arrow Trap: ===

First, create an [atdm:func_shooter] (// glossary, func's - there is no func_shooter, it is now atdm:*) entity and position it so that the arrow points in the desired direction to shoot.
''Note that this entity does not have a model. If a model is required, the shooter can be placed in front of the approriate model''.
Define the projectile to be fired (the default is a fire arrow) and check the pitch for the projectile's trajectory. // req. list atdm:def_projectile_xxx/path to def*

Next, it is necessary to create an [activator] (// glossary, link script reference?), that can be achieved with the Stim/Response Editor as follows:
;..Create a brush, giving it a NoDraw texture and convert it to a func_static.
;..Place this func_static entity, where the shooter is to be activated (note that the radius of the Player Stim is 350 with a Falloff Exponent of 3 around the player. This results in an effective radius of around 100 units). // glossary units?*
;..Open the Stim/Response Editor.
;..Add a Response "Player" to the NoDraw func_static entity.
;..To that Response, add the Effect "Activate Shooter" with the name of the shooter as "Shooter Entity".

Now the shooter will start firing as soon as the player comes withing 100 units of the NoDraw func_static entity.

There are now three options:

;..If the the setup is left as it is, the shooter will continuously fire.
;..If the shooter is given an ammo value that is not -1, the shooter will stop firing some time, depending on if the ammo is depleted, after the player moves away from the NoDraw func_static entity.
;..If the shooter is to fire only once, it is necessary to add the Effect, "Deactivate Effect" and target the first effect that activates the shooter or give an ammo value of 1.

It is also possible so that the player might disarm the trap:

;..Create a response on another entity that the player will use to do to disarm the trap.

''E.g. Frob, if the player is to push a button or use a switch or lever, or a Water response if the player is to shoot a water arrow on a circuit board or a furnace. The possibilities are endless.''

;..Add the same "Disable Effect" effect as before. // "Deactivate Effect" or "Disable Effect"..?*
;..It is also possible to use the Effect, "Remove shooter". But if this is used, the shooter will not be reactivated (E.g. if the player re-arms the trap, as above).
''Note that using this setup, where the Response is "Player", the trap will exclusively react to the player and not to any AI.''

----

=== Change Patrol: ===
An AI's behaviour, such as its patrol route, may be altered through a response.
E.g. If the player has taken a specific loot item.

;..Give the loot item a Response "Frob".
;..Add the effect "Add Target".
;..As the "Entity" do not use the AI, but the path_corner from which the AI is to leave its original path to enter the new one.
;..As "Target" put in the first path_corner of the new path.

If the new path circles back to the original path, the path will fork at this point:
if the new path does not target any path_corner of the original path, the AI will remain patrolling the new path. // glossary path; AI pathing [Path_Nodes]*

----

=== Damage Stim ===

/* The current example on the wiki does not appear to work and contains no explanation - if you've figured this out, then out-dated example can be replaced here with your new one that does work */

----


END*

=== Advanced AI manipulation / blend trigger, level design, script with S/R ===



/* A more advanced example of altering AI behaviour, such as setting AIUSE_SUSPICIOUS and using S/R light on to momentarily light and reveal a weapon or KO'd AI that is "out of sight/in the shadows/decoration" to player but suspicious for AI, to put the AI into an alert/search state if player triggers by failing hidden objective (eg, KO'ing a patrol that is noticed to have not passed on time, so the stationary guard appears to wonder what is up and starts wandering about to find the missing patrol)... Or expanding upon the AI pathing so that player prox. will change an AI's facing direction in a hidden room so that AIUSE_LIGHTSOURCE will cause the AI to flip the lightswitch it can now see (or to use player prox, opening a door, or trig_once to turn off the light, so the AI will turn it on), that is rigged with some Response to perform something such as spawn aggressive, no path, constant searching reinforcement AI or cause an event where the player has "diverted poisonous gas" into a crowded room full of dinner party guests or guard room after turning a wheel (diverting "gas" away from blocking their path, or onto themselves by accident), that causes the hidden AI to turn, that causes the AI to see the turned off light and switch it back on, that causes blocking particle emitter and hurt to be removed and spawn a new particle emitter in the crowded room, KO'ing all the people inside, with another lever/wheel outside that will S/R remove the emitter and playerhurt in that room, turning off / rediverting the gas back to the original... might be a good example of more complex traps, obstacles and events that make use of AI manipulation, etc... blending level design, triggers and S/R to create a more advanced event that requires no script calls. Or combining basic scripts to create things as a "rockfall" as player passes through a trigger and turns off a light, causing hidden AI to flip on the light switch, that S/R spawns rubble to block tunnel behind the player and calls basic camera shake plus sound script, giving impression that the tunnel has collapsed behind player (perhaps alerting a few guards because of "noise" (that is actually altering their pathing / making suspicious through turning on a light that allows them to see a KO'd AI in direction of player), and requires only a few script events - the rest of the effects delivered by S/R system AI manipulation... Idk, maybe it's too much (and also giving away a couple of less common events and unique FM things...). Perhaps something simple such as using S/R to call script or - more simply - activate a button to raise elevator and also alter AI path to make use of the elevator and take new patrol path, timing elevator descent with AI wait time at node, before the guards have now moved from upstairs to downstairs and move to barracks, as it's end of shift, giving player window of opportunity to take advantage of event to pass area without detection, etc... There are too many examples of blending simple AI manipulation with simple trigger, hidden level design and script call to fake more complex events. Maybe not the place for it... Idk if it even makes sense, reading it back (it does to me...) */


 

Link to comment
Share on other sites

Thanks for checking the article and formatting! I would have done the format after the content stands, but this is even better ;-)

 

I have only tested the damage Stim on func_statics. I am not sure if they work on movers. Anyway, here is the map file, where I tested my stims. has three setups: on the left I tried to get "use bounds" to work, but it still alsways uses the distance to the origin. When I set the radius to 10, I could walk into the block and even had to jump to receive the Stim. The middle is a simple damage Stim. It is noteworthy that even with a mignitude of 1 it is recommended to set a Time interval, as the Stim is fired every frame(?) killing the player instantly (this is what happens in teh setup to the left). When you get near enough to the chair to frob it, you can remove it before it kills you. The damage Stim also disappears as a consequence. To the right is a setup with a shooter. Currently it is set to only shoot once. When you remove the second effect of the response, the shooter will onyl shoot as long as the player is near the trigger.

I hope this helps you out. BTW: I use TDM v2.05 and DR v2.5.0 If the setup helps you finding out, what went wrong in your case, please tell, so we can add this as notes to the Wiki.

 

stim.map.txt

Edited by Destined
Link to comment
Share on other sites

I have updated the Wiki article. In case the old one is still required, I saved it on my HD. I have not included all references (especially not the non-existing ones). Of course, everyone is welcome to have a look and report any errors.

  • Like 1
Link to comment
Share on other sites

It ought to have its state saved in the wiki history anyway, Destined.
http://wiki.thedarkmod.com/index.php?title=Stim/Response_Editor&action=history

Looks awesome - nice job, man. (+11,474)

// also thanks for the example map - however, I've bugged out my DR so that I can no longer create entities in the "normal" ways, which is annoying...

I got rid of the extra = typo and fixed the nesting (got it backwards...), substituting the unnecessary ---- for triple line breaks, so that it now shows more organised in page content index and in article flow (also for search):

Contents

Edited by teh_saccade
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...