Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Nevermind, I solved by myself the sitting problem: Corner -> Turn -> Sit with a sit_down_angle.

 

Instead, I wanted to ask: How can I create the effect of a light beam from a window?

(I have in mind the beams in Sotha's TP6, on the wooden stairs of the manor's towers; I tried to get a look at them in the map, but they are func_statics)

Edited by Netos
Link to comment
Share on other sites

You can examine/edit the individual brushes and patches on a non-model func_static by cycling through them with Tab. (Or revert them to worldspawn via the right-click menu.) Middle-clicking to copy their shaders works too.

I don't know offhand what Sotha used, but there are moving light ray materials under textures/darkmod/sfx. There are also tdm_moon_rays particle effects.

Recently I've been playing with "deform tube" shaders, which can be nice so long as the player can't reach them (they pivot around the patch's lengthwise axis to follow your view instead of being obviously flat, so if you get close to intersecting them and look down them lengthwise they pivot wildly). Here's a "deform tube" adaptation of the light ray texture; if you want to try it out, apply it to a rectangular patch, convert to func_static and colour it with "_color":


sunbeams.jpg
sunbeams2.jpg


textures/darkmod/sfx/sunbeam // Just the name I used for testing; these should work fine for moonbeams with a suitable "_color"
{

	qer_editorimage textures/darkmod/sfx/light_rays_ed
	twoSided
	translucent
	noshadows
	nonsolid
	noselfshadow
	deform tube

	{
		blend add
		map textures/darkmod/sfx/light_rays
		colored
	}


}
Edited by VanishedOne
  • Like 3

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

How do you get a particle to spawn and play from the start of the particles animation.

 

I have everything setup to spawn mine_cloud.prt however when I hit my button hooked upto it I find that sometimes it works, sometimes it doesn't, sometimes it starts halfway through the particle animation, sometimes it starts from the start.

 

I have tried creating a func_emitter with the "start_off" spawnarg turned on and I have tried spawning a fresh particle using the stim & response system but both seem to have bad luck.

 

What I was expecting to happen was when I press the button the particle mine_cloud.prt spawns and plays through once and then stops.

Link to comment
Share on other sites

How do you get a particle to spawn and play from the start of the particles animation.

This is a bug that's been fixed for 2.04, http://bugs.thedarkmod.com/view.php?id=3945

 

In the meantime you could use the world particle system and a script to get the same effect. See the "natural timing" section on the wiki for an example script. If you need any help setting it up, give me a shout. http://wiki.thedarkmod.com/index.php?title=World_Particle_System

  • Like 1
Link to comment
Share on other sites

This is a bug that's been fixed for 2.04, http://bugs.thedarkmod.com/view.php?id=3945

 

In the meantime you could use the world particle system and a script to get the same effect. See the "natural timing" section on the wiki for an example script. If you need any help setting it up, give me a shout. http://wiki.thedarkmod.com/index.php?title=World_Particle_System

 

Seeing as its fixed in 2.04 I could just leave the current implementation in and it should work right? where it gets triggered and plays from the start?

 

Also is there an ETA on 2.04 yet?

 

Thanks Steve!

Link to comment
Share on other sites

We honestly don't know when 2.04 will be out -- we're still adding issues to the roadmap rather than winding it up -- but you can of course leave it and fix it later only if you need to :)

 

It did occur to me that a simple func_smoke might work. I've not tried it and can't remember from when I did that fix whether they use the same broken mechanism, but it could be worth a try. Just change entity type of your emitter to func_smoke and rename the "model" spawnarg to "smoke" if you want to try it.

Link to comment
Share on other sites

The Readable Editor is the bottom item under the 'Entity' heading in the top menu, under stim/response. Are you sure you're using the top menu (not the 'create entity' menu you get right clicking) and have the latest DR version?

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

You don't have stim/response either, which makes it look like the bottom 2 items are getting chopped off.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Earlier, I was having a rather strange performance issue (it seems to have gone away now), which I will explain in detail below:

 

After careful reflection, I decided that I wanted to modify the way the player enters the grand library in my WIP (shots of it can be seen in the "What are you working on..." thread). All this entailed was simply removing two side doors and replacing them with a large single door in the center of the wall.

 

So, after this process is complete, I boot up TDM, dmap and load in the mission. Everything seems fine as I'm getting 60FPS running around the area. Then, I decided to leave the library and go explore the rest of the map. When I came back, I was suddenly only getting around 30FPS and lower in the library area. I restarted the mission, except this time I was only getting 30FPS in the area from the very beginning.

 

After some head scratching and double-checking my map for any internal leaks, I went back and dmapped and this seems to have solved the problem.

 

Any ideas as to what might have gone wrong initially?

Edited by Dunedain19
Link to comment
Share on other sites

It sounds like you have vsync on, which means the perf difference could have been very small, and possibly due to something unrelated that your machine was doing at the time. With vsync on, your fps will drop to 30 if it can't manage a full 60. With vsync off, you might have seen 55 in that spot.

 

There are loads of things that could have caused the drop in the first place: doors left open, AI doing different stuff, a pile of settling objects somewhere. But you ruled out most of them when you reloaded the map, which makes me wonder if this was a subtle drop magnified by vsync.

Link to comment
Share on other sites

I've been trying to get my priest's attack to do extra damage to undead.

 

It's adapted from the mages' melee attack, so it uses the `melee` frame command with a damage def.

 

"damage_mult_undeadbone" and "damage_mult_undeadflesh" didn't seem to make any difference (possibly because no weapon's involved for collision purposes?).

 

That leaves me wondering whether there's a way to apply a holy stim (and give the priest a def_damage so it actually does something to undead). I've been trying to apply the stim via script with an `object_call` frame command, but I don't know how to get an AI's current attack target in order to apply the stim to it; promisingly named functions like getEnemy() and getAttacker() aren't returning any entity.

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Yes, the melee frame command calls script event attackMelee(), which checks whether your AI's current weapon can reach an enemy.

 

I've been trying to apply the stim via script with an `object_call` frame command, but I don't know how to get an AI's current attack target in order to apply the stim to it; promisingly named functions like getEnemy() and getAttacker() aren't returning any entity.

I don't know why getEnemy() isn't working.

 

One way to do this would be to use the projectile system, which can also be controlled via a frame command, but that's only really suitable if your priest is throwing a fireball.

 

Using your script is probably best anyway because it'll give you maximum control over how it works. Projectiles, the melee frame command, and other attack methods all end up doing a trace in the background to find out what will get hit by the attack. You can do your own trace in a script, tracing out from the priest's hands to see what gets hit.

 

I can never resist messing with stuff like this, so here's an example. The script fires out 5 lines from roughly where the AI's hands would be, with the first line going straight out, and the others spreading out in a pyramid shape. It stops when one of the lines hits an AI and reports which AI got hit.

 

You can set a spawnarg "debug_fire" on the casting AI which'll make the trace lines be drawn in game so you can see what's going on. I added a test function so that you can fire this up as a main map script, and it'll show the lines on screen as the AI walks around (the AI is called $priest in my example). WHen the trace hits something, a message will appear on the console. You can use console command con_noprint 0 to be able to see console messages while the console is hidden.

 

 

 

// Constants for the range and diameter of the fire effect.
#define BLAST_RANGE 150  // units
#define BLAST_SPREAD 50  // units
#define BLAST_VALID_TARGETS CONTENTS_BODY // What should get hit. CONTENTS_BODY = AI & Player

entity findBlastTarget( entity caster )
{
    // Return an AI hit by the holy fire
    
    // Work out where the start and end points are
    vector startPoint = caster.getOrigin() + '0 0 50'; // Approx position of hands
    vector blastDirection = caster.getAngles(); // Which way caster is facing
    vector endPoint = startPoint + sys.angToForward( blastDirection ) * BLAST_RANGE;
    vector spreadX = sys.angToRight( blastDirection ) * ( BLAST_SPREAD / 2 );
    vector spreadY = sys.angToUp( blastDirection ) * ( BLAST_SPREAD / 2 );
    vector endPoint1 = endPoint + spreadX;
    vector endPoint2 = endPoint - spreadX;
    vector endPoint3 = endPoint + spreadY;
    vector endPoint4 = endPoint - spreadY;
    
    // Draw debug lines if requested
    if ( caster.getBoolKey("debug_fire") )
    {
        sys.debugArrow('1 0 0', startPoint, endPoint, 1, 0.016);
        sys.debugArrow('1 0 0', startPoint, endPoint1, 1, 0.016);
        sys.debugArrow('1 0 0', startPoint, endPoint2, 1, 0.016);
        sys.debugArrow('1 0 0', startPoint, endPoint3, 1, 0.016);
        sys.debugArrow('1 0 0', startPoint, endPoint4, 1, 0.016);
    }
    
    // Do the traces
    float traceLength;
    traceLength = sys.tracePoint(startPoint, endPoint, BLAST_VALID_TARGETS, caster);
    if ( traceLength < 1 ) { return sys.getTraceEntity(); }
    traceLength = sys.tracePoint(startPoint, endPoint1, BLAST_VALID_TARGETS, caster);
    if ( traceLength < 1 ) { return sys.getTraceEntity(); }
    traceLength = sys.tracePoint(startPoint, endPoint2, BLAST_VALID_TARGETS, caster);
    if ( traceLength < 1 ) { return sys.getTraceEntity(); }
    traceLength = sys.tracePoint(startPoint, endPoint3, BLAST_VALID_TARGETS, caster);
    if ( traceLength < 1 ) { return sys.getTraceEntity(); }
    traceLength = sys.tracePoint(startPoint, endPoint4, BLAST_VALID_TARGETS, caster);
    if ( traceLength < 1 ) { return sys.getTraceEntity(); }

    // Nothing was hit
    return $null_entity;
}

void test_fire_trace()
{
    $priest.setKey("debug_fire", "1");
    while (1)
    {
        entity targ = findBlastTarget( $priest );
        if ( targ != $null_entity )
        {
            sys.println("Fire hit " + targ.getName());
        }
        sys.waitFrame();
    }
}

void main()
{
    thread test_fire_trace();
}

post-29566-0-54819300-1440664134_thumb.jpg

Link to comment
Share on other sites

Thinking about it more, that script isn't quite doing the right thing. Its traces collide only with AI (or the player) which is convenient way to find out if an AI got hit, but because it doesn't collide with anything else, it could pass straight through solid walls and hit an AI on the other side.

 

A better version would use CONTENTS_SOLID instead of CONTENTS_BODY to collide with anything solid, then test if what got hit was an AI. If not, it'd go and do the next trace, as before.

Link to comment
Share on other sites

Here's the fixed bit. I daren't try to edit my post above. I'm stuck on the world's weakest and slowest mobile data connection this week.

 

 

 

 

// Do the traces
    float traceLength;
    traceLength = sys.tracePoint(startPoint, endPoint, CONTENTS_SOLID|CONTENTS_BODY, caster);
    if ( traceLength < 1 && sys.getTraceEntity().isType("idAI") ) { return sys.getTraceEntity(); }
    traceLength = sys.tracePoint(startPoint, endPoint1, CONTENTS_SOLID|CONTENTS_BODY, caster);
    if ( traceLength < 1 && sys.getTraceEntity().isType("idAI") ) { return sys.getTraceEntity(); }
    traceLength = sys.tracePoint(startPoint, endPoint2, CONTENTS_SOLID|CONTENTS_BODY, caster);
    if ( traceLength < 1 && sys.getTraceEntity().isType("idAI") ) { return sys.getTraceEntity(); }
    traceLength = sys.tracePoint(startPoint, endPoint3, CONTENTS_SOLID|CONTENTS_BODY, caster);
    if ( traceLength < 1 && sys.getTraceEntity().isType("idAI") ) { return sys.getTraceEntity(); }
    traceLength = sys.tracePoint(startPoint, endPoint4, CONTENTS_SOLID|CONTENTS_BODY, caster);
    if ( traceLength < 1 && sys.getTraceEntity().isType("idAI") ) { return sys.getTraceEntity(); }

 

 

Link to comment
Share on other sites

@Destined Holy water arrows apply the stim via the 'result' entity spawned when the projectile 'detonates'. What I have here is a melee attack with no weapon, so I don't know of anywhere to set a "def_result" spawnarg; though since I'm scripting anyway, I suppose I could spawn a stim-carrying entity in front of the priest. That would mean applying the stim within an area of effect rather than directly to a single target, but at least the visual effect makes that seem plausible.

My priest/exorcist does throw a quartet of blue-white holy fireballs instead of the ordinary fireball projectile, and their result is basically the holy water arrow's without the water, so he can annihilate undead at a distance. B)

@SteveL Gosh, thanks. You give such comprehensive answers.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

While dmapping, I get a leak error but in DarkRadiant, I don't see any red line after clicking point file. I already tried shutting down both TDM and DarkRadiant. Does anyone have a quick idea what could be the reason?

Link to comment
Share on other sites

This gives me what kinda reminds me of coordinates:

 

 

 

2560.000000 -2560.000000 -296.000000

3072.000000 -2797.867188 -64.000000

3095.000000 -2783.000000 -58.000000

edit: After deleting the file, it shows me the red line in DarkRadiant. :)

Sadly I have no idea where it points to... x(

Edited by Nico A.
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

    • 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.
      · 2 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
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...