Page 1 of 3

Would this be possible?

Posted: Sun Jul 03, 2005 7:44 pm
by ace
Would it be possible to make a script that changes which camera you're looking at on a screen, and how long a time limit is, depending on what skill level you're on (using an IF statement or otherwise)? Or am I just being crazy and unrealistic? :p

Posted: Sun Jul 03, 2005 7:53 pm
by Xaser
Yes, actually... I'm not sure how, but there is a way to check what skill level you're playing on. I don't quite know how to do it, though... someone will know. :P

Posted: Sun Jul 03, 2005 8:00 pm
by ace
I thought it would be possible...

See what I'm doing, is I'm going to make a level where you're on a falling air-transport, and you have to get out of it before it's too late. In order to make it look like it's falling, one side of it will have windows of a sky texture scrolling left, the other side scrolling right, the back exit I think I will use some sort of skybox or something, and the front windsheild will have a screen viewing a camera that is zooming in towards a wall that will (hopefully) resemble a ground texture. And then somehow, I will try to sync the video with the time limit (really all depends on the length of the sector) with the time limit so that when the counter hits zero, the camera hits the wall.

Now, for harder skill levels, I will make another sector that is shorter, and make the time limit shorter, so it all is over with faster. This is going to be tough, but it IS possible, right?

Posted: Sun Jul 03, 2005 9:54 pm
by Apothem
Yeah i think so, i think you can just set the difficulty flags on the thing, check the wiki for getting difficulty settings. Remember, the wiki is your friend :lol:

Posted: Mon Jul 04, 2005 4:00 am
by Enjay
I think this is correct:

Code: Select all

script 1 (void) 
{
	if (gameskill() == SKILL_VERY_EASY)	 
	{
	Do stuff;
	}
		
	if (gameskill() == SKILL_EASY)	 
	{
	Do other stuff;
	}
					
	if (gameskill() == SKILL_NORMAL)  
	{
	Do harder stuff;
	}
				
	if (gameskill() == SKILL_HARD)    
	{
	Do tough stuff;
	}
		
	if (gameskill() == SKILL_VERY_HARD)    
	{
	Do impossible stuff;
	}
			
}

Posted: Mon Jul 04, 2005 7:35 am
by ace
Okay, I'll try that... once I get around to it. :p

Posted: Tue Jul 05, 2005 8:15 pm
by ace
Bump. I now tested it out, and I got the time limit for skill_very_easy completed, and it all works fine. It counts down, in the upper right-hand corner, from two minutes, and when it hits "0:00" it is supposed to kill the player(s).

However, it doesn't kill the player(s). Instead, the timer stays at 0:00 for 100000 holdtime, like it should, then clears, but the player(s) don't die. To do this, I used

Code: Select all

script 1 OPEN
{
    if (gameskill() == SKILL_VERY_EASY)
    {
         // a couple hundred lines of timer code
         ...
         Thing_Destroy (1, 0);
    }
}
According to the Wiki Thing_Destroy can kill players, and according to DoomBuilder the TID for Player 1 start is 1. But when I test it... nothing! Am I doing something wrong?

Also, I can't seem to get the SetFont to work. In the script at the beginning I put "SetFont (BIGFONT);" but then it wouldn't compile, saying "the identifier has not been declared." I think I saw on the wiki that the phrases for font are included in zdefs.acs, but when I #include that it gets an error message:

Code: Select all

 
 Line 10 in file "zdefs.acs" ...
 zdefs.acs:10: Invalid identifier.
 > #define TRUE 
 >            ^
 
 The ACS compiler did not compile your script.
Any help on this as well?

Posted: Wed Jul 06, 2005 4:31 am
by Enjay
Try making your script an enter script rather than a open one. Open scripts are run by the world. Enter scripts are run by the player as he enters.

Also, players can be given tids, but it is not done by giving the start spot a tid, you need to do it via a script. It's been mentioned a few times. I can't remember the syntax but do a search and you should find it.

As for your error messages, my guess is that you don't have this at the start of your script:

#include "zcommon.acs"

Or that the file zcommon.acs and the other z*.acs files are not in the same directory as everything else.

Posted: Wed Jul 06, 2005 7:09 am
by ace
I'll check around for the TID mentions. But as for the error message, I do have #include "zcommon.acs" at the top. I only get that error when I add zdefs.acs, and they are all in the same folder. :?

Posted: Wed Jul 06, 2005 7:30 am
by TheDarkArchon
Include ONLY zcommon.acs: It includes "zdefs.acs","zspecials.acs" and "zvars.acs".

Posted: Wed Jul 06, 2005 7:56 am
by ace
Oh... alright then. Also, I found the issue with the BIGFONT line: I forgot to put BIGFONT in quotes, heh. :p

Still, I can't seem to find anything mentioning how to set the players' TIDs. I found a few *relevant* things, but sadly nothing direct. Any help?

Posted: Wed Jul 06, 2005 3:39 pm
by Zippy
ace wrote:Oh... alright then. Also, I found the issue with the BIGFONT line: I forgot to put BIGFONT in quotes, heh. :p

Still, I can't seem to find anything mentioning how to set the players' TIDs. I found a few *relevant* things, but sadly nothing direct. Any help?
Have the player activate a script and then use Thing_ChangeTID( 0, ### ). The 0 specifies that the activator should have its TID changed (in this case, the player) to whatever TID number you put for ###.

The simplest place to do this would be in an ENTER script.

Code: Select all

script 5 ENTER {
    Thing_ChangeTID( 0, 1234 );
}

Posted: Wed Jul 06, 2005 7:29 pm
by ace
That didn't work... it compiles, but when I test it there is a message that says there is no player 1 start, and there is DEFINITELY a player 1 start. :?

Posted: Wed Jul 06, 2005 7:33 pm
by Enjay
Make sure your player1 start doesn't have any arguments set. If it does, the game tries to treat it like a player1 start that has been specified from another map - like in a hub where there may be multiple entry points to a level - and will not start a game from that start spot.

Posted: Wed Jul 06, 2005 7:47 pm
by ace
There are definitely no arguments; the set action is 80 (H Script Execute), the script number is 1, the map number is 0 (current map), and all of the arguments are 0. Yet, it still doesn't work. :(