Jump to content
The Dark Mod Forums

Dragofer

Development Role
  • Posts

    2631
  • Joined

  • Last visited

  • Days Won

    157

Posts posted by Dragofer

  1. 12 hours ago, thebigh said:

    Detecting if two triangles in 3D overlap seems not to be tremendously difficult, just a bit fiddly, so would it not be possible to have a script in DR to detect Z-fighting for you?

    It's a good idea, but I could imagine it causing lots of false positives in areas the player can't see and the mapper therefore was less careful, i.e. where brushwork seals against the void.

  2. 15 hours ago, geegee said:

    There are no conversations.  I'm unable to supply them.

    I actually posted on Discord recently about where numerous voice actors for Thief & TDM missions can be found. Since you didn't name a reason I assume it's because you didn't know where/how to find them:

    Screenshot_20211005-182127_Discord.thumb.jpg.646594582e5ac76601355f5a44c9b0dc.jpg

    As for what you're trying to achieve without conversations - I'd suppose you could carry out the whole scene via the conversation system, i.e. tell actors to walk to x, then wait/look at something for x seconds etc. Maybe Goldwell/Kingsal/JackFarmer have more hands on experience with the vagaries of the conversation system... but yeah, the best way to get AIs not to say random stuff is to give them something to say.

     

    • Like 2
  3. @Jedi_Wannabe
    Easiest would be to let all the trigger brushes target a func_remove entity, which in turn targets all the trigger brushes. When the func_remove is triggered it deletes all targets.

    Regarding your screenshot:

    - The left side should reference the type of stim you want to respond to. Right now you have "Frob", but you'd want "Trigger".

    - The bottom right box contains all the effects that should happen. To add something new, right-click in it. (Btw, instead of directly naming an entity, you can type in _SELF)

    - You don't need the "Stims" tab at all in most cases, only if you want to create a new stim emitter (i.e. water arrow) to which other entities (i.e. torch flames) can respond. You should delete anything you added under that tab.

    • Thanks 1
  4. I know of at least one other mapper who intends to participate.

    As for myself, I'd like to participate - I quite like the idea of connections - but my participation is uncertain given what other projects I might take on in real life up until Christmas. Also need to do some more work on some of the new 2.10 features, specifically finishing (security camera overhaul) and documenting (xrays) them. Furthermore, we should have a list of what was added in recent versions.

    If it works out, I do have an idea for what I could build, just need to find something to connect to.

    • Like 3
  5. 16 hours ago, thebigh said:

    When I do this, I find the rotate spawnarg doesn't update right and the hatch flips down at a skewy angle. Is there a way to bind it to something, or to calculate what the new rotate spwanarg has to be?

    This sounds like the hatch is made from brushes. If it were exported as a model, then it would automatically rotate in the correct direction relative to its orientation. IIRC you could also bind it to i.e. an invisible, nonsolid and rotated spoon, but it wouldn't be preferred.

    @Geep
    Regarding trial and error: DR now shows the axes of rotation when using the 'R'otate function, so it should be possible to briefly rotate the object in the desired direction by hand to see how much and on which axes it needs to rotate.

    • Like 1
  6. 5 hours ago, joebarnin said:

    I also tried code to delete the blackjack weapon:

    How about simply calling remove() directly on the blackjack entity that you placed in DR? getWeapon() might get something else than what you're expecting, like a weapon attachment or something.

    Maybe call $player1.selectWeapon("unarmed") in advance (maybe even with a sys.waitFrame() ) if that still crashes.

    4 hours ago, thebigh said:

    Unfortunately I haven't figured out how to interrupt the animations for getting the weapon out and putting it away.

    There must be a way to get and interrupt the animation of the player's arms viewmodel entity. Still the sound to take care of...

  7. 5 hours ago, joebarnin said:

    I also tried code to delete the blackjack weapon:

    How about simply calling remove() directly on the blackjack entity that you placed in DR? getWeapon() might get something else than what you're expecting, like a weapon attachment or something.

    Maybe call $player1.selectWeapon("unarmed") in advance (maybe even with a sys.waitFrame() ) if that still crashes.

  8. 7 minutes ago, wesp5 said:

    Coming back to the issue in the tutorial mission where you can unlock both the base and the lid of a chest, until somebody makes a remaster of this, is there an entity editor for TDM to fix this quickly without the need to recompile the whole map?

    Entities can be changed with no need to recompile the map. DR is quite a good entity editor.

  9. @demagogue
    Quite a few of the methods for calling a script in fact pass the name of the calling entity. For example, any entity that has a "frob_action_script" passes its own name. This makes it quite straightforward to getKey custom spawnargs that were set on that entity in DR.

    The callscriptfunction entity is the most versatile method because it's uniquely able to pass 3 different entities: itself, the entity that triggered it and one of its targets. In the wiki example, the buttons target such entities.

    @Geep
    Yeah, I suppose at least some of those examples could use visualisation

    • Like 2
  10. 4 hours ago, joebarnin said:

    Why not add the counter increment as a spawn arg on the button? So each button has

    ”counterIncrement” “13”

    or whatever. Then your script gets the value of the “counterIncrement” spawn arg from the button passed into the script function, and uses that to increment the counter. No need for if/then ugliness. 

    Yep, that seems like the way to go. The "advanced example" uses spawnargs like this on various entities to make a teleportation buttons setup. Once you have an entity you can also get all its spawnargs.

    • Like 1
  11. 18 hours ago, joebarnin said:
    1. Player starts with blackjack/sword/arrows (typical situation)
    2. Some event takes away the blackjack and sword. He still has his bow, and can shoot arrows.
    3. Later, another event gives him a blackjack and sword. Preferably, he would just pick them up and that would re-enable them.

    This sounds like something you could do by removing or adding weapon entities to the player's inventory - Geep's method with disableWeapons() was only intended to stop the player from using his weapons ("too slippery") without taking them anyway.

    The script method to remove a weapon would be:

    $player1.replaceInvItem($blackjack1, $null_entity);

    The script method to add a weapon should be:

    $blackjack2.frob($player1);
    or
    $player1.addInvItem($blackjack2);

    As you can see, you'd need 2 different blackjacks in the map - I doubt you can add an item to the player's inventory that was already removed, though it's worth a try.

    [This might all fail if the engine doesn't treat weapons as inventory items at all]

    • Thanks 1
  12. 41 minutes ago, Abusimplea said:

    Would still advocate for promoting that button to actually delete the whole mission folder instead of just removing it.

    Can't say I'm eager to put a button in there that could potentially wipe a WIP mission. There'd have to be some solid safeguards (warning messages can be skimmed and misunderstood by a busy mapper) to make sure that this is a mission that's been downloaded from the server, i.e. by checking whether the folder contains exactly a .pk4, darkmod.txt, savegames folder, and no other files like an extracted maps folder.

    • Like 1
  13. 2 hours ago, datiswous said:

    I thought that with a leak the map wouldn't load. I get the impression that it does boot up.

    If the map has never been successfully compiled, or you deleted the compilation files, the map won't load. Otherwise, if there are still compilation files from an earlier successful compilation, the map will still load, but with many problems as described above.

    • Like 1
  14. That sounds very much like you've got a leak (a gap somewhere in your worldspawn brushwork that leads out into the void). You can show a red line showing the path to the leak by going to File > Show Pointfile. In any case, it'd be worth looking at your tutorial's section on sealing/leaks again.

  15. 9 minutes ago, wesp5 said:

    we could make the base unfrobable and the lid frobable.

    That's simple enough with the original sound script. m is the base (frob_master) and e is the lid (which is already frobable anyway), so:

    Quote

    m = e.getEntityKey("frob_master");

    if ( ( m != $null_entity ) && ( m.getKey("classname") == "atdm:froblock" ) )

    {

    m.setFrobable(0);

    e.setFrobable(1);

    }

    else

    {

    continue;

    }


     

  16. 1) e.setFrobable(0) is the correct way to change frobability. What you could still try is use getKey and setKey to transfer the lock spawnargs from the body to the lid.

    Otherwise the ultima ratio would be to respawn the lid with the body's lock spawnargs and set the body to unfrobable. I believe "respawning" via scripts means getting and temporarily storing all the spawnargs of the original lid + the body's lock and key related spawnargs, and using them to spawn a new one, as per the wiki.

    2) 99%+ of the time, entities, scripts and code require soundshaders. Soundshaders reference .ogg's and include information on radius, volume, looping etc. They're defined in .sndshd files.

  17. 1) Froblock entities are frobable, lockable entities - so like a door that doesn't move. The most common chest setup in TDM is to create the chest body as a froblock and the lid as a door. Both entities can be locked, but usually it's the body.

    They're linked as follows:

    - they mutually have each other as frob_peers. This means they highlight together.

    - the lid has the body as its frob_master. This means when you frob the lid, it gets passed to the chest.

    - the body has the lid as its target. This means when you frob the body when it's unlocked, it sends a trigger to the lid so that it opens.

    An alternative setup is just to create the body as a func_static and the lid as a locked door. The froblock entity is imo superfluous here - I think it's meant for making standalone locks that open something somewhere else.

    For my missions, and in a prefabs update some years ago, to make it easier to get things out of chests the froblock body was set to unfrobable and the lock settings (locked, lockpick type and pins) applied to the lid instead. I doubt that you can change lock settings after the mission has started.

    2) Additionally you can identify lids based on their model, spelling out the file path of every lid model in core TDM (something like if ( e.getKey("model") == "models/darkmod/containers/..." ) ). This won't catch lids that were created using DR, so you'll probably still want the froblock check at the end. Another clue is that the lid usually targets an atdm:target_setfrobable entity, which toggles frobability of items inside the chest.

    Re: sfx sounds: are you sure you're using the soundshaders, and not the .ogg files directly?

    Re: training mission: sounds like a bug. Do you see a similar behaviour in older missions, i.e. from 2012? Btw, kingsal said he's interested in reimagining the training mission at some point, and some might join him in that.

  18. On 9/7/2021 at 9:41 PM, OrbWeaver said:

    There is already a better way of deprecating assets such that they do not appear at all in DarkRadiant browsers. So far I don't think this feature has been used at all by the mod assets.

    This is very good. At this point I think TDM's assets have accumulated quite a few things that should be deprecated, but unfortunately this is limited to models and materials at the moment. I've confirmed this to still be the case in DR 2.13.

    I definitely have some "deprecated" or outdated entities and duplicated soundshaders on my hit list, so I opened a ticket to extend this feature's coverage.

  19. 17 hours ago, wesp5 said:

    Can you please take a look at this? I could provide you with sounds that would fit better for a lot of the containers that use the default door sound right now. They are all already included in TDM, so nothing else would need to be changed!

    Alright - this script rolls a random int between 0 and 4, then assigns one of 5 pairs of open and close sounds to doors that have been identified as chest lids on the basis of the frob_master being an atdm:froblock. It needs to be called once at map start, and you could change the names of the soundshaders ("door_open_02" etc.) to ones that you think go well together.

    Spoiler
    void tdm_chest_sounds()
    {
    	entity e;
    	entity m;
    	float i;
    	string s;
    
    	do
    	{
    		e = sys.getNextEntity("classname","atdm:mover_door",e);
    
    		if (e)
    		{
    			m = e.getEntityKey("frob_master");
    
    			if ( (m != $null_entity) && ( m.getKey("classname") != "atdm:froblock" ) )
    			{
    				continue;	//skip, this is not a chest lid
    			}
    
    			i = int( sys.random(4.99) );	//random int from 0 to 4, rounded down
    
    			if ( e.getKey("snd_open") == "door_open_01" )
    			{
    				if      ( i == 0 )	s = "door_open_02";
    				else if ( i == 1 )	s = "door_open_03";
    				else if ( i == 2 )	s = "door_open_04";
    				else if ( i == 3 )	s = "door_open_05";
    				else if ( i == 4 )	s = "door_open_06";
    
    				e.setKey("snd_open", s);
    			}
    
    			if ( e.getKey("snd_close") == "door_shut_01" )
    			{
    				if      ( i == 0 )	s = "door_shut_02";
    				else if ( i == 1 )	s = "door_shut_03";
    				else if ( i == 2 )	s = "door_shut_04";
    				else if ( i == 3 )	s = "door_shut_05";
    				else if ( i == 4 )	s = "door_shut_06";
    
    				e.setKey("snd_close", s);
    			}
    
    		}
    
    	}	while (e);
    }

     

    Btw, scripting in TDM is now more thoroughly documented on the Wiki, so it'd be worth familiarising with for doing tasks like this. In this particular case, this page would've been useful for identifying all entities of a certain type in the map.

    17 hours ago, wesp5 said:

    One way to find most container entities would be to check that the angle of opening movement is on the z axis.

    It'd also identify all horizontal doors as chest lids. My approach with looking for frob_masters might not cover 100% of cases, but I don't think it'll yield false positives.

    • Thanks 1
  20. 21 minutes ago, wesp5 said:

    I already found different sounds and changed them in the prefabs, but would it be possible to do this on the fly using scripts or defs? The classname is atdm:mover_door.

     

    Doors and lids both use that class, and I'm not entirely sure there's a property that will 100% accurately distinguish between them. Maybe it's possible to use a script to check if a mover_door is a frob_peer of an atdm:froblock entity?

    Changing the sound spawnarg via script should work fine. Most of the time when a sound is played in TDM, it reads the sound spawnarg.

  21. 38 minutes ago, duzenko said:

    Thanks

    Do you think anything here needs fixing?

    Or it's intended operation? I'm asking because someone put it there for a reason a while ago, not something new

    From my perspective it should only remove savegames - at the moment I can't think of any more files with significant weight that can be safely removed.

    Maybe previous devs had a reason to delete more files, but tbh it doesn't really seem thought through. The purpose of this button seems to be to reset the FM folder to the state as if a player had just downloaded the .pk4, ignoring the possibility that it could be a WIP FM.

    Tbh if it only removes savegames the feature could just as well be removed, since I don't think their file size matters anymore - the GUI would be a little bit cleaner. I don't think we've had problems with bloated savegames for a long time.

    • Like 3
×
×
  • Create New...