Ritualistic Forums

Ritualistic Forums (http://www.ritualistic.com/forums/index.php)
-   SiN, SiN Steam & Wages of Sin (http://www.ritualistic.com/forums/forumdisplay.php?f=10)
-   -   Is it possible to unfocus console? (http://www.ritualistic.com/forums/showthread.php?t=6902)

claudec 05-29-1999 03:51 AM

Is it possible to unfocus console?
I am having trouble with a console where it is possible for the player to be killed by interacting with it. What happens is that when killed they are still focused on the console such that they have to press esc before pressing fire to re-enter game. I noticed this effect after putting in a camera and targeting it with the console such that the player sees the console through camera. Also the players view does not stay on that camera after death. It goes to the info_spline sequence that begins with endnode1 (I don't know how else to describe this I thought it was refered to as the intermission camera but I found that the info_player_intermission doesn't need to be there at all. Just put in some daisy chained info_splines with the first one having the targetname endnode1 and when player dies after a few seconds there view will follow that path)
Also it is interesting to note that this happens when player is killed by rocket blast. It is also the case that when the player is hit once with rocket they are unfocused from console. When hit second time and killed they seem to stay focused.
The console activates one of 2 func_launchers aimed at info_notnull such that projectile impacts wall below console. I discovered that aiming at the player was tricky. The first rocket shot would strike player and the second would go past (weird). So I aimed at wall. One func_launcher fires a nukeball the other a rocket. When the player is killed by the nukeball then they don't have to press esc before pressing fire to re-enter game. When killed by rocket thay do. This is some odd behaviour. I would like to unfocus player before triggering func_launcher.

[This message has been edited by claudec (edited 05-29-99).]

eutectic 05-29-1999 10:11 AM

Re: Is it possible to unfocus console?
No, unfortunately I don't think this is possible. The only way to leave that console is to do it manually.

The Node

The official Sin entities and scripting reference site

claudec 05-29-1999 02:06 PM

Re: Is it possible to unfocus console?
Do you think it would work if I had text that told players to use esc if killed while using console? Could a stuffcmd or some other command be used to execute the esc for the player?

eutectic 05-29-1999 03:41 PM

Re: Is it possible to unfocus console?
No, doing this through a stuffcmd is the first thing I tried and it didn't work. That's what lead me to answer it can't be done in my first reply.


The Node

The official Sin entities and scripting reference site

BlindTypist 06-03-1999 03:53 PM

Re: Is it possible to unfocus console?
Sorry I didn't see your post before. I guess I must have overlooked it, since I have been on vacation.

It is slightly irritating that the player becomes "bound" to the computer, thus making it difficult for the player to defend against attack. In Claudecs case, I suspect the player "using" the computer triggers the projectiles.

There IS a way to force the player to be unbound from the computer, just as if he pressed the "use" button. It is a simple one line command. In Claudecs case, he could use this command just before the projectiles are fired.

Here is a sample script to show how it works:

thread let_go_luke

*1 exitcon %con_computer
wait 5
goto let_go_luke

Exitcon is the only command you really need. This script will loop over and over every 5 seconds. So if you walk up to the %con_computer and use it, the computer will automatically "kick" you away in 5 seconds or less.

I say "5 seconds or less" because this runs on the internal game clock. Thus it is constantly "kicking" every five seconds. If you use the computer 0.5 seconds before it kicks again, you will get kicked off immediately.

Notice this works for the *1 player. This wouldn't work in a multiplayer setting, since it would only kick *1 (player 1) and not *2 *3 *4, etc. I suppose you could enter a line for each player:

*1 exitcon %con_computer
*2 exitcon %con_computer
*3 exitcon %con_computer

Thus kicking EVERYONE off %con_computer simultaneously, whether thy are using it or not.(it won't affect users of other computers). It would be much better to kick ONLY the person who used that computer, and I am sure there is a way to do it, I just haven't messed with it yet.

There is an "entercon" command also, but it seems to cause problems just like the "enter" command for vehicles (see post about vehicles for more info on this one).

Hope this helps.

claudec 06-03-1999 07:32 PM

Re: Is it possible to unfocus console?
Hmm very interesting. It was to be in a DM map so I would need to kick every player off. I have seen the question of determining what player is interacting with something in MP touched upon before. So far it doesn't seem that anyone has figured that question out yet. Your solution of doing them all is a good work around though
Unfortunalty it has already been removed from the level and I am so close to release I don't want to make any major changes. However It is an idea that can be used in another level. If your interested here's the way it was supposed to work. On the console was the question "would you like to nuke somebody?" If they answered yes they were nuked (It said somebody never said who ha ha ha)and then using the stuffcmd command to isssue a "say" console command the player was made to say "Look at me. Look at me. I blew myself up. Look at me". If they answered no the the console message. It would change to "How about a rocket up the deriere then?" and a rocket was fired at thier deriere (ok i had it spelled right when I did it. no dictionary handy now). The the stuffcmd was used to cause the player to say "I love a hard rocket between my cheeks." Also while doing this I noticed that the player can't be hit directly when locked into the console. I was forced to shoot the rocket and the nuke at the wall below the console as the player can still recieve blast damage when locked into the console( I was using the camera trick where you have the console trigger a camera thats pointed at the console to make the console fill the players screen). This effect can also be observed if you try to shoot yourself with a guided missle (WOS) the missle will go right though you. Weird thing is I could swear that I have hit other players directly with the guided missle who were themselves driving guided missles and my guided missle exploded on their body. Oh well all I know is that there is funkyness with regards to players in a mode were they are looking through a camera (that's what the guided missle is right just a flying camera right?)
I appreciate your answer though it wasn't in time for Nukesville II, I do want to do my idea on another level. Also it would be cool to find out if there was a way to indentify the player who interacts with something. It would be even cooler if we could get at thier playername. I could see a console that addresses the player by name . Or a taunt billboard that taunts players by name - this could be done in CTF since we know the team names and we could have our billboard taunt the teams by name
Thanks for the help

eutectic 06-03-1999 09:33 PM

Re: Is it possible to unfocus console?
exitcon?!?.... WTF? ... never heard of THAT command. Let's give it a shot...

Well I'll be! It works!! Where the hell did you find that one??

Oh wait! The game console commandlist... Aha! That's where you found it, hehe... You're an ACE BlindTypist. Thanks for the heads-up man! If it hadn't been for your post, I would've totally overlooked it since it's not in the player.cpp source code as such.

Chalk up another one for the Node docs.

The Node

The official Sin entities and scripting reference site

BlindTypist 06-03-1999 09:57 PM

Re: Is it possible to unfocus console?
Actually I was looking through the gamex86.dll file, searching for reserved variable names. I wasn't even aware it was in the docs.

Some other commands besides exitcon were entercon, enter and exit. The last two are for vehicles, I think, but I can't quite get them to function correctly (see "tips and tricks- making vehicles" thread).

I can't get entercon to work either. Maybe I should check to see if it's in the docs.

claudec 06-05-1999 02:07 AM

Re: Is it possible to unfocus console?
game console commandlist - this is a new document for me. Were is it? I went through the scripting docs the section titled "SCRIPTING - CONSOLE CONTROL"
before I posted. I just looked at my printout again and the ones on-line. Still don't see it. Am I blind? is it in the scripting docs or is there another doc I don't know about?

eutectic 06-05-1999 10:33 AM

Re: Is it possible to unfocus console?
That's normal, claudec. You won't find it in the Node docs.

When I mentioned "game console command list". I meant the drop console you call with the ~ (tilde) key and not console entities.

The game console commands are typed straight at the console prompt after you call it.

For the game console, there are 2 types of commands: console commands and cvars (console variables). Again, this has nothing to do with console entities or scripting. I know the fact that we call both by the same name can be confusing at times.

In order to get the complete list of console commands, just type "cmdlist" at the console prompt. If you want to keep a list in a txt file, turn on the logfile option by typing the command "logfile 1", then type "cmdlist". The output from the console command will automatically be concatenated into a file named "qconsole.log" in the base folder of the game. Leave the game and open the file with a text editor. The full command list is in there. Then if you want to keep a handy record, rename the log file "cmdlist.txt".

Then if you want to have a cvar command list, you can repeat the procedure by enabling the logfile first and typing "cvarlist" at the console prompt. Leave the game and rename "qconsole.log" as "cvarlist.txt". Move or copy those files in a convenient folder if you wish. I moved them to the \tools\sin\docs folder but that's only a matter of personal preference.

A few pointers for listing console commands and cvars while in the game:

Let's say you're looking for a command but can't quite remember which. You know it starts with an "L" but you're not quite sure about the spelling, you can type a:

cmdlist l

This will list all the console commands that start with an "L". You can narrow your search by using more than 1 letter:

cmdlist lo

will list all the commands that start with the letters "lo". This also works with "cvarlist" BTW.

You can also invoke any console command to be run from a script with the "stuffcmd" command. For example, if you include the following command in your script:

stuffcmd "god"

This console command between double quotes gets passed to the game console and executed (this command is very useful for testing monsters behaviors while designing SP maps BTW). If your console command must include text between double quotes like the centerprint command for example, you must "escape" the second set of double quotes with a backslash character. For example:

stuffcmd "centerprint \"Hello!\""

The same technique is used in layout string commands BTW.

I hope this helps clear up the confusion between the game console and console entities.

The Node

The official Sin entities and scripting reference site

All times are GMT -5. The time now is 08:21 PM.

Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.