Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

@Springheel

or the wall itself is set to noshadows.

Wow, I didn't know that a wall (worldspawn) could be set to no shadows? I'll have to check that tonight, and recheck the light itself to make sure it is not on NOSHADOWS. But I don't believe it is. Thanks.

Quando omni flunkus moritati" ("When all else fails, play dead")

Halloween Contest Winner 2014

Link to comment
Share on other sites

Spring had a great thought to check if the floor is set to noshadows. Basically shadows are what it's all about. Is the light you chose unusual? Does the same thing happen if you substitute it with a standard light?

  • Like 1

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

@RJFerret

Don't know. Will have to check tonight. Will try swapping lights to see what happens. The light in question is a simple, extinguishable, wall oil lamp. Nothing fancy. It is a clone from another

In the map that has no problems.

Quando omni flunkus moritati" ("When all else fails, play dead")

Halloween Contest Winner 2014

Link to comment
Share on other sites

Pathing - I just can't get anyone to sit down squarely on a chair. I've imported Grayman's sit path from the 1st guard in the North and it seems what's needed is 3 entities: a path corner next to the chair, a path turn angle 90° away from the sit direction, and a path sit with sit_direction_angle set. On a blank test map the prefab works fine but when I manually copy it the AI sits half to the side or the back, or on thin air behind it. Is more needed?

 

The position of the path_corner is critical, there's a spawnarg to make them move more closely to the exact corner position, "move_to_position_tolerance", otherwise they can be within half their AAS size (16 units) off and consider themselves in place. I have used "move_to_position_tolerance" set to "1" happily, but be sure that your corner is no closer then 16 units to monsterclip/walls/anything that would impede them reaching the corner or they'll endlessly circle trying to get there. "move_to_position_tolerance" "2" might be safer, but anything less than 16 will be closer.

 

On the S/R question, what are you trying to do? Move something then have it pop back to start and move again?

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

Pathing - I just can't get anyone to sit down squarely on a chair. I've imported Grayman's sit path from the 1st guard in the North and it seems what's needed is 3 entities: a path corner next to the chair, a path turn angle 90° away from the sit direction, and a path sit with sit_direction_angle set. On a blank test map the prefab works fine but when I manually copy it the AI sits half to the side or the back, or on thin air behind it. Is more needed?

 

I don't think you need a path angle...you can set the AI to spin to the direction they're supposed to sit.

 

But that aside, it could be that the chair itself is getting in the way. I usually make the chair nonsolid and put a small monsterclip (and player clip) brush to keep them from walking through it. The animation doesn't care whether there is a chair there or not, but if the AI might not stop in the right spot if they think the chair is in the way.

Link to comment
Share on other sites

I don't think you need a path angle...you can set the AI to spin to the direction they're supposed to sit.

 

The path_turn is necessary to get the AI facing the correct direction before they start to sit, IE, facing away from the seat. Otherwise they'll be facing whichever direction they approached the path_corner and sit in midair. Then the angle post sit is if there's a table or some other reason the AI sits on the side of the chair and spins to face the correct way.

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

Yes, one or the other is necessary to get the AI to face the correct way, but complicating it with something that isn't an issue for the user, and will break their current mostly working implementation, compared to resolving the positioning problem...

 

Never mind the still pending movement query.

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

Pathing - I just can't get anyone to sit down squarely on a chair.

 

Most arrivals at path_corners are "good enough". If the AI gets w/in 16 (or so) of the path_corner, he'll consider himself there.

 

This creates a variance in where your AI will be standing when he sits. This variance means he could sit in the center of the chair or on one or the other edge.

 

To have more control over when he stops moving, you could try setting this spawnarg on the path_corner:

 

"move_to_position_tolerance" "N"

 

where "N" is a number smaller than 16. Try "8" and see if he becomes a more accurate sitter. This number is how close he needs to be before he considers himself to be at the path_corner.

 

The downside of making him more accurate is that he might overshoot the path_corner, bump into the chair, or do any number of other crazy things.

 

So try different numbers until you find one that works best.

Link to comment
Share on other sites

Great, I've got them sitting in just the right positions now every time. It took some trial and error with the tolerance spawnarg and corner position, and sit_down_slide_dist helped too. Thanks for that.

 

About the stims - I don't see why the stim stops working when I put a max fire count or activation timer on top of the radius. Does anyone know of someplace that describes how all those settings work? I'm only seeing the example in Fidcal's tutorial and a rather advanced and more general page on the wiki.

  • Like 1
Link to comment
Share on other sites

func_movers move along NURBS curves, or via scripts, they move via

$<name of func_mover>.time(n) // time it takes to travel along length of path in seconds.

$<name of func_mover>.accelTime(n) // time it takes to accelerate to full speed in seconds

$<name of func_mover>.decelTime(n) // time it takes to decelerate to full stop in seconds

