Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

The light only gets casted on the water surface, it does not get reflected. (Light reflection is not done by most engines even nowadays as this is way too performance hungry, if you want such an effect you will have to fake 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

Check croudscroll

lights/cloudscroll
{


   {
       forceHighQuality
       map    lights/cloudscroll
       colored
       translate    time * 0 , time * -0.05
       //rgb        storm2table[ time * .1 ]

   }


}

translate moves it, and time is the current game time, so both together cause it to move over time.

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

The second line is commented out, you can ignore that. What you have to look at is translate A, B. This shifts the texture towards the u-direction by an amount of A and towards the v-direction by an amount of B. (uv is the planar coordinate system on the surface you use the texture on). Due to the usage of time this values change all the time, so you get the scrolling effect you are looking for.

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

 

 

//Author: Dram

textures/water_source/sea_wave_01

{

qer_editorimage textures/water_source/sea_wave_001

discrete

nonsolid

water

translucent

{

blend diffusemap

map textures/water_source/sea_wave_001

scroll time * ((( parm5 + 0.1) - (( parm5 || 0) * 0.1)) * -1.1) , -0.2 * sintable [ time * (( parm5 + 0.1) - (( parm5 || 0) * 0.1))]

scale 1.2, 1

rgb 0.6 - 0.4 * ( sintable [ time * parm5 * -2] )

}

{

blend diffusemap

map textures/water_source/sea_wave_001

scroll time * 0.06 , -0.2 * sintable [ time * (( parm5 + 0.1) - (( parm5 || 0) * 0.1))]

rgb 0.6 - 0.4 * ( sintable [ time * ((( parm5 + 0.1) - (( parm5 || 0) * 0.1)) * -2)] )

}

// TDM Ambient Method Related

{

if (global5 == 1)

blend add

map textures/water_source/sea_wave_001

scale 1.2 , 1

red global2

green global3

blue global4

}

{

if (global5 == 2)

blend add

program ambientEnvironment.vfp

vertexParm 0 1.2 , 1, 1, 1 // UV Scales for Diffuse and Bump

vertexParm 1 1, 1, 1, 1 // (X,Y) UV Scale for specular, Z: ambient reflection scale

vertexParm 2 global2, global3, global4, 1

vertexParm 3 0

fragmentMap 0 cubeMap env/gen1

fragmentMap 1 _flat // Bump

fragmentMap 2 textures/water_source/sea_wave_001 // Diffuse

fragmentMap 3 _black // Specular

}

}

 

 

And this is sea_wave01 material, it moves in both directions. How can I apply this bobbing movement to light texture?

S2wtMNl.gif

Link to comment
Share on other sites

scroll u,v

 

Similar to translate this moves the texture around. However, while translate expects the position as arguments, scroll takes the speed.

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

How do I trigger a script when I use a key to unlock a door? I've already tried used_action_script.

 

used_action_script doesn't work on doors unfortunately, as you found out (because they have their own use for it).

 

Someone might come along with a simpler method, but here's one way in the meantime. You can use the state_change_callback spawnarg on the door, which calls a script whenever the door is opened or closed or locked or unlocked. You want your script to fire the first time the player unlocks it, so you'll check the door is unlocked and closed and ignore other changes. There's a complication if AI use the door: when they've just closed it, it'll be unlocked and closed too, so to get around that you can have the script test that the player is next to the door with the key in their hand. Only if all the above check out, the script fires. It won't matter if the player still has the key in hand when they close the door, because the script fires only once and it'll already have gone off when the player unlocked it.

 

This is set up for a door with "name" = "special_door" and a key with "inv_name" = "A fancy key". The door also has spawnarg "state_change_callback" = "special_door_touched". this would go in your <mymap>.script file:

 

void special_door_touched(entity door, boolean bOpen, boolean bLocked, boolean bInterrupted)
{
if (   !bOpen
	&& !bLocked
	&& !( $special_door.getKey("already unlocked") == "true" )
	&& $player1.getCurInvItemName() == "A fancy key"
	&& sys.vecLength($player1.getOrigin() - $special_door.getOrigin()) < 128 // player is next to door
   )
{
	$special_door.setKey("already unlocked", "true"); // make sure we don't run this code again
	sys.println("state_change_special_door() fired!"); // console message for testing

	// *** Your code here ***

}  
}

 

Come to think of it, there's a chance that this could still fire when you don't want it to, if an AI closes the door while the player is standing next to it with the key in their hand. Anyone got any better ideas?

  • Like 1
Link to comment
Share on other sites

Is there a way to have an AI start the map with their weapon already drawn (but not alerted)?

 

Perhaps change the idle animation to the weapon drawn animation?

 

Or alternatively you could just bind a weapon to their hands. I know its possible to do with loot and keys so why not weapons?

Edited by Goldwell
Link to comment
Share on other sites

I need an invisible skeleton, but it should still cast shadows. I have to make custom texture, or .skin file? I checked "A night to remember" for its invisible head and ghosts, but I still don't know how to edit/ what to copy.

S2wtMNl.gif

Link to comment
Share on other sites

Take a look at requiem. The evil_being ai there uses a similar approach.

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

No. You have to sculpt something appropriate and texture it with textures/common/shadow, or use a projected light/shadow.

Link to comment
Share on other sites

If the shadows won't have to move, the most performant way would be paint your grate or leaves as a custom light texture. Then you can make it non shadow casting and just rely on the texture painting the shadow on the ground.

If it needs to move or if the angle is too awkward for a painted texture, then using a 2d patch will cast approx half as many shadows as the equivalent grate made from brushes, because you'll only cast shadows from one face instead of from the face plus half the sides. Shadows only get cast by tris that face away from the light by the way, so you don't have to worry about any that are facing the light. I guess using a patch might be worth doing if it's very complex or if you have a lot of them.

Link to comment
Share on other sites

Is there any equivalent of Precursors in TDM universe, or can I use this name?

 

No there isn't.

 

TDM is roughly based on a Roman empire that lasted for a millenium before starting to collapse, so if there's any kind of "precursor" society at all, it would be something Greek or Egyptian-like. Possibly Atlantean.

Link to comment
Share on other sites

Im trying to setup a candle so that when it's frobbed it gets extinguished, I first true placing a candle (in holder if that matters) entity on a table, changing the grabable spawnarg to 0 and then I set a response on the candle of being frobbed should "turn extinguished light off" but nothing happens in game. I even tried using a trigger once system but that didn't work either.

 

I've had similar problems once with a lantern where it doesn't seem to register the extinguished spawnarg.

 

So doors anyone know how to extinguish a candle with frobbing?

Link to comment
Share on other sites

make candle model, name it candle1

make candle flame entity. name it candle_flame1

bind candle_flame1 on candle1.

set candle1 "frobable 1"

open candle1 in S&R editor

give candle 1 response frob, with and effect extiguish extinguishable light. make it extinguish candle_flame1.

 

Frobbing the candle now extinguishes the candle flame. You can easily clone this light + candle entity combo everywhere. I recommend making candle1 "noshadows 1" so that the candle does not cast stupid-looking shadow.

 

For MOVING extinguishable candles, use the premade entities.

  • Like 1

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

"frob_action_script" "frob_extinguish" should also work. Don't forget that if you use extinguish light in the S+R editor, you have to pass _SELF as an argument (always top on the list).

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

Don't forget that if you use extinguish light in the S+R editor, you have to pass _SELF as an argument (always top on the list).

 

Not needed. I have tested and it works simply with "turn extinguishable light off."

Clipper

-The mapper's best friend.

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

    • 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
       
      · 3 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
    • 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
×
×
  • Create New...