Jump to content


Photo

Fading in player's view on spawn - how?

scripting effects

11 replies to this topic

#1 motorsep

motorsep

    Advanced Member

  • Member
  • PipPipPip
  • 884 posts

Posted 11 December 2014 - 10:11 AM

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.

#2 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 11 December 2014 - 10:23 AM

At a complete guess I assume how ever you do it, it will have to be scripted.

#3 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 860 posts

Posted 11 December 2014 - 10:36 AM

If it can be done without scripting, I'd guess at something involving a couple of http://wiki.thedarkm...rs#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


#4 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 11 December 2014 - 10:45 AM

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.

#5 motorsep

motorsep

    Advanced Member

  • Member
  • PipPipPip
  • 884 posts

Posted 11 December 2014 - 11:27 AM

.... with the setup targetted by worldspawn.


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

#6 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 860 posts

Posted 11 December 2014 - 11:32 AM

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

Edited by VanishedOne, 11 December 2014 - 11:33 AM.

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#7 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 12 December 2014 - 12:30 PM

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, 12 December 2014 - 12:33 PM.

"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

#8 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 860 posts

Posted 12 December 2014 - 12:57 PM

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, 12 December 2014 - 01:02 PM.

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#9 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 12 December 2014 - 01:19 PM

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

#10 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 860 posts

Posted 12 December 2014 - 01:38 PM

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


#11 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 12 December 2014 - 02:32 PM

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

#12 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 860 posts

Posted 12 December 2014 - 04:51 PM

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




Reply to this topic



  



Also tagged with one or more of these keywords: scripting, effects

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users