Final 2 questions I hope :-)

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Final 2 questions I hope :-)

Post by Drofder2004 » July 20th, 2010, 4:55 pm

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Final 2 questions I hope :-)

Post by Rezil » July 20th, 2010, 5:02 pm

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.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Final 2 questions I hope :-)

Post by Drofder2004 » July 20th, 2010, 7:20 pm

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Final 2 questions I hope :-)

Post by Rezil » July 20th, 2010, 7:27 pm

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.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: Final 2 questions I hope :-)

Post by <LT>YosemiteSam[NL] » July 20th, 2010, 7:51 pm

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

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: Final 2 questions I hope :-)

Post by <LT>YosemiteSam[NL] » July 21st, 2010, 12:05 pm

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 ?

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Final 2 questions I hope :-)

Post by Rezil » July 21st, 2010, 4:14 pm

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
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: Final 2 questions I hope :-)

Post by <LT>YosemiteSam[NL] » July 21st, 2010, 4:25 pm

:)
Where can I get the cushion texture ?

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Final 2 questions I hope :-)

Post by Rezil » July 21st, 2010, 4:55 pm

jm_castle.iwd
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: Final 2 questions I hope :-)

Post by <LT>YosemiteSam[NL] » July 21st, 2010, 6:14 pm

ok thx

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

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: Final 2 questions I hope :-)

Post by IzNoGoD » August 15th, 2010, 10:35 pm

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.
LMGTFY!

Its not a glitch... Its the future!

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: Final 2 questions I hope :-)

Post by <LT>YosemiteSam[NL] » August 15th, 2010, 11:52 pm

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.

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Final 2 questions I hope :-)

Post by megazor » August 16th, 2010, 2:58 am

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.

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: Final 2 questions I hope :-)

Post by IzNoGoD » August 16th, 2010, 8:22 am

Is there any way to enable cheats without devmap?
thx
LMGTFY!

Its not a glitch... Its the future!

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: Final 2 questions I hope :-)

Post by <LT>YosemiteSam[NL] » August 16th, 2010, 9:29 am

Don't think so m8. To my knowledge "devmap = cheats on" and "cheats on = devmap"

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests