Jump to content
The Dark Mod Forums

Recommended Posts

Posted
On 7/17/2020 at 5:58 PM, Dragofer said:

C ) Mass Teleport

So the entities get teleported to the exact location as they were, but then in the new room, right?

Also, does the room have to be absolutely the same or could some stuff be a little different?

Another question:

Could the script also work with a trigger facing?

Posted
1 hour ago, datiswous said:

So the entities get teleported to the exact location as they were, but then in the new room, right?

Also, does the room have to be absolutely the same or could some stuff be a little different?

Another question:

Could the script also work with a trigger facing?

The illusion works best if the 2 rooms are completely identical. The player and moveable entities have their origins modified by the vector between the 2 rooms so they'll end up in the same location over there.

Regarding the triggers, you need a reliable way of triggering the teleportation before the player reaches the far side of the room and notices the dead end. If it's just a trigger_facing the player might walk sideways/backwards and not activate the trigger. Also, the trigger zones should not overlap, otherwise the player will get endlessly teleported back and forth.

The trigger_touch is just needed to register all entities inside the room so they can be teleported.

  • Like 1
Posted
19 hours ago, Dragofer said:

I do usually make test FM archives for each asset, as it helps make sure that all custom assets are in place. When I release an asset it's basically that archive minus the maps folder. I could try to dig the maps up again.

Why not. I am thinking of mappers, wishing to try/test your new toys without much hassle.

19 hours ago, Dragofer said:

The assets are usually made for missions, so you can also find the assets in there (presence lamp in Painter's Wife, camgoyles in Written in Stone, automaton station in The Anomaly, the audiograph and teledoors feature in WIPs).

Excellent. Thanks for your work.

TDM Modpack

Posted
On 11/16/2022 at 5:12 PM, snatcher said:

Why not. I am thinking of mappers, wishing to try/test your new toys without much hassle.

I've in any case found some test maps I used to develop the respective features, they should work if you also have the .pk4:

presence.mapcamgoyle.mapaudiograph.map

If you're looking for a kind of demonstration map to showcase all the features, though, that'd be a fair amount of hassle to make, on top of the time I already put into documenting the spawnargs, commenting the scripts, writing the wiki articles and creating prefabs.

  • Like 2
Posted

Out of curiosity I tried to load the audiograph map in TDM with no success. Anyway, I am sure mappers know their way around (I am unable to build anything in DarkRadiant).

Looking forward to see your latest creations in missions.

Thanks.

TDM Modpack

Posted
3 minutes ago, snatcher said:

 (I am unable to build anything in DarkRadiant)

Well, it's very easy to learn. If I can do it - so can you! :) 

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Posted
1 hour ago, snatcher said:

Out of curiosity I tried to load the audiograph map in TDM with no success. Anyway, I am sure mappers know their way around (I am unable to build anything in DarkRadiant).

Looking forward to see your latest creations in missions.

Thanks.

Just need to make sure you have the audiograph "FM" installed so that it loads the custom assets from the .pk4.

  • 6 months later...
Posted (edited)
On 11/19/2022 at 9:33 PM, snatcher said:

Out of curiosity I tried to load the audiograph map in TDM with no success. Anyway, I am sure mappers know their way around (I am unable to build anything in DarkRadiant).

Not sure if you got it working, but I got it working by simply putting the audiograph.map file inside the maps folder and then in tdm open the console and type dmap audiograph and after type map audiograph . This probably automatically works because the resources are now in core already.

Edited by datiswous
  • 1 month later...
  • 1 year later...
Posted

Neonsstyle recently pointed out to me that my seamless mass teleportation script doesn't seem to work when the setup is rotated, and I realised that the version I linked to in this thread even relies on manually adjusting the script. It was also inefficient because it had two nearly identical script functions for each direction, and it only supported one teleportation setup per map. As this is an old script it was clearly time to rewrite it.

To begin with, the purpose of the script is to enable seamless teleportation without the player noticing that it has happened, giving the illusion that two areas of the map are physically connected. There should be two identical-looking locations, preferrably an S-shaped corridor to limit how much the player can see in the moment he is teleported and thus how much needs to be duplicated. The locations should also be AI-free, since I expect their patrols will break after teleportation.

There are two trigger brushes at either end: a narrow brush that initiates the teleportation procedure, and a larger "zone" trigger_touch brush around it that applies the teleportation to the player and all AIs and moveables in its volume. The narrow brushes are in slightly different positions at either location to avoid that the player gets stuck in an infinite teleportation loop. The teleportation vector is automatically calculated from the origins of the departure and destination zone entity, so it's important you keep this in the same relative position.

unknown.thumb.png.018107824802a20377c954138359f63c.png

The image above shows the setup: the arrow represents the player's expected direction of movement through each location; the narrow box represents the trigger brush which initiates the teleportation; the large box represents the teleportation zone from which everything that can move gets teleported; the red cross represents the origin of the teleportation zone used to calculate the teleportation vector.

To setup, copy the script into your map script or add it to your /script folder. Copy a pair of altogether 4 trigger brushes to your 2 identical-looking locations and change the "zone_departure" and "zone_destination" spawnargs on each of the narrow trigger brushes to point to the trigger zone brushes.

With this new version of the script, it should be possible to have as many mass teleportation setups in your map as you want, and rotation should be no problem given the fully automatic calculation of the teleportation vector.

mass_teleport.scriptmass_teleport.map

  • Like 3
  • Thanks 1
Posted (edited)
On 8/24/2025 at 4:20 PM, Dragofer said:

The narrow brushes are in slightly different positions at either location to avoid that the player gets stuck in an infinite teleportation loop.

I was wondering if instead a trigger facing could be used. So the player teleports when turning around. I guess it doesn't really matter though. In the end there's probably no benefit.

Well except that the teleportation does not take place when you move into it backward or sideways..

Well I guess you can make changes very immidiate. Also, I was thinking you could make the teleportation happen during turning instead. So for example you have a corridor. When you turn and face one of the walls, you get teleported so you don't see the other side of the previous room where you teleport from.

Edited by datiswous
Posted
10 hours ago, datiswous said:

I was wondering if instead a trigger facing could be used. So the player teleports when turning around. I guess it doesn't really matter though. In the end there's probably no benefit.

Well except that the teleportation does not take place when you move into it backward or sideways..

Yeah I think something like that would run into a bunch of edge cases. Another one could be players with an ultra wide monitor and a higher FOV being able to see the transition. The advantage of the basic trigger brushes to initiate the teleportation is that there should only be one, predictable way they can work, and they also have a minimal resource footprint.

10 hours ago, datiswous said:

Well I guess you can make changes very immidiate. Also, I was thinking you could make the teleportation happen during turning instead. So for example you have a corridor. When you turn and face one of the walls, you get teleported so you don't see the other side of the previous room where you teleport from.

That could make sense for a dead end where you want the player to leave at a different place than where they entered.

  • Like 1
  • 1 month later...
Posted (edited)

@DragoferI have this working now in map together with an x-ray screen. So you look via a tunnel to the other side that looks different, then you walk through the tunnel and gets teleported to that other looking place..

1. There is a whoble in the teleportation. Any idea why that would be? I think you don't end up in the same place on the other side. I had to recreate the triggerboxes.

2. Is it possible to make it so that I can only teleport while entering from one side of the tunnel? Currently I can walk around the tunnel and walk into the tunnel from the other side and still get teleported, but I want it to then do nothing from that side.

newmiss(2025-10-2101-23-52)(122.03196.52-25.75).jpg.df5efe373346f0b73468e67146139af5.jpg

newmiss(2025-10-2101-24-11)(691.78454_884.25).jpg.529d4fe94055ff4a8eff4890127bae08.jpg

xrayport.map

Edited by datiswous
  • Like 1
Posted (edited)

My approach would be a bit elaborate and require few small cripts:

1) teleporting will check the difference between player's origin and this doorframe model origin, and add the same difference to doorframe model's origin in second room.

2) The one sided teleport: you need an invisible, fast moving "door"; trigger_multiple on one side calls little script that just $spec_door.Open();

the oposite trigger_multiple $spec_door.Close(); it. The teleport trigger_multiple in the middle checks if($spec_dood.isOpen()) to know if it should teleport player.

trigger_multiple have even "call" spawnarg for scriptfunctions.

 

void close_teleport()
{
$spec_door.Close();
}

void open_teleport()
{
$spec_door.Open();
}

void use_teleport()
{
if($spec_door.isOpen()){
$spec_door.Close();

vector difference = $player1.getOrigin() - $first_doorframe.getOrigin();
difference = $second_doorframe.getOrigin() + difference;
$player1.setOrigin(difference);
}
}

 

Edited by ERH+
  • Thanks 1

S2wtMNl.gif

Posted
On 8/24/2025 at 4:20 PM, Dragofer said:

The narrow brushes are in slightly different positions at either location to avoid that the player gets stuck in an infinite teleportation loop.

I still have/had this issue, but it's good to know what's cousing it and how to fix it.

I also found that if the triggerbrush is too thin it doesn't work.

Posted

@datiswous Interesting to see someone giving portals another go.

Regarding making it a "one-approach" teleport, an approach could be to use the direction of the player's velocity and a pair of small trigger brushes within the doorframe. The idea would be the player has to step into brush 1, then into brush 2 with a velocity +x for the teleport to trigger. If his velocity at any time becomes -x (which happens if he steps into brush 1, then goes back out and around the doorframe and walks into brush 2), he has to go back to brush 1 again.

Behind the scenes, stepping into brush 1 would set a global variable to 1, i.e. "can_teleport". While the variable is 1, a looping script would check every frame whether the player's velocity is -x, setting the variable back to 0. Stepping into brush 2 would check whether the global variable is 1. If yes, teleport the player.

The teleportation offset is handled by subtracting the origins of the teleport zones from each other. If the brushes were changed, the position of their origin relative to their doorframe may also have changed and you get a noticeable displacement.

Posted (edited)
5 hours ago, Dragofer said:

Regarding making it a "one-approach" teleport

Thanks for the info. I got it working using a trigger-facing (didn't have to change anything to the script). I think that is the simplest approach for this specific situation. I get that in other situations it might be unreliable, but here it's a one way tunnel.

I also made it so that when you walk around you cannot enter (this is purely optional).

newmiss(2025-10-2400-10-18)(489.88208_74.25).thumb.jpg.3fee76520f16a939c31ae5a05ff98728.jpg

I made that backpart solid 1. When you walk into the front, you get teleported, but when after teleporting to the other side you walk backwards, you hit that wall. But if you turn around, you get teleported again. So it works alright.

xrayport.map

Edited by datiswous
  • Like 1
  • 7 months later...
Posted

Is it actually possible to make an NPC throw a flashbomb using scripting? Or interact with weapons other than swords, knives, or arrows?

2027/28 (Possibly prepping)

subpx.png.f5f46728702be3eaa0cd8d5101c2c14a.png

taffer sandwich and 1 layer cake , a nice bollen cake , four pulpy and squishy croquettes , baked potato and a cup of medium-roasted java preanger,bajawa,  panama or peruvian geisha or gayo coffee

Posted
On 6/10/2026 at 3:35 PM, Zerush said:

With stones and arrows they can, if you are out of their reach seeing you.

okay then 

Now I'm curious about how to create a massive explosion effect

 

2027/28 (Possibly prepping)

subpx.png.f5f46728702be3eaa0cd8d5101c2c14a.png

taffer sandwich and 1 layer cake , a nice bollen cake , four pulpy and squishy croquettes , baked potato and a cup of medium-roasted java preanger,bajawa,  panama or peruvian geisha or gayo coffee

Posted
On 6/6/2026 at 4:46 PM, taffernicus said:

Is it actually possible to make an NPC throw a flashbomb using scripting? Or interact with weapons other than swords, knives, or arrows?

Yes, it may be enough to just change the def_projectile spawnarg. The flashbomb might have some unique scripting that depends on player inputs, but in that case it would be possible to clone the rock projectile, give it a flashbomb model and make it cause a flashbomb effect when it hits something.

Likewise, you can change the weapon and arrow projectile spawnargs. As long as the new entity can function as a weapon (the right spawnargs in its entityDef, a collision model etc.) it will work. We have a selection of non-standard weapons in the core assets already.

Posted

Can you also set a max amount and then the ai turns to stones? In fact I think it would be better if ai's have an amount of something before they have to revill, or is that too realistic?

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

    • jaxa

      Talk GabeCube:
      https://forums.thedarkmod.com/index.php?/topic/18055-2016-cpugpu-news/page/39/#findComment-508710
      · 1 reply
    • The Black Arrow

      Things have been so bad these days for me...
      Just a year ago, I've been feeling dizzy, I thought it was nothing, today's stress, that type of thing, went to sleep...Still dizzy! 9 more days dizzy, went to doctor (I would have gone on the first day if NOT for the long appointment time)
      Said it may be Neck Dizziness...I did exercises for 6 months, no changes.
      Went to a Physical Therapist, went to another, no changes.
      I've asked my doctor for a full check this time.
      I hated yesteryear so much due to personal reasons, this year might be the same.
      To be brutally honest, I'd rather have cancer or/and chronic pain than suffer dizziness any second longer, especially when nothing helps.
      Hard to enjoy Thief when you're dizzy so I was hoping this year, Winter will be best for me.
      · 7 replies
    • JackFarmer

      Hello mappers and taffers! 

      Are you still out there? It is so calm here these days and I am afraid this is no good sign.
      Proof me wrong, tell your best friend (=me), that you are still here and that you will not go away!
      · 5 replies
    • JackFarmer

      Happy Labour Day, my taffing taffers & hard working mapping friends!
      And remember the poor souls who, within the Inventors’ organization, labor under Jonus’s yoke to ensure the success of that very guild! Always remember the hard workers!
      · 2 replies
    • datiswous

      Is there a script command to make a screenshot?
      I just though it could be interesting to be able to create a screenshot at a certain point in time. Then use that screenshot possibly in a debrief.
      I guess the second question is: Can you use a (in-game made) screenshot in a (debrief) gui?
      · 1 reply
×
×
  • Create New...