Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

You'll want to check out particle effect tdm_flies.prt .

BTW, _Atti_ placed a nighttime swarm of these outside a window, circling in the outward cast beam. (This effect is part of our WIP that will see the light of day in 2021.) You can't really tell what creatures they are... moths, bats, whatever

Link to comment
Share on other sites

I also mentioned nurbs. Do a forum search for nurbs to see threads on them, but to start off you can read up on them here: https://forums.thedarkmod.com/index.php?/topic/20163-roadmap-for-tdm-in-2020/page/5/&tab=comments#comment-444657

 

Edit: Somewhere on YouTube there's a video showing a will-o'-wisp flying around using this system, so you can see the system in action and know where to find an example. I even think FenPhoenix was the one that uploaded it. I'd post it if I could, but I can't find it just now. But if you search enough on YouTube or just ask FenPhoenix maybe by PM here or on TTLG, you can find it that way.

  • Like 1

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

Just converting over to info_location sounds, and having some problems, as indicated by dmap warnings of form:

WARNING:location entity 'Info_location_x' overlaps 'info_location_y' in area n

For context, imagine x and y are separate adjacent rooms with a single entrance each. Each entrance has a visportal with a locationseparator, and each room (and their common corridor) has its own info_location. No errors are reported concerning the visportals themselves or their locationseparator embedments.

So presumably, there's some crack between rooms x and y that's treating both room as a common portal area. The crack may be some indirect path through adjoining spaces.

What would be most helpful here is a way to generate a pointfile that would run between entities info_location_x and info_location_y. Absent that, is there some other way to discover where the leak is?

Link to comment
Share on other sites

3 hours ago, Geep said:

What would be most helpful here is a way to generate a pointfile that would run between entities info_location_x and info_location_y. Absent that, is there some other way to discover where the leak is?

It's good practice to build maps leaving only the big sealing brushes as worldspawn and everything else func_static, so that you can enable the filter for "All entities" and more easily find gaps in the clean, blocky brushwork.

Apart from that, there's still the old method of intentionally creating a leak to the void -> running pointfile to see which entity is used as the starting point for the red line -> move that entity into either room & turn the rooms' visportals into i.e. wood.

Or export the 2 rooms into a separate map and see what the pointfile does.

  • Like 1
Link to comment
Share on other sites

Thanks. Of the three methods, my thoughts are -

(1) seems unfortunately insufficient for a preexisting large building with 2 dozen rooms and a set of worldspawn rooflines that are complexly-angled and clipped.

(2) and (3) are equivalent in power; probably (2) is the lighter lift, so I'll start there.

But first, I'm continuing the further planned subdivision of the space into various info_locations. This may (or may not) narrow down where the problems lie.

Link to comment
Share on other sites

@GeepCome to think of it, the easiest way to see if theres a leak between the 2 rooms would be to stand in one and enable r_showportals 1. If you can see the other room's portal, there's a leak.

Link to comment
Share on other sites

At the workshop I was fiddling around with "stacking" sliding doors on 3 axis and a rotator at the bottom, adding some random triggers and all on different speeds, a semi random movement occurs. The nice thing about this is that you can have your object to go around an object in the middle.

https://streamable.com/v5udl9

Now I'm trying to put that into a script and I can get things moving already, but how could the movement be restricted?

I think there are ways to detect when an entity touches an other entity, and when that occurs a change of direction can follow, but isn't that processor heavy?

Other way could be to predefine the area by creating some sort of (alternative) monsterclip (to define no-go areas). But how to put that in a script?

 

Edited by STRUNK
Link to comment
Share on other sites

Re: Finding an internal leak, I think the quickest failsafe way is make a copy, change all the visportal textures for the two leafs to a solid brush texture, put the starting point in one leaf, then cut a hole to the void in the 2nd leaf, then when you call the point_file, it's going to run from the start point through the internal leak out to the void.

  • Like 1

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

Thanks for that refinement of Dragofer's suggestion.

Probably the tea leaves I'm basing my analysis on are too muddled so far... Further visportaling and location_separating may clarify the situation. And cutting back on speaker-based sound sources, at least some of those previously used for ambience.

Link to comment
Share on other sites

Scripting the whole bat/moth seemed to be very difficult, so I made a simple script where a bat hunts after an object that moves by binding rotators and doors together:

Although it takes some effort to implement in a map, the result is rather nice I think. It could, with some tweaking, also be used for other flying stuff ^^

Edited by STRUNK
Link to comment
Share on other sites

My large-building-interior info_location overlap problems have been solved. Here's what I learned -

  • The majority of my problems were due to missing locationseparators. In a large, complex spaces (say, the inside of a duct network), it is easy to overlook an opening or two.
  • One fail was caused by a worldspawn wall which I had stupidly made way too thin (0.125 thick!), which the engine decided was non-sealing.
  • There was only 1 traditional seam leak.

Given that most causes were not leaks, the recommended leak-finding techniques were not fruitful. Instead, what worked was "divide and conquer". More specifically, for each reported overlap:

  1. Subdivide one or both existing info_locations by temporarily installing more locationseparators (usually in new visportals) and named info_locations.
  2. Dmap to check any new visportals, and correct them. (Did a visportal fail because it crossed a seam leak? If not obvious by inspection, try a pointfile).
  3. Map (but don't actually press "attack") the game, in order to get updated overlap information in the console. Which subspace is now reported?
  4. Repeat until you've gotten the culprit area down to manageable size. If there's no obvious missing locationseparator, eyeball the walls closely for seam fails. (Helpful: filter entities; select walls of interest and hide deselected)

When done, any new visportals can be left as non-harmful/maybe-helpful; remove the diagnostic-only info_locations and locationseparators.

  • Like 1
Link to comment
Share on other sites

I'm working on a script for a random mover that will stay in an area that is set by boundries. Random-Mover.jpg

 

Ok,  I erased the question for I have answers t most of it already. New script down here:

Spoiler

void Warning()
{
    $Warning.rotate( '0 0 720' );
}

void WarningStop()
{
while (1)
    {
    $Warning.stopRotating();
    sys.waitFrame();
    }
}


void Collision()
{
    while(1)
    {
        if ($Warning.isRotating())
        {
        $light_4.On();
        
        $Target1.rotateOnce('0 0 179');// 0 0 180
        sys.wait(0.1);//0.1
        $light_4.Off();
        }
    sys.waitFrame();
    }
}


void RotateRandom()
{
    while(1)
    {

    float minY = 0;
    float maxY = 0;
    float Y = minY + sys.random(maxY - minY);
    
    float minZ = -60;//-60
    float maxZ = 60;//60
    float Z = minZ + sys.random(maxZ - minZ);
    
    vector R = ('0 0 0');
    R_y = R_y + Y;
    R_z = R_z + Z;
    
    $Target1.time (0.1);//0.1
    
    $Target1.rotateOnce (R);
    sys.wait(0.5);//0.5
    }
}

void Move()
{
while(1)
    {
    $Target1.speed (250); //250 max speed?
    $Target1.move(REL_LEFT , 1);
    sys.wait(0.005);//0.005
    }
}

void main()
{
    thread Collision();
    thread RotateRandom();
    thread Move();
    thread WarningStop();
}

 

 

 

 

 

Edited by STRUNK
  • Like 1
Link to comment
Share on other sites

There are different ways to let a script wait, like waitFrame() and wait()

Does waitFrame() wait 1/60th of a second when the game runs at 60fps and 1/20th of a second at 20fps?

If I use wait(0.01) or wait(0.001), it's a shorter wait period then waitFrame. What is the shortest "safe" wait period, and can a fast computer handle a shorter wait time then a slow computer?

Link to comment
Share on other sites

1 hour ago, STRUNK said:

Does waitFrame() wait 1/60th of a second when the game runs at 60fps and 1/20th of a second at 20fps?

I think the game clock runs independently of how fast your PC is producing frames. If you run the game at 20fps, the game clock advances by 3 frames even though you've only seen one frame in that time.

1 hour ago, STRUNK said:

If I use wait(0.01) or wait(0.001), it's a shorter wait period then waitFrame. What is the shortest "safe" wait period, and can a fast computer handle a shorter wait time then a slow computer?

The shortest possible waiting duration is 1/60 of a frame, so 0.0167s. As Obsttorte pointed out once, if you use wait commands the engine checks every frame whether a greater or equal amount of time has passed. So if you specify 0.0200s, the engine will wait 2 frames, 0.0333s.

 

  • Thanks 1
Link to comment
Share on other sites

@Dragofer

If I getFrameTime() it returns 0.0160 so I guess that is the minimum time the engine can repeat/check things. But if I have a wait of 0.001 in a while() loop, it calculates every frame what would have happened in 16 times this while() loop .. right?

 

I have a working script now and am determaning the right settings for maximum speed. Only problem is I can't get higher then a movement of 12 units in one loop, for it results in the enty escaping through the boundries: 

Spoiler

void Warning()
{
    $Warning.rotate( '0 0 720' );
}

void WarningStop()
{
while (1)
    {
    $Warning.stopRotating();
    sys.wait(0.002);
    }
}


void Collision()
{
$light_4.On();

        $Target1.rotateOnce('0 0 15');
        sys.wait(0.001);
$light_4.Off();
}

void Coll()
{
if ($Warning.isRotating())
Collision();
}

void RotateRandom()
{
    float minY = 0;
    float maxY = 0;
    float Y = minY + sys.random(maxY - minY);
    
    float minZ = -30;//-60
    float maxZ = 30;//60
    float Z = minZ + sys.random(maxZ - minZ);
    
    vector R = ('0 0 0');
    R_y = R_y + Y;
    R_z = R_z + Z;
    
    $Target1.time (0.1);
    
    $Target1.rotateOnce (R);
    sys.wait(0.2);
    float frmTime = sys.getFrameTime();
    sys.println (frmTime);
}

void Move()
{

    $Target1.speed (1);
    $Target1.move(REL_LEFT , 12);
    sys.wait(0.001);

}

void Rest()
{

    $Target1.move(REL_LEFT , 0);
    sys.waitFrame();

}

void MoveRest()
{
    float minA = 0;
    float maxA = 1000;
    float A = minA + sys.random(maxA - minA);
        
        if (A>=0&&A<1)
        {
        Rest();
        sys.wait(1);
        }

        if (A>=1&&A<2)
        {
        Rest();
        sys.wait(5);
        }

        else
        {
        Move();
        }
        
    sys.wait(0.001);
}

void MoveRestCol()
{
while(1)
    {
        if ($Warning.isRotating())
        {
        Coll();
        }
        else
        {
        MoveRest();
        }
        
    sys.wait(0.001);
    }
}

void RotCol()
{
while(1)
    {
        if ($Warning.isRotating())
        {
        Coll();
        }
        else
        {
        RotateRandom();
        }
    sys.waitFrame();
    }
}

void main()
{
    thread WarningStop();
    thread MoveRestCol();
    thread RotCol();
}

So I guess getting a higher speed means I have to find out how to get a greater distance in one loop (that always takes 0.0160 sec), without the escape ...

 

 

Edited by STRUNK
Link to comment
Share on other sites

3 hours ago, STRUNK said:

@Dragofer

If I getFrameTime() it returns 0.0160 so I guess that is the minimum time the engine can repeat/check things. But if I have a wait of 0.001 in a while() loop, it calculates every frame what would have happened in 16 times this while() loop .. right?

It's very probable the 0.0160 is just a rounding down of 0.01666666. The most precise expression of a frame is 1/60 of a second.

sys.wait is less precise than sys.waitFrame because the engine checks every frame how much time has passed. So it checks after 0.0167s, 0.0333s, 0.0500s etc. If you tell it to wait 0.02s it actually waits 0.0333s because that's the first frame where time elapsed is greater than 0.02.

I really don't think there can be less than 1/60 of a second between scripted events, so you'd have to adjust the distance moved.

  • Thanks 1
Link to comment
Share on other sites

15 hours ago, STRUNK said:

Is there something simple I can put in my script, or in my map that is realy eats resourses, so I can test what happens?

Use a gpu overclocking tool to decrease your GPU core clocks to something low like 200mhz.

Do the same thing with your CPU.

This will simulate a garbage potato.

  • Thanks 1

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

42 minutes ago, STRUNK said:

I want to spawn a func_static and a func_mover from script ... is that possible?

You can spawn entities, and you'd probably need to set a model too, like this:

entity spawned_entity = sys.spawn("func_static");
spawned_entity.setModel("models/darkmod/...");
spawned_entity.setOrigin('0 0 0');

 

  • Thanks 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

    • 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.
      · 1 reply
    • 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...