Jump to content
The Dark Mod Forums
demagogue

Newbie DarkRadiant Questions

Recommended Posts

Sorry, you were right. I missed a bracket in the "tdm_ai_guard_proguard_devel.def", which is why I did not see that the animations belonged to the model definition in this file. I myself have only added animations to this file and it worked. I just tested it and saw that if you create a new model definition, it will overwrite the existing model def. My mistake. Anyway, you can still add new animations (or modify existing ones) as long as you add it to "tdm_ai_guard_proguard_devel.def" (this is acutally the model def for all male characters) before the final brackett and it will be available for all AIs that are based on the proguard mesh,which is all male AIs (including zombies). Sorry to have confused you.

  • Like 1

Share this post


Link to post
Share on other sites

I have this script for dozen on info_location sounds:

$info_location_1.setKey("ambient","snd_silence");

 

It seems fine at the beginning, but after a few minutes of looking at AI and not interacting with anything fps count start to pulse and drops (more than once/sec) more and more as time goes. I'm not even sure if is this command that causing it, anyone have seen something similar?

The location game script triggers the bulk of its code when the ambient name changes, but there's no reason I can think for it to compound activity. Does your script change the info_location once or continuously?

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

Share this post


Link to post
Share on other sites
     $info_location_1.setKey("ambient","snd_silence");
     $info_location_2.setKey("ambient","snd_silence");
     $info_location_3.setKey("ambient","snd_silence");
     $info_location_4.setKey("ambient","snd_silence");
     $info_location_6.setKey("ambient","snd_silence");
     $info_location_7.setKey("ambient","snd_silence");
     $info_location_8.setKey("ambient","snd_silence");
     $info_location_9.setKey("ambient","snd_silence");
     $info_location_10.setKey("ambient","snd_silence");
     $info_location_11.setKey("ambient","snd_silence");

     $info_location_16.setKey("ambient","snd_silence");

It is a one time script. AI is triggered too so other option I can imagine is that some custom AI footstep is processed so many times it slow down whole game. I will try it without activating AI.

 

 

edit: problem is gone when AI is gone. So it must be some issue with AI walking around.

Edited by ERH+

S2wtMNl.gif

Share this post


Link to post
Share on other sites

Oh yeah, AI are a massive processing hog. If you think about 10 or so commands for every spawnarg (aren't there like 100?) triggering every .1 seconds, then multiply that for each AI, you can imagine. The sound part of the location script at its worst is still only like 3 or 5 commands every .2 seconds if you could run back and forth over a transition that fast.


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

Share this post


Link to post
Share on other sites

Is it possible to easily add a delay to a door?

 

I want the player to frob it and then a couple of seconds later for the door to open. I know via scripting and S&R it is possible but is there an easier way? perhaps a spawnarg i'm missing

Share this post


Link to post
Share on other sites

Just a long move_time so far as I can see. But not exactly what you want.

 

I don't know why people are so wary of scripts.

You'd just have and S/R for frob that runs your script and delete frob_action_script (or change frob_action_script to your script name?), and it'd only have two lines, a wait function, and an activate or frob_door function acting on the door object. Dirt simple.


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

Share this post


Link to post
Share on other sites

I know via scripting and S&R it is possible but is there an easier way?

 

Scripting is the easy way ;)

 

 


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

Just a long move_time so far as I can see. But not exactly what you want.

 

I don't know why people are so wary of scripts.

You'd just have and S/R for frob that runs your script and delete frob_action_script (or change frob_action_script to your script name?), and it'd only have two lines, a wait function, and an activate or frob_door function acting on the door object. Dirt simple.

 

 

 

Scripting is the easy way ;)

 

 

 

I have changed it to so that the door spawnarg "frob_action_script" points to the following script:

void frob_door_delay_01()
{
	sys.wait(3);
	$atdm_mover_door_11.activate($player1);
}

However it adds no delay to the door when I frob it

 

I also tried adding in the "tdm_frobactions.script" for the core mod and modifying it for the delay (as well as changing the spawnarg on the door) I changed the script to the following:

void frob_door_delayed(entity ent)
{
   //vector angles;
   //angles = ent.getAngles();
   //sys.print("["  + ent.getName() + "] X:" + angles_x + "  Y:" + angles_y + "  Z:" + angles_z + "\n");

// Ish: No longer trigger targets by default, now controlled by spawnargs
//	ent.activateTargets( $player1 );
	sys.wait(3);
	ent.ToggleOpen();
}

The only difference between that and the original is adding in the sys.wait and that does not work either.

 

I must be missing something but I fail to see what, i've tried both making my own custom script for the door as well as adding into my base FM folder and editing the original frobactions script however neither are recognized ingame. I frob the door and it opens immediately, despite the script telling it otherwise but that shouldn't be possible. I also added in some sys.print lines to follow it along and they are displayed in the console so I know my custom delay script is being referenced.

Edited by Goldwell

Share this post


Link to post
Share on other sites

That's funny, I also had problem with script not executing sys.wait . Doubling it like this

	sys.wait(3);
        sys.wait(3);
	$atdm_mover_door_11.activate($player1);

helped, but looks like a bug.

  • Like 2

S2wtMNl.gif

Share this post


Link to post
Share on other sites

That's funny, I also had problem with script not executing sys.wait . Doubling it like this

	sys.wait(3);
        sys.wait(3);
	$atdm_mover_door_11.activate($player1);

helped, but looks like a bug.

 

That solves the delay problem however the sequence I have laid out doesn't quite work the way I want it to. I'm going to try experimenting with a few other options first but after spending a few hours just on getting this door to work i'm rather burnt out on it and i'm going to move onto something else for the time being.

 

Either way, thanks for your help!

Edited by Goldwell

Share this post


Link to post
Share on other sites

Does someone know what alert level must be exceeded in order to conversation to terminate?


Clipper

-The mapper's best friend.

Share this post


Link to post
Share on other sites

Does someone know what alert level must be exceeded in order to conversation to terminate?

 

Conversation is aborted or not started at Level 3 - Searching.

  • Like 1

Share this post


Link to post
Share on other sites

I noticed this sys.wait() problem a few times.

 

I worked around it by doing this:

void real_frob_door_delayed(entity ent)
{
    sys.wait(3);
    ent.ToggleOpen();
}
 
void frob_door_delayed(entity ent)
{
    thread real_frob_door_delayed(ent);
}

I haven't invetigated, but for some reason, sys.wait() sometimes prefers to run in a separate thread.

  • Like 2

Share this post


Link to post
Share on other sites

This is probably unrelated to Goldwell's problem, but I'll note it here for posterity's sake: I once wanted a trapdoor and sliding ladder to work so that the trapdoor would open and then the ladder (internally, a sliding door entity) would descend, and vice versa on closing. They insisted on moving at the same time and thereby clipping through one another, even after I wrote a script to control them, and I spent ages staring at my little script before realising that they were both touching the same visportal, and had inherited some auto_* spawnargs to set themselves up as double doors.


Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

Is it possible to easily add a delay to a door?

 

I want the player to frob it and then a couple of seconds later for the door to open. I know via scripting and S&R it is possible but is there an easier way? perhaps a spawnarg i'm missing

 

I rigged a lever to a trigger_relay with a "delay" spawnarg that targets a door and that worked. You could probably have a dummy door that's just a frobable entity and teleport the working door in its place when the delay expires. I doubt that constitutes as easy, but if you don't mind relegating the opening of the door to a button or somesuch, the first way's easy! Cheers.


My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Share this post


Link to post
Share on other sites

Scaling models down with the rotation spawnarg seems to mess up the shadows cast by that model. Is there any way to amend this besides completely turning them off?


My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Share this post


Link to post
Share on other sites

Scaling models down with the rotation spawnarg seems to mess up the shadows cast by that model. Is there any way to amend this besides completely turning them off?

 

