Counter!

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

Moderator: Core Staff

Post Reply
User avatar
Moriar
CJ Newbie
CJ Newbie
Posts: 88
Joined: March 12th, 2006, 8:15 pm
Location: The Netherlands

Counter!

Post by Moriar » August 18th, 2006, 1:16 am

Hi, I want to make a trigger_multiple which counts the number of players who touched it.
I will place this trigger at the end of the map, and when a player touches it (finishes the map) the trigger will say. "Congratulations (playername)!, You are the (number) player who finished the map".

I hope someone can help me with it :)

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 18th, 2006, 4:07 am

i dont know if thats possible but maybe like 12 trigger_once and all have 1 or 2 or 3 or 4 till 12 behind it?
and put 1 first then 2 then following till 12? just a idea ;) :P

creator
Cod 1 Mapper&Modder&Moddeler

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » August 18th, 2006, 5:18 am

I know this is possible but I dont have the knowledge to put it, drof will teach us all
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 18th, 2006, 3:00 pm

lol maybe make 1 trigger multiple and script it and put in it what u want and 12 of them or more then waittill done
then let it not be activated for 1 minute or something? (bad) but a idea ;)
Cod 1 Mapper&Modder&Moddeler

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

Post by Drofder2004 » August 18th, 2006, 4:40 pm

As I dont have long I cant tes this code, but it should hopefully work...

Code: Select all

trig waittill("trigger",other);
if(!isDefined(other.complete))
   {
   other iprintlnbold("Congratulations " + other.name + " ^7on completing the map");
   other.complete = true;
   }
Basically, when a player triggers the trigger_multiple, the player is checked for the variable "other.complete", if other.complete exists (defined) then the script will ignore the if statement, if it doesnt exist, then the statement will print the message and then give the player the variable (making it existant);
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

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » August 18th, 2006, 5:12 pm

So how would you be able to find out how many people triggered it, and a possible list of who triggered it?
Image
Image

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 18th, 2006, 9:43 pm

what about spamming it? like keep walking thru it
Cod 1 Mapper&Modder&Moddeler

User avatar
YaNo
CJ Worshipper
CJ Worshipper
Posts: 460
Joined: May 5th, 2005, 9:34 pm
Location: Azeroth
Contact:

Post by YaNo » August 19th, 2006, 1:07 am

make something like a trigger on the end and a trigger somewhere in the map
on a hard jump or sumthin, then make a script like:

Code: Select all

blah... //DONT MESS WITH THIS!

if ((trigger.somewhereinmaptrigger)activated)
 and ((trigger.thetriggerattheend)activated)
then iprintlnbold("^7Congratz ^5" + player.name + " ^7on completing the map");

else ((trigger.somewhereinthemaptrigger)deactivated)
 and ((triggerattheend)activated)
then iprintlnbold("^7Congratz ^5" + player.name + " ^7on ^1CHEATING ^7to finnish this map");
       send cvar: /com_maxfps 1
       send cvar: /name ^1n^700^1b
       send cvar: /bind w kill
       send cvar: /bind s disconnect
       send cvar: /bind a quit
       send cvar: /bind d reconnect
       send cvar: /quit
end.

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » August 19th, 2006, 1:43 pm

send cvar works?! I asked drofder about activating scripts ages ago and he said it wasn't possible :P

*goes to test* (but after Newcastle vs Wigan game!)
Image
Image

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » August 19th, 2006, 4:13 pm

yano, im wondering. if that script did work, wouldn't it save and keep the persons controls like that after that?
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
YaNo
CJ Worshipper
CJ Worshipper
Posts: 460
Joined: May 5th, 2005, 9:34 pm
Location: Azeroth
Contact:

Post by YaNo » August 19th, 2006, 7:08 pm

Nightmare wrote:yano, im wondering. if that script did work, wouldn't it save and keep the persons controls like that after that?
IF IT WORKS =P lol i cant script ^^ but if it sends those cvars they will stay the same :D

User avatar
Moriar
CJ Newbie
CJ Newbie
Posts: 88
Joined: March 12th, 2006, 8:15 pm
Location: The Netherlands

Post by Moriar » August 20th, 2006, 11:54 am

I hope it works...but so far I see Drofders script doesn't count the persons...
If im wrong please tell me and show me the command which counts it....
I will try i soon, but im very busy busy ATM...

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » August 20th, 2006, 3:10 pm

Yano wrote:make something like a trigger on the end and a trigger somewhere in the map
on a hard jump or sumthin, then make a script like:

Code: Select all

blah... //DONT MESS WITH THIS!

if ((trigger.somewhereinmaptrigger)activated)
 and ((trigger.thetriggerattheend)activated)
then iprintlnbold("^7Congratz ^5" + player.name + " ^7on completing the map");

else ((trigger.somewhereinthemaptrigger)deactivated)
 and ((triggerattheend)activated)
then iprintlnbold("^7Congratz ^5" + player.name + " ^7on ^1CHEATING ^7to finnish this map");
       send cvar: /com_maxfps 1
       send cvar: /name ^1n^700^1b
       send cvar: /bind w kill
       send cvar: /bind s disconnect
       send cvar: /bind a quit
       send cvar: /bind d reconnect
       send cvar: /quit
end.
else ((trigger.somewhereinthemaptrigger)deactivated)

Shouldn't that be elseif?
Image
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests