Jump to content
The Dark Mod Forums
demagogue

Newbie DarkRadiant Questions

Recommended Posts

I become lazy %))) That why decide just ask for some options in DR:

 

1. Can I just copy texture from one brush to another with all properties?

 

2. Can I assign texture by poly for different textures by one brush?

 

3. Is there some magic lock for objects to avoid necessary movement/rotation of them, or only hide\show presents?

 

4. What for is texture lock if I still can adjusting size?

 

5. Offseting of texture is working only in poly mode or I'm doing something wrong?

Share this post


Link to post
Share on other sites

I become lazy %))) That why decide just ask for some options in DR:

 

1. Can I just copy texture from one brush to another with all properties?

 

2. Can I assign texture by poly for different textures by one brush?

 

3. Is there some magic lock for objects to avoid necessary movement/rotation of them, or only hide\show presents?

 

4. What for is texture lock if I still can adjusting size?

 

5. Offseting of texture is working only in poly mode or I'm doing something wrong?

 

I can answer a couple of these

 

#1 The easiest way to do this is to press the middle mouse button while hovering the mouse icon over the texture you want to copy and then press CTRL + Middle Mouse Button on the surface face you wish to paste to. If that doesn't work try this: hold down CTRL+SHIFT and click on the surface you wish to copy from and it should select just that face of that brush then click EDIT --> Copy Shader then select the surface where you want to paste it using CTRL+SHIFT and then go EDIT --> Paste Shader

 

#4 Texture lock just locks the texture to the brush you're highlighting so when you move it around it doesnt move the texture. If you want to see the full effects of it highlight a brush and turn texture lock off and move it.. you will see that the texture moves as you move the brush around.

Edited by Goldwell

Share this post


Link to post
Share on other sites

In every 3d program is parent-child link, is something similar in DR? For example - I want to create treasure chest, and want to make central key lock, and 2 lock on sides, is it possible to link side-locks to top of chest, that, when open chest, side-locks move with top?

Share this post


Link to post
Share on other sites

Bind is what does that.

  • 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

Share this post


Link to post
Share on other sites

Where I can find lit of class functions for objects? For example:

Want to make that head in gramophone rotating to center of disk, and when arrived to some position stops the gramophone and return to base position. I understand for this event I need to write check position cycle until it reached defined angle or coordinate of rotation and then call stop function...

Can't find in wiki any list of functions with disclaimer for scrips...

Share this post


Link to post
Share on other sites

the document you need is in tdm_base.pk4 path in zip file script/tdm_events.script its a text file can be read by notepad or wordpad.

 

basically use $<nameofentity>.getWorldOrigin(); to read origin of entity

 

and $<nameofentity>.setWorldOrigin(); to move entity around without using teleports.

Edited by stumpy
  • Like 1

Share this post


Link to post
Share on other sites

There's a copy of the script reference (same as that file) on the wiki: http://wiki.thedarkm...cript_Reference

 

setOrigin() probably isn't the function you want. It moves the entity in an instant, with no transition time or rotation. For your gramophone arm, you probably want to make it a mover_door entity, move its origin to the pivot point (go into vertex editing mode to do that with the entity selected), and set the spawnargs so it rotates the right amount and in the right direction. Then it'll move naturally and you can trigger it to open or close with any of the methods you can use for a door.

 

I will happily help you set this up if you want to send me the test map. The problem with answering your question in the forum is that the right answer could be different depending how it's set up already...

Edited by SteveL

Share this post


Link to post
Share on other sites

I have two questions:

 

1.) How do I add particles? (I want that a certain item is glowing or something) (I found out that you can attach particles and this works for me)

 

2.) I added some AIs and I want some of them to sleep and some of them to sit. I used path_wait and path_sleep for that (Added target PATH_NAME) and i placed path_sleep/wait where i want the AI to sleep/sit.

