Page 3 of 5

Re: Final 2 questions I hope :-)

Posted: July 20th, 2010, 4:55 pm
by Drofder2004

Code: Select all

if (timeleft < 301) 
   timeleft = 1000;

return timeleft;
What is this 1000 thing all about, this is killing the code...


Code: Select all

while (timeleft() > 301)
   wait 1;
---
Pseudocode:
While the timeleft (If the time left is less than 301, pretend its 1000) is greater than 301, wait one second.
---

So everytime timeleft() is called, you program is saying, "there is less than 300 seconds left, but I am going to say 1000" and then the loop is thinking, well there is 1000 seconds remaining, I will wait another seconds and check again... rinse and repeat... forever.

Code: Select all

 if (timeleft < 301) timeleft = 1000;   //if timelimit is less than 5 minutes, do not let the script print anything to players
This whole line needs to go.

Re: Final 2 questions I hope :-)

Posted: July 20th, 2010, 5:02 pm
by Rezil
Sorry was at work, will look at it.

EDIT: What Drof said. Also it would be better just to do:

Code: Select all

while(timeleft()==300) {
  players[i] playsound("blah");
  wait 1;
}
Define players before, not later.

Re: Final 2 questions I hope :-)

Posted: July 20th, 2010, 7:20 pm
by Drofder2004
Rezil wrote:Sorry was at work, will look at it.

EDIT: What Drof said. Also it would be better just to do:

Code: Select all

while(timeleft()==300) {
  players[i] playsound("blah");
  wait 1;
}
Define players before, not later.
Your while loop is wrong.

The loop will not start because timeleft is not equal to 300 when it starts.
I also disagree with the defining players also, reason being, players are dynamic, in the sense they can leave the server. If you define the player list early and someone leaves, the player list is now wrong and could cause errors.

Re: Final 2 questions I hope :-)

Posted: July 20th, 2010, 7:27 pm
by Rezil
My bad. I meant this:

Code: Select all

for(;;)
{
	if(timeleft()==300)
	{
		players[i] playsound("blah");
		break;
	}
	wait 0.05;
}
About players being dynamic: Check every frame for an updated list.

Re: Final 2 questions I hope :-)

Posted: July 20th, 2010, 7:51 pm
by <LT>YosemiteSam[NL]
Thx guys it works like a charm now !
And if I change the timelimit of the map it also works !
Textures almost done, a loadingscreen....and I'm finished with the map 8) :D

Re: Final 2 questions I hope :-)

Posted: July 21st, 2010, 12:05 pm
by <LT>YosemiteSam[NL]
Still one small problem (it's annoying realy).
I changed the falldamage on the textures but when I jump into the big poisonpool from way up I still die instantly (not by the hurt trigger) due to falldamage. I'm sure (checked it a few times) I changed the texture which is the floor of the pool but still you die.
Normaly I wouldn't be bothered with this but the part of a mod I used in the map makes it so when you die of falldamage the sound "Monsterkill" plays at 4x the normal sound volume ! :shock:

The poisonpool has a hurt_trigger and a water_clip at the bottom...maybe that is the problem ?

Re: Final 2 questions I hope :-)

Posted: July 21st, 2010, 4:14 pm
by Rezil
The game probably registers you hitting the pool brush which is not changed to nofalldamage I assume. Try redoing that texture too. If it doesn't work, just stick a cushion texture at the bottom of the floor(you shouldn't be making footsteps in water anyway) :P

Re: Final 2 questions I hope :-)

Posted: July 21st, 2010, 4:25 pm
by <LT>YosemiteSam[NL]
:)
Where can I get the cushion texture ?

Re: Final 2 questions I hope :-)

Posted: July 21st, 2010, 4:55 pm
by Rezil
jm_castle.iwd

Re: Final 2 questions I hope :-)

Posted: July 21st, 2010, 6:14 pm
by <LT>YosemiteSam[NL]
ok thx

I posted a download link to my map in the other topic.

Re: Final 2 questions I hope :-)

Posted: August 15th, 2010, 10:35 pm
by IzNoGoD
Hi guys,
Sorry to revive this old thread, but i am currently working on some defrag mod, maybe i can port it to deck16 too.

Thing is, i want the bg_falldamage thing in the mod, but it only works on devmap, as it is cheat protected.

Are there any ways to force bg_falldamagemax/minheight on non-devmaps?
tried

Code: Select all

setCvar( "bg_fallDamageMinHeight", "99998" );
setCvar( "bg_fallDamageMaxHeight", "99999" );
in gsc file already

Removing the damage from the fall is not an issue, got that sorted already, but its the slow that comes with the damage that is annoying.

Re: Final 2 questions I hope :-)

Posted: August 15th, 2010, 11:52 pm
by <LT>YosemiteSam[NL]
I wanted that aswell but it can't be done without cheats on.
What I did was make every texture you can land on "nofalldamage", but you have to rework all maps :shock: and I don't think that's an option in your case.

Re: Final 2 questions I hope :-)

Posted: August 16th, 2010, 2:58 am
by megazor
The sounds plays the first time the map is played but when I restart the map it doesn't play anymore
does to me for some reason. this is what i did (cod1):

pasted the code from your post (not drof's one) and added to my map's level script. ran my map at gametype DM.
then i set the timelimit to 5.1 in order not to wait long. upon 5 minutes it printed the message (the only thing i changed was use of message, not sound). i then restarted the map with the console. upon 5 minutes left it announced it again. well therefore i dont understand what is wrong in the code.

Re: Final 2 questions I hope :-)

Posted: August 16th, 2010, 8:22 am
by IzNoGoD
Is there any way to enable cheats without devmap?
thx

Re: Final 2 questions I hope :-)

Posted: August 16th, 2010, 9:29 am
by <LT>YosemiteSam[NL]
Don't think so m8. To my knowledge "devmap = cheats on" and "cheats on = devmap"