Jump to content
The Dark Mod Forums

Fading in player's view on spawn - how?


motorsep

Recommended Posts

Some games fade in player's view (from black) on spawn. I assume it's done to prevent player seeing certain things being spawns and such. So there is a delay between being spawned and seeing the world.

 

I have a few things, particles in particular, that begin emitting at t he same time player is spawned. It doesn't look appropriate as I'd like for particles to be at full capacity when player is spawned. So I figured if I have a delay and the gradual fade in from black on the view, then the issue would be resolved.

 

Is it something engine/game already provides (Doom 3) ? How can I achieve such effect ? Thanks.

Link to comment
Share on other sites

If it can be done without scripting, I'd guess at something involving a couple of http://wiki.thedarkmod.com/index.php?title=Triggers#trigger_fade (one with a very quick fade to keep the screen black initially), with the setup targetted by worldspawn.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

TDM runs 10 frames before the player gets to click the attack button to start, iirc. I'm not sure how that was achieved off hand but I've seen it in the code. So you could copy that. Or script it, there's a "Fade" script event for that purpose I think, which is probably how the triggers work too.

Link to comment
Share on other sites

Thanks, but what do you mean by that ^^ ?

 

Worldspawn triggers its target (I think it can have only one target) on mission start; you give it a target by selecting any worldspawn brush and giving it a target spawnarg as you would an entity. For example, in the map I'm making I have it pointing at a trigger_relay, which waits a moment and then triggers an atdm:gui_message to put a message on the screen at the start of the mission.

 

Edit: http://wiki.thedarkmod.com/index.php?title=Triggers#Triggering_via_Worldspawn

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Worldspawn triggers its target (I think it can have only one target) on mission start; you give it a target by selecting any worldspawn brush and giving it a target spawnarg as you would an entity. For example, in the map I'm making I have it pointing at a trigger_relay, which waits a moment and then triggers an atdm:gui_message to put a message on the screen at the start of the mission.

 

Edit: http://wiki.thedarkm..._via_Worldspawn

 

Just for the record: Such simple things like "wait a bit and then trigger a message" are literally 2 lines in the scripting code. No need for the trigger_relay and so on :) But I guess we really need a tutorial for scripting :)

 

And I think worldspawn can have many target spawnargs, if not, that would be a bug :)

 

Edit: And I forgot to mention, atdm:gui_message does support "auto_trigger" "1" and "delay" "2" and it would put up the message 2s after mission start. If that doesn't work as such, then that would also be a bug. "auto_trigger" is even documented, but "delay" not.

Edited by Tels

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Just for the record: Such simple things like "wait a bit and then trigger a message" are literally 2 lines in the scripting code. No need for the trigger_relay and so on :)

 

It's a matter of taste; since this map doesn't have an init script already, it was simpler for me to drop a couple of entities into DR.

 

And I think worldspawn can have many target spawnargs, if not, that would be a bug :)

 

It's what's claimed in the wiki page I linked; for all I know it may be out of date.

 

And I forgot to mention, atdm:gui_message does support "auto_trigger" "1" and "delay" "2" and it would put up the message 2s after mission start. If that doesn't work as such, then that would also be a bug. "auto_trigger" is even documented, but "delay" not.

 

I tried "delay" on the message entity initially and as far as I remember, no, it didn't work. (Also, I may later want to set up other things on mission start, in which case having them all triggered through the same relay would help keep things organised.)

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

It's a matter of taste; since this map doesn't have an init script already, it was simpler for me to drop a couple of entities into DR.

 

Sure, but for me often scripting is easier :)

 

I tried "delay" on the message entity initially and as far as I remember, no, it didn't work. (Also, I may later want to set up other things on mission start, in which case having them all triggered through the same relay would help keep things organised.)

 

You need "auto_trigger", too. The spawnargs are generally documented on the entities, so you can look them up in DR. The wiki page is probably not uptodate.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

You need "auto_trigger", too.

 

I had it targetted by worldspawn; are you saying "delay" is inert when the message entity is triggered by something else in the map?

 

Checking in DR, the description for "delay" on a message entity is

 

Initial delay in milliseconds. (wait time before the first event happens).

 

whereas "delay" on a trigger_relay is

 

seconds to wait before firing after triggered.

 

but I can't tell from that wording whether "delay" on a message entity is supposed to be inert when the entity is triggered by something else.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

It is supposed to work like that:

 

* triggering happens (or "auto_trigger" is "1" and the entity spawns

* "delay" seconds pass

* the message appears

 

So, if you put "delay" on the message entity and targeted it from worldspawn (or from a relay or a trigger), that is supposed to show the message after X seconds after the triggering.

 

Likewise, if you target the entity not at all,but put "auto_trigger" "1" on it and delay "2", the message is supposed to show after 2 seconds.

 

Does that make it clearer? The "delay" spawnarg in TDM entities usually applies to "x seconds delay after trigger event the action starts".

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Right, so I'm not supposed to need auto_trigger if I've another trigger set up.

 

However, a quick check in a test map suggests that the "delay" and "auto_trigger" combination works as expected, and so does my setup with a trigger_relay, but targetting the message entity from worldspawn produced no message at all, with or without a delay.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 1 reply
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...