Somehow I have the issue, that the AIs sit or sleep whereever they want to. They don`t use the bed/chair for it. What did i forget?

Edited by Wilcon

Share this post


Link to post
Share on other sites

I want to use .rotateUpTo(axis, angle) function and still can't find any description with examples for using axis.. try numeric, try x,y,z - script doesn't work.. How it must looks to work?

Share this post


Link to post
Share on other sites

there's func_splinemover for paths and angles, which is a path for func_mover to slide and turn along but it has to be done via scripts. but the only tutorial for it was on doom3world.org and that site is off line indefinately, you could take apart the temple rooms in my blackbog hollow map, and the script that goes with it to figure out how it all works, and you might be able to use that for a spining head on a gramophone. there the script command sys.waitFor($<name>); which waits for a object to finish doing something before going on to the next line of script, so if the spline finishes at a certain point in space then when the object on the spine gets there it will then move onto the next part of the script.

  • Like 1

Share this post


Link to post
Share on other sites

2.) I added some AIs and I want some of them to sleep and some of them to sit. I used path_wait and path_sleep for that (Added target PATH_NAME) and i placed path_sleep/wait where i want the AI to sleep/sit.

Somehow I have the issue, that the AIs sit or sleep whereever they want to. They don`t use the bed/chair for it. What did i forget?

 

 

Whenever you have a path_sleep entity the AI will goto sleep at whatever location the previous path entity is, they don't goto sleep at the location of the path_sleep entity. So just create a path_corner right next to the bed that is targeting a path_sleep entity, that way the AI will walk to the path_corner and then they will lay down and goto sleep.

Edited by Goldwell

Share this post


Link to post
Share on other sites

Whenever you have a path_sleep entity the AI will goto sleep at whatever location the previous path entity is, they don't goto sleep at the location of the path_sleep entity. So just create a path_corner right next to the bed that is targeting a path_sleep entity, that way the AI will walk to the path_corner and then they will lay down and goto sleep.

 

Mh, i already tried that out. I will try it again! ;-)

 

EDIT: I tried it out, but I cannot get it to work

Edited by Wilcon

Share this post


Link to post
Share on other sites

So, because Thief 4 made such a great impression on me because of reasons, I would temporarily like to prevent the player from jumping and mantling. Is this possible without high-tech, high-effort scripting wizardry?


Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Share this post


Link to post
Share on other sites

Are there specific places where you want to disallow mantling, or is this something that just turns off for a while, then turns back on?

 

And do you mean the separate acts of "jumping" and "mantling" or are you talking about the single act of "jumping up and mantling"?

Share this post


Link to post
Share on other sites

I see no existing simple way to turn off jumping or jumping/mantling.

 

There is code that will turn these off and on, but there's no mechanism to get at it via scripts.

Share this post


Link to post
Share on other sites

My first thought is simply put playerclip overhead, so jumping is inhibited. You'd have to teleport it away if you wanted to enable jumping there later.

 

There is the "is_mantleable" spawnarg. If you wanted to change that to subsequently be able to mantle there, you'd teleport in a different object.


"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

Share this post


Link to post
Share on other sites

Thanks for your responses! And yeah, I want to turn off both mantling and jumping for a time. RJFerret's solution seems doable...


Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Share this post


Link to post
Share on other sites

Is there a convenient way to "touch" an entity, so it settles with physics?

 

Context is I want a script to spawn entities, move their origin to approximately the right point but in mid-air, then "nudge" them so they fall to the ground. I've tried activating the newly moved object but no joy.

 

EDIT: I found my answer: activating the entity works as long as you wait at least one frame to do it after spawning and moving it. Now I just need to figure out a way to stop certain awkward entities twitching and bouncing round forever after they fall.

Share this post


Link to post
Share on other sites

Is there a convenient way to "touch" an entity, so it settles with physics?

 

Context is I want a script to spawn entities, move their origin to approximately the right point but in mid-air, then "nudge" them so they fall to the ground. I've tried activating the newly moved object but no joy.

 

EDIT: I found my answer: activating the entity works as long as you wait at least one frame to do it after spawning and moving it. Now I just need to figure out a way to stop certain awkward entities twitching and bouncing round forever after they fall.

 

There's an outstanding bug that small moveables might bounce around a lot when they try to settle on a surface.

 

Rather than letting physics drop the object, try setting the "nodrop" spawnarg on the object to "0". (It means "after spawning, place the object on the floor".) That's supposed to be the default for moveables, but maybe there's an issue with spawning objects from a script when that flag isn't explicitly set.

Share this post


Link to post
Share on other sites

Thanks, though I didn't get it to work in this spot. I confirmed the "nodrop" spawnarg floors the entities ok if added as a spawnarg in DR, but if you add the key to an entity after spawning it, it doesn't have any effect after the setOrigin(). That may be one of those spawnargs that only takes effect during initialization of the object, so for a script-spawned object you'd need to set it in the entityDef as you can't set a key prior to the spawn event. I should have mentioned, I want this script I'm fiddling with to work for any object, not just ones where I can provide a bespoke entityDef. I'll shelve it for now -- plenty of other workarounds to try -- but if desperate I'll try fixing the bouncing in the script.

 

Question 2 for this evening: is there any easy way to suppress the "plunk" sound when the player gains an inventory item? You can add a spawnarg to the item to suppress the HUD message when it's added to the inventory (inv_no_pickup_message, and that one *does* work when added some time after spawning by a script), but I haven't spotted a way to disable the sound. NB in my spot it would be acceptable to disable all sounds and messages for a time, if that's easier.

 

EDIT: Transferring control to a camera at the player's eye position and viewangle works to suppress the HUD, but it's a bit hackish and drastic, and it's noticeable if the player happens to be moving as there's a brief freeze. Are there better ways to do it?

Share this post


Link to post
Share on other sites

Thanks, though I didn't get it to work in this spot. I confirmed the "nodrop" spawnarg floors the entities ok if added as a spawnarg in DR, but if you add the key to an entity after spawning it, it doesn't have any effect after the setOrigin().

 

Set it before the spawn.

 

For example, from Home Again, here's the script to spawn a guard near the mission's end:

 

void SpawnSewerMan()
{
sys.setSpawnArg("skin","citywatch/poor_ragged");
sys.setSpawnArg("def_attach5","atdm:prop_lantern_on");
sys.setSpawnArg("pos_attach5","hand_l");
sys.setSpawnArg("acuity_aud","0");
sys.setSpawnArg("acuity_vis","0");
sys.setSpawnArg("name","SewerMan");
ai sewerMan = sys.spawn("atdm:ai_citywatch");
sewerMan.setOrigin($SewerManSpawnSpot.getOrigin());
sewerMan.addTarget($SewerManWalksToHere);
}

 

So you'd want the following line before your sys.spawn() line:

 

sys.setSpawnArg("nodrop","0");

 

Question 2 for this evening: is there any easy way to suppress the "plunk" sound when the player gains an inventory item? You can add a spawnarg to the item to suppress the HUD message when it's added to the inventory (inv_no_pickup_message, and that one *does* work when added some time after spawning by a script), but I haven't spotted a way to disable the sound. NB in my spot it would be acceptable to disable all sounds and messages for a time, if that's easier.

 

Set this spawnarg on the item:

 

"snd_acquire" "silence"

 

 

EDIT: Transferring control to a camera at the player's eye position and viewangle works to suppress the HUD, but it's a bit hackish and drastic, and it's noticeable if the player happens to be moving as there's a brief freeze. Are there better ways to do it?

 

Explain the effect you want when you say "suppress the HUD". Hide everything?

  • Like 1

Share this post


Link to post
Share on other sites

I didn't know about setSpawnArg()! That solves pretty much everything.

 

Yes, I meant hide the entire HUD and all associated sounds (i.e. sounds that are "internal" to the player like "snd_acquire"). Basically the effect you'd get with the camera method above. I probably won't need to now I have that scriptevent to hand. Actually, is hiding the HUD possible?

Share this post


Link to post
Share on other sites

Actually, is hiding the HUD possible?

 

There is no single method of hiding all HUD elements.

 

There's a cvar you can use to turn the HUD off, but you shouldn't use it for this purpose. I believe it's mainly a convenience for taking snapshots. If you try to control it via a script, it'll come back and bite you when you save games and/or exit the mission and start another.

 

I learned all this the hard way when working on the special sequence in Cleighmoor. Every HUD element has to be handled separately. Some can be taken out simply by turning them off, then back on. Others you can turn off, but player actions can cause them to be turned back on, so you have to work a bit harder at keeping them off.

 

Feel free to take a look through the script file for that mission.

Share this post


Link to post
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.


×
×
  • Create New...