The only known fixes are setting the "inline" "1" spawnarg on the model or disabling shadows and attaching your own custom shadow-mesh.

 

Hmm... Have you tried Rich's scaling script?

 

http://forums.thedarkmod.com/topic/17399-scaling-func-statics-in-dr-how-to-implement/


Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Share this post


Link to post
Share on other sites

Rich_is_bored's script seems to just automate setting the rotation spawnarg. Using "inline" always feels a bit icky but I think it's going to work for my case, thanks. It's a plant .ase so collision's not an issue.


My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Share this post


Link to post
Share on other sites

I noticed this sys.wait() problem a few times.

 

I worked around it by doing this:

void real_frob_door_delayed(entity ent)
{
    sys.wait(3);
    ent.ToggleOpen();
}
 
void frob_door_delayed(entity ent)
{
    thread real_frob_door_delayed(ent);
}

I haven't invetigated, but for some reason, sys.wait() sometimes prefers to run in a separate thread.

Yeah, did the same thing when encountering this issue, which seems to happen quite often. I never thought of it as a bug, though, as it never came to my mind to use two wait commands after each other like erh suggested.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

Scaling models down with the rotation spawnarg seems to mess up the shadows cast by that model. Is there any way to amend this besides completely turning them off?

Not just the shadowmesh, the collision mesh also becomes problematic, making it very easy to get stuck in it, so you'd need either inline or some nodrawsolid. Or do the scaling in Blender.

Share this post


Link to post
Share on other sites

Yes, only the visual model gets scaled. Besides that, the bounding box used by the engine to determine whether the model is inside the players fov is also untouched, so increasing the size of a model will also cause problems.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

I'm trying to use this spyglass material as a helmet overlay

 tdm_spyglass_overlay
{
  qer_editorimage  guis/assets/hud/spyglass_overlay_ed
  diffusemap    guis/assets/hud/spyglass_overlay

  // TDM Ambient Method Related
  {
    if (global5 == 1)
    blend add
    map        guis/assets/hud/spyglass_overlay
    scale      1, 1
    red        global2
    green      global3
    blue      global4
  }
  {
    if (global5 == 2)
    blend add
    program  ambientEnvironment.vfp
    vertexParm    0    1, 1, 1, 1    // UV Scales for Diffuse and Bump
    vertexParm    1    1, 1, 1, 1  // (X,Y) UV Scale for specular
    vertexParm    2    global2, global3, global4, 1

    fragmentMap    0    cubeMap env/gen1
    fragmentMap    1    _flat      // Bump
    fragmentMap    2    guis/assets/hud/spyglass_overlay      // Diffuse
    fragmentMap    3    _black      // Specular
  }
}

so it looks like this

guis/divinghelmet
{
  qer_editorimage  guis/assets/hud/spyglass_overlay_ed
  diffusemap    textures/helmet

  // TDM Ambient Method Related
  {
    if (global5 == 1)
    blend add
    map        textures/helmet
    scale      1, 1
    red        global2
    green      global3
    blue      global4
  }
  {
    if (global5 == 2)
    blend add
    program  ambientEnvironment.vfp
    vertexParm    0    1, 1, 1, 1    // UV Scales for Diffuse and Bump
    vertexParm    1    1, 1, 1, 1  // (X,Y) UV Scale for specular
    vertexParm    2    global2, global3, global4, 1

    fragmentMap    0    cubeMap env/gen1
    fragmentMap    1    _flat      // Bump
    fragmentMap    2    textures/helmet      // Diffuse
    fragmentMap    3    _black      // Specular
  }
}

but all I got after activating helmet is completely black screen.

 

(.gui file)

windowDef Desktop
{
         rect 0, 0, 640, 480
         visible 1
         nocursor 1
         background ""

         windowDef helmet
        {
                  rect 0, 0, 640, 480
                  background "guis/divinghelmet"
                  visible 1
        }
}

S2wtMNl.gif

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...