Would this be possible?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Would this be possible?

Post 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
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post 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
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post 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?
User avatar
Apothem
Posts: 2070
Joined: Sat Nov 29, 2003 7:13 pm
Location: Performing open heart surgery on an ACS compiler.

Post 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:
User avatar
Enjay
 
 
Posts: 27374
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post 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;
	}
			
}
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post by ace »

Okay, I'll try that... once I get around to it. :p
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post 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?
User avatar
Enjay
 
 
Posts: 27374
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post 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.
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post 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. :?
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Include ONLY zcommon.acs: It includes "zdefs.acs","zspecials.acs" and "zvars.acs".
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post 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?
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post 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 );
}
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post 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. :?
User avatar
Enjay
 
 
Posts: 27374
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post 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.
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post 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. :(
Locked

Return to “Editing (Archive)”