single use trigger per user.

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

Moderator: Core Staff

Post Reply
KemiX
CJ Newbie
CJ Newbie
Posts: 78
Joined: March 28th, 2006, 11:04 pm
Location: Netherlands
Contact:

Post by KemiX » April 18th, 2006, 1:33 pm

I would love to try, but I dont understand anything about that scripten.. I can do actionscript but not that :P
«Heal the world with codjumper.»

lol, great thing that sloganizer... ^^
>JumpCrew-KemiX =D

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

Post by Nightmare » April 18th, 2006, 7:25 pm

Well what you could do is make a trigger_once but that would make it so only the first person in the whole server could make it work. I'm sure its possible but I dont know how.
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
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 18th, 2006, 7:45 pm

Ok, this is the way I like to do things. Make a trigger that covers the spawn areas (so, touching the spawns) then make it a trigger_multiple with targetname "start" and then make a trigger_use for the finish button called "finish". Then try this code.

Code: Select all

main()
{
thread start();
}

start()
{
start = getent("start","targetname");

start waittill("trigger",user);
user thread finish_trigger();
}

finish_trigger()
{
finish = getent("finish","targetname");
finish waittill("trigger");

if(!isDefined(self.finishedmap))
{
iprintlnbold(self.name + "^7has completed the map!");
self.finishedmap = true;
}
}
Try that, see if you get any problems (I cannot test for myself atm)
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
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 18th, 2006, 9:09 pm

KillerSam wrote:drofder.....you amaze me, that works perfectly and credit will given to you on my loading screen, now that i know that code...im sure i can find lots of simliar uses for it......realy greatful :)
Good good :)
Ejoy :P
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

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » April 18th, 2006, 9:24 pm

Very nice, i knew Drofder would have an answer for this :)

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

Post by Drofder2004 » April 18th, 2006, 11:13 pm

KillerSam wrote:drofder.....you amaze me, that works perfectly and credit will given to you on my loading screen, now that i know that code...im sure i can find lots of simliar uses for it......realy greatful :)
tbh, the script is VERY basic.

its just people dont think about creating their own vairables (such as "self.finishedmap").
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
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 18th, 2006, 11:41 pm

Well, what im on about is the "self.<variables>"

easily used...

self.boolean = true; // or false;
self.integer = 123; //etc
self.string = "Hello";

you can even double the variables for example...

self.string.one = "Hello";
self.string.two = "Welcome";

You can use anything. You will notice most things that are map specific are...

level.<something> = <something>;

All variables must be defined before you use them... eg

You cannot do

if(self.boolean == false)
iprintln("Blah");

if self.boolean has no value (you will get an error). so you must "declare" them, simply using the method above...

<variable> = <value>;
self.finishedmap = true;

Ja?
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
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » April 19th, 2006, 12:06 am

wow drof, I'm amazed at how simple you kept it, good job :wink:
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 » July 22nd, 2006, 7:38 pm

is it also possible to make:
trigger_once instead trigger_use
so it works only ones per person
or will it only work 1 time?
cause i dont want it to be a button so just be activated wen u walk thru it.
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 » July 22nd, 2006, 7:39 pm

trigger_once does what it says.

It can only be triggered once (usually used in SP, for missions)
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

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

Post by creator » July 22nd, 2006, 7:46 pm

so how i make a trigger that be activated only once by 1 player
so everyone can walk in it and it only be triggerd ones
Cod 1 Mapper&Modder&Moddeler

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

Post by creator » July 22nd, 2006, 8:02 pm

...
so how i make it:
it only triggers ones per person
so if i walk thru it it works
if u walk thru it it works
if i walk again thru it it doesnt work
how can i do that wat i need to use?
trig_multiple?
or cant be possible?
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 » July 22nd, 2006, 10:35 pm

creator wrote:...
so how i make it:
it only triggers ones per person
so if i walk thru it it works
if u walk thru it it works
if i walk again thru it it doesnt work
how can i do that wat i need to use?
trig_multiple?
or cant be possible?
Read page 1.
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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest