Need help with my target range map

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

Moderator: Core Staff

Post Reply
ReDoX
CJ Wannabe
CJ Wannabe
Posts: 1
Joined: August 25th, 2012, 2:01 pm

Need help with my target range map

Post by ReDoX » August 25th, 2012, 2:34 pm

Im making a target range map. I made the targets, and I linked every trigger to its target and I scripted the targets to randomly come up one at a time. Now what I want is that when a player shoots the target, his score increases. (The score that is shown when you hold tab) Is that possible without modding? Is it possible at all?

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

Re: Need help with my target range map

Post by Drofder2004 » August 25th, 2012, 2:58 pm

Code: Select all

target waittill("damage", player);
player.score += scorePerTarget; 
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

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

Re: Need help with my target range map

Post by megazor » August 25th, 2012, 3:55 pm

In cod1, damage triggers can work with both "trigger" and "damage" notifies. With "damage", I was unable to get the entity that would cause damage. On the other hand, with "trigger", I only got the entity and couldn't get damage points. So maybe Drofder's code won't work and mine will do.

Code: Select all

target waittill("trigger", player);

player.score += scorePerTarget;

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

Re: Need help with my target range map

Post by Drofder2004 » August 25th, 2012, 4:42 pm

megazor wrote:In cod1, damage triggers can work with both "trigger" and "damage" notifies. With "damage", I was unable to get the entity that would cause damage. On the other hand, with "trigger", I only got the entity and couldn't get damage points. So maybe Drofder's code won't work and mine will do.

Code: Select all

target waittill("trigger", player);

player.score += scorePerTarget;
In CoD1

Code: Select all

ent waittill("damage", idamage, player);
I believe would retrieve the amount of damage and then the player.
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

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

Re: Need help with my target range map

Post by megazor » August 26th, 2012, 2:47 am

Ye, i did try something like

trig waittill("damage", lol, omg, wtf, etc);

but i couldn't get it.

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

Re: Need help with my target range map

Post by Drofder2004 » August 26th, 2012, 5:43 am

megazor wrote:Ye, i did try something like

trig waittill("damage", lol, omg, wtf, etc);

but i couldn't get it.
Hmm, maybe it was introduced in UO or CoD2. I have definitly done it pre-CoD4.
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

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

Re: Need help with my target range map

Post by megazor » August 26th, 2012, 11:12 am

Yes, it works in CoD2 and therefore, obviously, in next cod games. Just tested. Sexy developers.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests