Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Newbie here! Was just wondering how you merge different brushes into a single brush(?) or model or what it's called? I've tried using CSG Merge but all it says is "CSG Merge: Failed - result would not be convex."

 

Brushes must be rectangular boxes, or anyway n-sided closed polygons (like cylinders or D&D Dice), where nothing is sticking out. That's what the "convex" part means. All the angles are "inward" (less than 180 deg measuring the inner side) and an angle "outwards" (more than 180 deg) is forbidden. So if there's any part of it that looks like an "L" shape, with some part sticking out, that's concave and it can't be a brush. You have to use two brushes for that, one for the | part and one for the _ part. Long story short, if you can merge two brushes, you can just make one brush the same size & shape as the merged one, so just make that.*

 

It depends on why you want to do this, but one thing you might be thinking about is linking brushes together with the "group selection", then you can easily select them simultaneously and work with them as a group, or something like that. That may be what you're actually after.

 

*Edit: You can imagine cases where you really need brush merge to make a shape, like the 8 sided D&D dice. You can make two 5-sided pyramids/prisms (4 triangle sides & a square base), and then stick the bases together top-to-bottom and merge them to make the 8-sided dice shape. It's convex so still a valid brush, but you couldn't make it naturally as a single brush any other way (I think). That's an example of what it's really for, which is really a kind of special case.

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

 

Brushes must be rectangular boxes, or anyway n-sided closed polygons (like cylinders or D&D Dice), where nothing is sticking out. That's what the "convex" part means. So if there's any part of it that looks like an "L" shape, with some part sticking out, that's concave and it can't be a brush. You have to use two brushes for that, one for the | part and one for the _ part. Long story short, if you can merge two brushes, you can just make one brush the same size & shape as the merged one, so just make that.

 

It depends on why you want to do this, but one thing you might be thinking about is linking brushes together with the "group selection", then you can easily select them simultaneously and work with them as a group, or something like that. That may be what you're actually after.

 

 

 

Ahh alright thanks! I was making a simple custom door. Nothing too bad just a rectangle with a couple rectangles attached to it.

Edited by Ataire
Link to comment
Share on other sites

Though messing with the CSG tool I don't think using it really helps me cause I still don't know how to use it @-@. I was thinking more of how I could merged brushes into a single entity or model that I could apply properties to. And grouping things don't really help cause I can't add them (unless there is a way?).

Link to comment
Share on other sites

If you want to create a door, just draw a brush, right-click on it and select "Create entity". There you can go to movers and find the door entity. If you want to attach stuff to the door (like handles), you can do this with the "link" spawnarg. You can find everything you need for that on the Doors Wiki page, but if oyu are just starting, I would recommend to start off with existing assets, as this is much easier to get into than creating your own ones. I would also recommend the A-Z tutorial. It is a bit dated at times, but it is a great start to get inot mapping. Or try to watch and follow Springheel's video tutorials in the New Mapper Workshop. They are also great to get a first grip on everything.

Link to comment
Share on other sites

If you want to create a door, just draw a brush, right-click on it and select "Create entity". There you can go to movers and find the door entity. If you want to attach stuff to the door (like handles), you can do this with the "link" spawnarg. You can find everything you need for that on the Doors Wiki page, but if oyu are just starting, I would recommend to start off with existing assets, as this is much easier to get into than creating your own ones. I would also recommend the A-Z tutorial. It is a bit dated at times, but it is a great start to get inot mapping. Or try to watch and follow Springheel's video tutorials in the New Mapper Workshop. They are also great to get a first grip on everything.

 

 

Ahh thanks ^^ no worries I've got the A-Z tutorial and the door guide open. The problem was just the Door wiki mentioned merging using CSG tool or the clipping tool (but never specified how to use them) right before how to add atdm:movers_door so I though you had to merge them first before you could add the movers.

Link to comment
Share on other sites

Newbie here! Was just wondering how you merge different brushes into a single brush(?) or model or what it's called? I've tried using CSG Merge but all it says is "CSG Merge: Failed - result would not be convex."

The warning expresses the issue here pretty clearly. idTech 4 relies on brushwork to be convex because the algorithms used requiere the data to be in that. In a convex set the straight line connecting two randomly choosen points inside is always inside the set. This is an important and powerful mathematical property that can be and is used to create more effective algorithms.

 

But as stated above the default way to achieve what you wanted to is a different one anyways. Merging brushes is something that one normally doesn't use all to often during mapping.

 

The clipper tool does the exact oppossite. It is intented to cut brushwork via a plane by either specifying two points of the plane which will then extent into the direction you are currently looking at in 2D view or by specifying three points of said plane, which allows you to cut a brush via a plane that isn't orthogonal to any of the three coordinate axes. The latter usage is often confusing for many mappers from what I've read here over the years, although it is hard to tell why. You have to test it on your own to see if you can handle it.

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 back learning camera stuff, studying Grayman's tutorial. While he did stationary and moving cameras, and also stationary cameras following a moving target, I can't find a case where a moving camera follows stationary object. It seems like using target_null doesn't work, i.e. it sets the initial orientation, but the camera doesn't stick to it, as it moves along the spline.

I tried using Grayman's method of following the guard with stationary camera, i.e. using the target_setkeyval to update the camera to use target_null every frame, but I get an error at the line where the thread for camera update is used, the error says "unknown value update_cam1":

void cs_cam1()
{
sys.println("Roll1 running"); // debug
$player1.bind($mover1);
$cam1.activate($player1); // Switch view
thread update_cam1(); // Call the function update_cam1() as a thread so it can run in parallel
$mover1.time(15); // How many seconds it will take to move along the spline
$mover1.accelTime(1); // How long it takes to accelerate
$mover1.decelTime(1); // How long it takes to slow down
// $mover1.disableSplineAngles(); // Allow the camera to point in different directions as it follows the spline
$mover1.startSpline($spline1); // Start the func_mover $mover1 moving
sys.waitFor($mover1); // Wait for $mover1 to finish its movement
$player1.unbind();
sys.killthread("aim_loop1"); // Kill the thread "aim_loop1"
$cam1.activate($player1); // Return control to the player
}

void update_cam1()
{
sys.threadname("aim_loop1"); // Gives this thread the name "aim_loop1" so it can be killed later.
while (1)
{
sys.trigger($target_setkeyval_1); // keep cam1 pointed at target_null_1
sys.waitFrame(); // wait a frame before continuing
}
}

Edited by Judith
Link to comment
Share on other sites

Yeah, you can only refer to variables and functions that are already defined. Or in other words: before you tell the code what to do with the hammer, you need to tell it what a hammer is ;)

  • 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

Signs

 

 

I want to include some signs:

 

post-37993-0-73496700-1533230189_thumb.jpg

 

How can I center the text?

 

 

Objectives

 

In the meantime, I have added three critical objects (steel xyz) for mission success. After completion of two objects in any order, the third cannot be finished. The console reports "Item xxx cannot be picked" (or something like that). What can I do to fix this?

 

 

Custom Sound

 

How can I add my own ambient sound files (stuff written and performed exclusively by myself) to the mission?

 

If I add my own files to the relevant pk4 files of the Mod, the entire folder is not recognized anymore. If I add a new folder to my mission map folder I cannot select the file via DR.

 

I want to replace the main menu music as well (although the original theme is great) with my own file. How can I do that?

 

 

Diving into water creates display errors

 

As always, you can't reproduce the problem when you want to show it:

 

If the player dives into water, sometimes the screen freezes, but shows a small window in the lower left corner where "the action" takes place. If one returns to the water surface, everything reverts to normal. How can I fix this?

 

 

Ambient Light does not work

 

After adding the relevant parameters to the info entities as per graymans suggestion (ambient light dynamic_000) everything worked well, but now, sometimes the ambient does not work.

 

For example:

 

Try #1: dmap and map xxx: ambient light off

Try #2: dmap and map xxx: ambient light on

 

Is there something I can do about this?

 

Many thanks for your help in advance,

JF

Edited by JackFarmer
Link to comment
Share on other sites

Objectives: make all objectives from the start - it is tedious but can help.

 

sound: I assuming you have text file with your_sounds.sndshd extension

 

jf_ambient
{
editor_displayFolder jf_sounds

minDistance 20
maxDistance 24
volume 20

sound/ambient/jf_ambient1.ogg
}

 

in sound folder

 

ambient light: it by default adjusts its colour to visible lights, I don't remember well but maybe in info_location entity you have to change ambient_light_dynamic values.

S2wtMNl.gif

Link to comment
Share on other sites

Objectives: make all objectives from the start - it is tedious but can help.

 

sound: I assuming you have text file with your_sounds.sndshd extension

 

jf_ambient

{

editor_displayFolder jf_sounds

 

minDistance 20

maxDistance 24

volume 20

 

sound/ambient/jf_ambient1.ogg

}

 

in sound folder

 

ambient light: it by default adjusts its colour to visible lights, I don't remember well but maybe in info_location entity you have to change ambient_light_dynamic values.

 

Hello ERH+,

 

Thanks for your prompt response.

 

What do you mean with "from the start"? I can only find "Satisfied at start". I have tried that, but it does not work.

 

---------------

 

"sound: I assuming you have text file with your_sounds.sndshd extension"

 

 

Errr..no, I do not have. What does that mean in detail?

 

Many thanks for your help,

JF

Link to comment
Share on other sites

It's the same as with textures and materials; textures don't work by themselves, you need material file with definitions to tell the engine how to make a surface out of them. Same with sounds.

 

If you want to replace anything there is in TDM, you need to mimic TDM folder structure and file names in your fm folder. You can see how paths look like either in editor or inside p4k packages. Or, you can unpack them all to have direct access to all assets and directories (remember to delete pk4s afterwards).

  • Like 1
Link to comment
Share on other sites

 

What do you mean with "from the start"? I can only find "Satisfied at start". I have tried that, but it does not work.

 

Do whole objectives list again.

Save map under new name, delete atdm:target_addobjectives, and start writing objectives from clear start.

You can open second darkradiant and look at previous build, and even edit/copy edit/paste selected elements between two open darkradiants (upper menu).

Edited by ERH+
  • Like 1

S2wtMNl.gif

Link to comment
Share on other sites

to center text in a gui add

 

textalign 1

 

directly to the gui, I don't know how to do it in the editor

// textalign 0 = left 1 = middle 2 = right

 

eg

windowDef Desktop
{
rect 0, 0, 640, 480

windowDef PigSignFour
{
rect 20, 40, 600, 440
textalign 1
textscale 2
text "#str_21363"
font "fonts/stone"
forecolor 0.2, 0.2, 0.2, 1
visible 1
}
}

  • Like 1
Link to comment
Share on other sites

Hello Judith & ERH+,

 

That worked! For the first time I am able to include custom sounds to my map and the sounds are now also visible in DR. Thanks a lot for that! *greatpersonalvictory* :)

 

Stumpy, I will give your suggestion a try as well and will revert to you.

Link to comment
Share on other sites

  • 2 weeks later...

Is there a way to teleport all entities within a volume?

 

My intended usage is to secretly teleport the player between two areas, giving the illusion that the two are physically connected. If the player drops moveables into the transition area they should be moved as well to maintain the illusion.

Link to comment
Share on other sites

There's no direct support for doing this, but you can achieve what you want using a script and a couple extra entities.

 

Anything that's not part of the scenery, like ragdolls, spent noisemakers, moveables, AI, the player, etc. would all need to go.

 

I think this has been done before, but I couldn't tell you where.

 

On the hope that someone will pop in and describe how they handled this, I'll refrain from providing what might be an alternate solution. Best to use what someone else has already implemented, since it's already been tested.

Link to comment
Share on other sites

Something just occurred to me which might be the alternative method you had in mind? Frobblock entities already work in a similar way, so if their effect was changed to no longer alter frobability and instead apply an origin offset that might be all that's needed.

 

An immune_to_massteleport spawnarg would refine it but is maybe not strictly necessary. Teleporting the scenery as well would cut down on map size...

 

Teleporting active AI might be problematic because they'd most likely be busy pathfinding towards a position in the old area.

Link to comment
Share on other sites

It kind of depends on the purpose of such teleportation, but if you want to save yourself trouble, place the volume and the teleport in narrow area, e.g. in a vent. AFAIR, you have to link entities you want to teleport, so stuff like player inventory won't work. I only used that stuff for performance reasons, like I had a mansion in the woods, and I wanted the player to be teleported inside while frobbing a door, Oblivion-style.

Link to comment
Share on other sites

After a little research, it looks like the send area needs to be wrapped in a trigger_touch that starts disabled.

 

When the player teleports, record his 'from' location, stored on the player entity using a new spawnarg key, or saved in the map.script file as a global variable.

 

When he lands, record his 'to' location the same way.

 

He lands inside a trigger_once, which enables the trigger_touch.

 

The trigger_touch calls a script function that operates on each of its touching entities. This function calculates the delta from the player's 'start' location to the player's 'to' location.

 

Using the delta, the trigger_touch's script function moves each touching entity to its new location.

 

The script function filters out entities not wanted in the move.

 

If AI are moved, use known methods for putting the AI on its new path.

 

At this point, that's my best guess for how to do this without new SDK support. I have NOT tested this.

Link to comment
Share on other sites

Just did some preliminary testing:

 

First of all it's excellent that trigger_touch works this way, including that it can pass on the name of the entity that entered its bounds. I've thrown some random objects into the brush volume and watched them get teleported away.

 

Also, the setup can just let teleport distance (delta) = i.e. 2048 in the x direction, albeit making the setup map-specific.

 

However, while trigger_touch can pass the activating entity's name, callscriptfunction seemingly can't. So this rules out the use of an ordinary script function.

 

Callobjectfunction does pass along entity names, so this looks like a promising route.Well, I lack experience in scriptobjects - after reading the wiki I implemented a simple scriptobject ingame ('delete crate1'). But as soon as I put any entity with this scriptobject into my testmap the crate is gone at mapstart...? The wiki unfortunately says nothing about how to use the scriptobject once written.

 

Edit: forgot to mention I also tried a 3rd option: letting the trigger_touch directly target a teleportation entity. This fell down flat because:

A ) func_teleport doesn't seem to support origin offsets

B ) atdm:teleport will only do offsets from its own origin, and not from the moveable's origin.

Edited by Dragofer
Link to comment
Share on other sites

First off, an atdm:target_callscriptfunction entity isn't needed. The call comes directly from the trigger_touch.

 

Try this:

 

Set these spawnargs on the trigger_touch:

 

pass_activator 1

call teleportationFunction

 

In your script file, create this function:

 

void teleportationFunction(entity touchingEntity)

{

string touchingEntityName = touchingEntity.getName();

vector touchingEntityOrigin = touchingEntity.getOrigin();

...

}

 

That should give you the entity, its name, and its origin. After that you can do your classname filtering (i.e. don't teleport func_statics), delta addition, and movement.

 

I don't think you need to get into scriptObjects.

  • 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.
      · 0 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...