Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Wed Jun 19, 2013 10:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Touch-triggers?
PostPosted: Tue Mar 17, 2009 3:50 pm 
Offline
is connecting to Doom3world.org

Joined: Mon Mar 16, 2009 12:15 pm
Posts: 9
Hey there, I've been trying to get the camera thing I wrote about in my previous thread. I've managed to make alot of progress thanks to XPac_27's camera mod (viewtopic.php?f=56&t=19050&hilit=camera).

However, to make it all working I need to fix my triggers correctly. As of now, the view changes as it should, but it changes between the normal and my fixed view constantly. (because of me using a trigger_multiple)

To fix this I tried to use a Trigger_touch, but then it did nothing. Can anyone possibily help me?


Top
 Profile E-mail  
 
 Post subject: Re: Touch-triggers?
PostPosted: Tue Mar 17, 2009 5:44 pm 
Offline
Last man standing
User avatar

Joined: Tue May 24, 2005 8:12 pm
Posts: 1125
Location: Draakhavenkroft
Use a trigger_once instead of touch or you can add a value to to the trigger_multi that limits to how many times it can be activated, or at least the time between the next available retrigger could be infinite. I do not have doom 3 readily available for me to look and see.


Top
 Profile E-mail  
 
 Post subject: Re: Touch-triggers?
PostPosted: Wed Mar 18, 2009 11:59 am 
Offline
is connecting to Doom3world.org

Joined: Mon Mar 16, 2009 12:15 pm
Posts: 9
Doesn't really help, the problem right now is that if I do that then I can't go back to the same place I was before, since the camera can only be set once (if I use a trigger_once). And if I put a timer on it, it just keeps on going back and forth between Third-person and the Camera view.


Top
 Profile E-mail  
 
 Post subject: Re: Touch-triggers?
PostPosted: Wed Mar 18, 2009 3:06 pm 
Offline
Addict.
User avatar

Joined: Tue Nov 22, 2005 1:42 am
Posts: 2165
Location: France, 59
set a key/val to the player, something like "cam" "1", and make your trigger_multiple run a script that just check if "cam" different than "1", set the camera and "cam" to "1", else do nothing.
Each trigger will set a different value to "cam" for a different camera. This should work.

:)

_________________
idTech 4 still amaze me.

Doom III High Quality Mainmenu Pack.
Doom III Boss Contest: Alpha Lab Zero.
idTech4 Extended [Alpha].


Top
 Profile E-mail  
 
 Post subject: Re: Touch-triggers?
PostPosted: Thu Mar 19, 2009 9:12 am 
Offline
is connecting to Doom3world.org

Joined: Mon Mar 16, 2009 12:15 pm
Posts: 9
Right. I'll try, just hope that I understood exactly what you meant.

info_player_start now got a Key called "Cam" with Value "1"
same thing with Camera_view_1
Camera_view_2 got Value 2
and trigger got a key called "Call" with Value "Cam"
Have I done something right. (sorry, I know I'm not that good as this techincal stuff, I've only done maps and textures before.)


Top
 Profile E-mail  
 
 Post subject: Re: Touch-triggers?
PostPosted: Thu Mar 19, 2009 10:59 am 
Offline
Addict.
User avatar

Joined: Tue Nov 22, 2005 1:42 am
Posts: 2165
Location: France, 59
Sir Tobbii wrote:
info_player_start now got a Key called "Cam" with Value "1"
same thing with Camera_view_1
Camera_view_2 got Value 2
and trigger got a key called "Call" with Value "Cam"

Not really that. :D but i'll try to explain a similar method i'm thinking about:
- Make a Key "on" with a "0" value on all your cameras.
- Make a Key "call" with a "set_camera1" value on your camera1, a "set_camera2" value on your camera2, etc.
- Create a txt file next to your custom map, and rename it to mycustommapname.script (where mycustommapname is your map's name of course)
- Edit it with notepad and paste this:
Code:
//   Set camera 1 on
void set_camera1()
{
   if ( $Camera_view_1.getFloatKey ("on") == 0) { // check if the camera1 is not already "on", if not, proceed.
          sys.trigger ($Camera_view_1); // trigger your camera1
          $Camera_view_1.setKey("on", "1"); // set it "on"
          $Camera_view_2.setKey("on", "0"); // set camera2 not "on"
          $Camera_view_3.setKey("on", "0"); // set camera3 not "on"
          // etc, for all your cameras
   }
}

//   Set camera 2 on
void set_camera2()
{
   if ( $Camera_view_2.getFloatKey ("on") == 0) { // check if the camera2 is not already "on", if not, proceed.
          sys.trigger ($Camera_view_2); // trigger your camera2
          $Camera_view_2.setKey("on", "1"); // set it "on"
          $Camera_view_1.setKey("on", "0"); // set camera1 not "on"
          $Camera_view_3.setKey("on", "0"); // set camera3 not "on"
          // etc, for all your cameras
   }
}

//   Set camera 3 on
void set_camera3()
{
   if ( $Camera_view_3.getFloatKey ("on") == 0) { // check if the camera3 is not already "on", if not, proceed.
          sys.trigger ($Camera_view_3); // trigger your camera3
          $Camera_view_3.setKey("on", "1"); // set it "on"
          $Camera_view_1.setKey("on", "0"); // set camera1 not "on"
          $Camera_view_2.setKey("on", "0"); // set camera2 not "on"
          // etc, for all your cameras
   }
}

//   Main is the script executed when your map start.
void main()
{
}

This should do the job. maybe there are some more complex methods to only write 1 thread for every cameras, but i'm a beginner scripter. :D

_________________
idTech 4 still amaze me.

Doom III High Quality Mainmenu Pack.
Doom III Boss Contest: Alpha Lab Zero.
idTech4 Extended [Alpha].


Top
 Profile E-mail  
 
 Post subject: Re: Touch-triggers?
PostPosted: Thu Mar 19, 2009 1:31 pm 
Offline
is connecting to Doom3world.org

Joined: Mon Mar 16, 2009 12:15 pm
Posts: 9
It works perfect! Thank you so much!

I'll be sure to give you special thanks when we show our mod (should be soon enough) the first time. :D


Top
 Profile E-mail  
 
 Post subject: Re: Touch-triggers?
PostPosted: Thu Mar 19, 2009 3:07 pm 
Offline
Addict.
User avatar

Joined: Tue Nov 22, 2005 1:42 am
Posts: 2165
Location: France, 59
Sir Tobbii wrote:
It works perfect! Thank you so much!

Glad it worked! good luck! :wink:

_________________
idTech 4 still amaze me.

Doom III High Quality Mainmenu Pack.
Doom III Boss Contest: Alpha Lab Zero.
idTech4 Extended [Alpha].


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group