$<name of func_mover>.startSpline($<name of nurbs curve>) // ties the func_mover to its nurbs curve path via the origin of the func_mover

sys.waitFor($<name of func_mover>) // waits for named func_mover to finish what its doing before getting it to do something else

 

if you stick the script in a while ( 1 ) loop it will loop till the end of time, if the nurbs curve is not in a loop then the func_mover will automatically move to the start of the curve so you don't need to teleport it.

  • Like 1
Link to comment
Share on other sites

I don't see why the stim stops working when I put a max fire count

What did you expect? If you set a max fire count, the stim will be fired exactly that often and than disabled. If you want infinite firing (or controll the activity via other methods), set it to zero.

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

I'm looking for the wiki tutorial on rounding the edges of brushes. I think the tut focused on house corners, but I'm sure there are other applications. I thought it was originally in Fidcal's A-Z tut, but I browsed through it a couple times and didn't see anything. Anyone remember where it is? Thanks in advance.

"Fancy burricks are afraid of dogs, if they encounter each other the dog barks and the burricks poop." - Thief: Deadly Shadows Game Designer

Link to comment
Share on other sites

I assume it has to be done with scripts but I have an object that I want to be controlled by directional buttons. Say you press the up button (which is a button entity ingame) and the object moves X doom units north, and so on.

 

Anyone know how to do that?

Edited by Goldwell
Link to comment
Share on other sites

Anyone know how to do that?

 

Script it. I know, I know, I'm the guy who usually says you don't need to script such and such, just do this readily instead.

 

However, movers are designed to move back the other way when triggered again, you could potentially work around that firing two in succession, but then you'd be binding together four movers for your directions, with the object bound to that set of four. Unless someone has a better option, this would be much easier scripted afaik.

 

Edit: Note, even elevators are scripted, and they just simply move between a couple established spots.

  • Like 1

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

If you only want one of these in your map, you can use four functions in your main map script that control your mover by its $name.

 

If you want several, use a script object instead, and attach it to each mover. You can set the movement distance and the maximum allowed range as spawnargs on each one.

 

Happy to draft a working example of that script to use or adapt if you want, just me know.

Link to comment
Share on other sites

I assume it has to be done with scripts but I have an object that I want to be controlled by directional buttons. Say you press the up button (which is a button entity ingame) and the object moves X doom units north, and so on.

 

Anyone know how to do that?

object button_controlled_mover
{
float MAX_HEIGHT;
float MIN_HEIGHT;
float STEP;
void init();
void responseToButton(entity button, entity unused);
};
void button_controlled_mover::init()
{
MIN_HEIGHT = getFloatKey("min_height");
MAX_HEIGHT = getFloatKey("max_height");
STEP = getFloatKey("step");
ResponseAdd(STIM_TRIGGER);
ResponseSetAction(STIM_TRIGGER,"responseToButton");
ResponseEnable(STIM_TRIGGER,1);
}
void button_controlled_mover::responseToButton(entity button, entity unused)
{
vector origin;
origin = getOrigin();
if (button.getKey("dir") == "up")
{
	origin_z += STEP;
	if (origin_z > MAX_HEIGHT) origin_z = MAX_HEIGHT;
}
else if (button.getKey("dir") == "down")
{
	origin_z -= STEP;
	if (origin_z < MIN_HEIGHT) origin_z = MIN_HEIGHT;
}
moveToPos(origin);
}

To get this working you need two buttons (atdm:mover_button) and a func_mover entity (the entity which should be controlled by the buttons. Let both buttons target the mover. On the button which should cause the mover to move upwards, set the spawnarg "dir" "up", on the other one "dir" "down".

 

On the mover set the following spawnargs:

  • "scriptobject" "button_controlled_mover"
  • "max_height" the maximum z-coordinate the mover should be able to move to
  • "min_height" similar
  • "step" the amount of doom units the mover should move once a button is pressed

Put the code in a script file in a folder called script in your mission folder, and add another script file called tdm_custom_scripts.script. In this file, add the following line

#include "script/scriptfilename.script"

where scriptfilename is the name of the scriptfile containing the scriptobject. So if you call it mymover.script, the line would look like this

#include "script/mymover.script"

Don't forget the ending!

 

 

EDIT: I just saw that you may want to have horiontal movement. Use the same script, but change the coordinate manipulated by the script (so origin_x or origin_y instead of origin_z).

  • Like 1

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

object button_controlled_mover
{
float MAX_HEIGHT;
float MIN_HEIGHT;
float STEP;
void init();
void responseToButton(entity button, entity unused);
};
void button_controlled_mover::init()
{
MIN_HEIGHT = getFloatKey("min_height");
MAX_HEIGHT = getFloatKey("max_height");
STEP = getFloatKey("step");
ResponseAdd(STIM_TRIGGER);
ResponseSetAction(STIM_TRIGGER,"responseToButton");
ResponseEnable(STIM_TRIGGER,1);
}
void button_controlled_mover::responseToButton(entity button, entity unused)
{
vector origin;
origin = getOrigin();
if (button.getKey("dir") == "up")
{
	origin_z += STEP;
	if (origin_z > MAX_HEIGHT) origin_z = MAX_HEIGHT;
}
else if (button.getKey("dir") == "down")
{
	origin_z -= STEP;
	if (origin_z < MIN_HEIGHT) origin_z = MIN_HEIGHT;
}
moveToPos(origin);
}

To get this working you need two buttons (atdm:mover_button) and a func_mover entity (the entity which should be controlled by the buttons. Let both buttons target the mover. On the button which should cause the mover to move upwards, set the spawnarg "dir" "up", on the other one "dir" "down".

 

On the mover set the following spawnargs:

  • "script_object" "button_controlled_mover"
  • "max_height" the maximum z-coordinate the mover should be able to move to
  • "min_height" similar
  • "step" the amount of doom units the mover should move once a button is pressed

Put the code in a script file in a folder called script in your mission folder, and add another script file called tdm_custom_scripts.script. In this file, add the following line

#include "script/scriptfilename.script"

where scriptfilename is the name of the scriptfile containing the scriptobject. So if you call it mymover.script, the line would look like this

#include "script/mymover.script"

Don't forget the ending!

 

 

EDIT: I just saw that you may want to have horiontal movement. Use the same script, but change the coordinate manipulated by the script (so origin_x or origin_y instead of origin_z).

 

 

I have followed your instructions exactly but in game when I press the buttons nothing happens. Is there anything missing? I checked the console and don't see any errors in there either. I then tried creating new mover buttons and func_movers just as a dummy to test but no luck. All the files are in the right order (I compared it against the layout of Moonbo's FM scripts) but it just doesn't work for some reason. Any idea what might be the problem?

Link to comment
Share on other sites

I didn't test it. Will take a look tomorrow and post here again.

  • Like 1

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

I have followed your instructions exactly but in game when I press the buttons nothing happens. Is there anything missing? I checked the console and don't see any errors in there either. I then tried creating new mover buttons and func_movers just as a dummy to test but no luck. All the files are in the right order (I compared it against the layout of Moonbo's FM scripts) but it just doesn't work for some reason. Any idea what might be the problem?

Just tested it and it works as expected, so I guess you did something wrong. I'll set up an example FM for you and upload it here.

 

Here ya go:

mover.pk4.txt

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

On the mover set the following spawnargs:

  • "script_object" "button_controlled_mover"
  • "max_height" the maximum z-coordinate the mover should be able to move to
  • "min_height" similar
  • "step" the amount of doom units the mover should move once a button is pressed

 

Ah theres the problem, in your map example you had just "scriptobject" with no "_" and thats what was messing it up. Thank god it was only a small typo, Problem solved now thanks!

Edited by Goldwell
Link to comment
Share on other sites

Ah theres the problem, in your map example you had just "scriptobject" with no "_" and thats what was messing it up. Thank god it was only a small typo, Problem solved now thanks!

Corrected, sorry :(

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

Hey, this is a heartfelt shoutout to everyone who's answered questions for me here in this thread. It's been a great help. We're down to the nit-pickiest of stuff in beta testing for my FM, so it should be out any day now. And while I'm not planning at stopping at only one FM, it will likely be several months before I jump back in on another project, so it'll be a while before coming back here for aid. :-)

Edited by Digi
  • Like 3

"Fancy burricks are afraid of dogs, if they encounter each other the dog barks and the burricks poop." - Thief: Deadly Shadows Game Designer

Link to comment
Share on other sites

This scripting stuff is great - the description on the wiki was just enough to get things rolling and the first thing I did was to make that self-repeating sea on a spline (thanks Stumpy, although I used 'thread' at the end to make it loop because it wasn't clear to me how to use while(1) )

 

Then straight after that I went on to make an ending cutscene (I try to be dramatic - and it has only one rather... unusual actor) with what I see as not so short a script to play it from. However, the func_cameraview and the func_teleport don't seem to like each other a lot and have a habit of dealing 5,000,000 damage to me. I've managed to solve most of these by putting in a short delay between them, or putting them in different threads. But when I was about to call the cutscene fully finished, I made a patch that you get teleported on to larger and then the problem came back there. I made sure the teleporter isn't inside the patch. Strange. I was wondering, are there some rules with using teleporters/cameras together, such as that they need to be in the same leaf?

 

Other than that, there are only small things left. I need to put some loot around the place and in the chests. I'd like to reskin that animated pirate flag (I don't want this to be a pirate ship after all). Make sure the objectives work properly. That sort of stuff.

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

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 5 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...